Skip to content

Commit 69858f1

Browse files
authored
Update domain.md
1 parent 6c7ddfc commit 69858f1

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

docs/domain.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Create, update, or delete domain definitions as well as query domain details.
44

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.
66

77
For more info about LabKey domains, see here, https://www.labkey.org/Documentation/wiki-page.view?name=labkeyDataStructures#domain.
88

@@ -42,7 +42,7 @@ List of method parameters:
4242
**infer_fields**
4343

4444
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.
4646
- container_path: labkey container path if not already set in context
4747

4848
**save**
@@ -53,3 +53,39 @@ List of method parameters:
5353
- domain: Domain to save
5454
- container_path: labkey container path if not already set in context
5555
- 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.
91+

0 commit comments

Comments
 (0)