|
1 | 1 | .. _Validating a Metadata Manifest: |
2 | 2 |
|
| 3 | +############################## |
3 | 4 | Validating a Metadata Manifest |
4 | | -================================================= |
| 5 | +############################## |
5 | 6 |
|
| 7 | +************* |
6 | 8 | Prerequisites |
7 | | -------------- |
| 9 | +************* |
8 | 10 |
|
9 | 11 | **Obtain Synapse Credentials**: |
10 | | -Ensure you have a Synapse account and set up Synapse configuration file correctly. See the :ref:`installation` section for more details. |
| 12 | +================================ |
| 13 | +Ensure you have a Synapse account and set up Synapse configuration file correctly. See the :ref:`setting up configuration files <installation:6. Set up configuration files>` section for more details. |
| 14 | + |
| 15 | + |
| 16 | +**Using the Schematic API in Production** |
| 17 | +========================================= |
| 18 | + |
| 19 | +Visit the **Schematic API (Production Environment)**: |
| 20 | +`<https://schematic.api.sagebionetworks.org/v1/ui/#/>`_ |
| 21 | + |
| 22 | +This will open the **Swagger UI**, where you can explore all available API endpoints. |
| 23 | + |
11 | 24 |
|
12 | 25 | **Before Using the Schematic CLI** |
| 26 | +================================== |
13 | 27 |
|
14 | 28 | - **Install and Configure Schematic**: |
15 | | - Ensure you have installed `schematic` and set up its dependencies. |
16 | | - See the :ref:`installation` section for more details. |
| 29 | + Ensure you have installed ``schematic`` and set up its dependencies. |
| 30 | + See the :ref:`installation:installation` section for more details. |
17 | 31 |
|
18 | 32 | - **Understand Important Concepts**: |
19 | 33 | Familiarize yourself with key concepts outlined on the :ref:`index` of the documentation. |
20 | 34 |
|
21 | 35 | - **Configuration File**: |
22 | | - For more details on configuring Schematic, refer to the documentation on :ref:`creating a configuration file for schematic <configuration>`. |
| 36 | + For more details on configuring Schematic, refer to the :ref:`configuration:Configure Schematic` section. |
23 | 37 |
|
24 | 38 | - **Obtain a manifest**: |
25 | 39 | Please obtain a manifest by following the documentation of :ref:`generating a manifest <manifest_generation>`. |
26 | 40 |
|
27 | 41 |
|
28 | | -**Using the Schematic API in Production** |
29 | | - |
30 | | -Visit the **Schematic API (Production Environment)**: |
31 | | -`<https://schematic.api.sagebionetworks.org/v1/ui/#/>`_ |
32 | | - |
33 | | -This will open the **Swagger UI**, where you can explore all available API endpoints. |
34 | | - |
35 | | - |
| 42 | +************ |
36 | 43 | Requirements |
37 | | -------------------------------------------------- |
| 44 | +************ |
38 | 45 |
|
39 | 46 | Authentication |
40 | | -~~~~~~~~~~~~~~~~~~~~ |
| 47 | +============== |
| 48 | + |
41 | 49 | Authentication with Synapse is required for metadata validation that includes Cross Manifest Validation rules or the ``filenameExists`` rule. |
42 | 50 |
|
43 | 51 | File Format |
44 | | -~~~~~~~~~~~~~~ |
| 52 | +=========== |
| 53 | + |
45 | 54 | In general, metadata manifests must be stored as ``.CSV`` files. When validating through the api, manifests may alternatively be sent as a JSON string. |
46 | 55 |
|
47 | 56 | Required Column Headers |
48 | | -~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 57 | +======================= |
| 58 | + |
49 | 59 | A ``Component`` column that specifies the data type of the metadata must be present in the manifest. Additionally, columns must be present for each attribute in the component that you wish to validate. |
50 | 60 |
|
51 | 61 | Restricted Column Headers |
52 | | -~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 62 | +========================= |
53 | 63 | The columns ``Filename``, ``entityId``, and ``Component`` are reserved for use by schematic and should not be used as other attributes in a data model. |
54 | 64 |
|
55 | | - |
| 65 | +******************* |
56 | 66 | Manifest Validation |
57 | | -------------------------------------------------- |
| 67 | +******************* |
| 68 | + |
58 | 69 | Overview |
59 | | -~~~~~~~~~ |
| 70 | +======== |
| 71 | + |
60 | 72 | Invalidities within a manifest’s metadata are classified as either errors or warnings depending on the rule itself, whether the attribute is required, and what the data modeler has specified. |
61 | 73 | Errors are considered serious invalidities that must be corrected before submission. Warnings are considered less serious invalidities that are acceptable. |
62 | 74 | A manifest with errors should not be submitted and the presence of errors found during submission will block submission. The presence of warnings will not block submission. |
@@ -93,14 +105,15 @@ or by viewing the parameter descriptions under the endpoints linked above. |
93 | 105 |
|
94 | 106 |
|
95 | 107 | With the CLI |
96 | | -~~~~~~~~~~~~~~~ |
| 108 | +============= |
97 | 109 |
|
98 | 110 | Authentication |
99 | | -^^^^^^^^^^^^^^^^ |
| 111 | +-------------- |
| 112 | + |
100 | 113 | To authenticate for use with the CLI, follow the installation guide instructions on how to :ref:`set up configuration files <set up configuration files>` |
101 | 114 |
|
102 | 115 | Parameters |
103 | | -^^^^^^^^^^^^^^^ |
| 116 | +---------- |
104 | 117 | --manifest_path/-mp |
105 | 118 | string |
106 | 119 |
|
@@ -150,14 +163,16 @@ The SynId of the fileview containing all relevant project assets should also be |
150 | 163 |
|
151 | 164 |
|
152 | 165 | With the API |
153 | | -~~~~~~~~~~~~~~~ |
| 166 | +============ |
154 | 167 |
|
155 | 168 | Authentication |
156 | | -^^^^^^^^^^^^^^^^ |
| 169 | +-------------- |
| 170 | + |
157 | 171 | Your Synapse token should be included the in the request headers under the ``access_token`` key. In the SwaggerUI this can be added by clicking the padlock icon at the top right or next to the endoints that accept it. |
158 | 172 |
|
159 | 173 | Parameters |
160 | | -^^^^^^^^^^^^^^^ |
| 174 | +---------- |
| 175 | + |
161 | 176 | schema_url |
162 | 177 | string |
163 | 178 | url to the raw version of the data model in either ``.CSV`` or ``.JSONLD`` formats |
@@ -200,21 +215,22 @@ dataset_scope |
200 | 215 | Specify a dataset to validate against for filename validation. |
201 | 216 |
|
202 | 217 | Request Body |
203 | | -^^^^^^^^^^^^^ |
| 218 | +------------ |
| 219 | + |
204 | 220 | file_name |
205 | 221 | string($binary) |
206 | 222 |
|
207 | 223 | ``.CSV`` or ``.JSON`` file of the metadata manifest |
208 | 224 |
|
209 | 225 |
|
210 | 226 | Response |
211 | | -^^^^^^^^^^^ |
| 227 | +-------- |
212 | 228 | If valiation completes successfully, regardless of the presence of validation errors or warnings, you'll recieve a ``200`` response code. |
213 | 229 | The body will be a JSON string containing a list of valiation errors and warnings in the format of ``{"errors": [list of errors], "warnings": [warnings]}`` |
214 | 230 |
|
215 | 231 | Validating though the CLI will display all the errors and warnings found during validation or a message that no errors or warnings were found and the manifest is considered valid. |
216 | 232 |
|
217 | | - |
| 233 | +***************** |
218 | 234 | With the Library |
219 | | -~~~~~~~~~~~~~~~~~ |
| 235 | +***************** |
220 | 236 | TODO |
0 commit comments