You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/domain.md
+38-2Lines changed: 38 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Create, update, or delete domain definitions as well as query domain details.
4
4
5
-
A domain is a collection of fields. Lists, Datasets, SampleTypes, DataClasses, and the Assay Batch, Run, and Result tables are backed by an LabKey internal datatype known as a Domain.
5
+
A domain is a collection of fields. Lists, Datasets, SampleTypes, DataClasses, and the Assay Batch, Run, and Result tables are backed by an LabKey internal datatype known as a Domain. Within the labkey python API, domains are objects so they have their own set of methods and attributes. These attributes can be updated so that the domain object with the updated attributes can be uploaded to a LabKey Server istance.
6
6
7
7
For more info about LabKey domains, see here, https://www.labkey.org/Documentation/wiki-page.view?name=labkeyDataStructures#domain.
8
8
@@ -42,7 +42,7 @@ List of method parameters:
42
42
**infer_fields**
43
43
44
44
List of method parameters:
45
-
- data_file: the data file from which to determine the fields shape
45
+
- data_file: the data file from which to determine the fields shape. The data file can be a tsv, csv, or excel file.
46
46
- container_path: labkey container path if not already set in context
47
47
48
48
**save**
@@ -53,3 +53,39 @@ List of method parameters:
53
53
- domain: Domain to save
54
54
- container_path: labkey container path if not already set in context
55
55
- options: associated domain options to be saved
56
+
57
+
## LabKey Domain Object, Methods, and Attributes
58
+
59
+
Domain objects are a LabKey Python API-defined class that stores information about a domain. They are received from the domain.create, domain.get, and domain.get_domain_details methods. They can also be edited using referencing their attributes and calling their methods, which allows scripts to edit domains and reupload them to a LabKey Server instance using the domain.save method. See below for a list of their methods and attributes.
60
+
61
+
### Methods
62
+
63
+
**add_field**
64
+
65
+
This method adds the field passed into it to the Domain object that uses it. It only has one argument: field. A field is a dict object that defines a name and other field parameters such as rangeURI. Here is an
66
+
example field: {"name": "fieldName", "rangeURI": "string"}
67
+
68
+
69
+
**to_json**
70
+
71
+
to_json returns a copy of the Domain object's data in a json format.
72
+
73
+
### Attributes
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
## Examples
90
+
For examples, see the /samples/domain_example.py file.
0 commit comments