Improved profile definition to have the required information

This commit is contained in:
Luca Frosini 2023-03-17 19:02:38 +01:00
parent 4762b53e40
commit b16f37b1ae
3 changed files with 119 additions and 43 deletions

View File

@ -20,7 +20,15 @@
<xs:sequence>
<xs:element type="xs:string" name="srcField" minOccurs="1" maxOccurs="1" />
<xs:element type="SrcType" name="srcType" minOccurs="1" maxOccurs="1" />
<xs:element type="xs:string" name="mandatory" minOccurs="1" maxOccurs="1" />
<xs:element name="mandatory" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
<xs:enumeration value="aggregated"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element type="xs:boolean" name="isSensitive" minOccurs="1" maxOccurs="1" />
<xs:element name="dstTypes" minOccurs="1" maxOccurs="1">
<xs:complexType>
@ -59,6 +67,7 @@
<xs:complexType name="SrcType">
<xs:choice>
<xs:sequence>
<xs:choice>
<xs:element name="simpleType" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
@ -67,6 +76,8 @@
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element type="VocabularyType" name="vocabulary" minOccurs="1" maxOccurs="1" />
</xs:choice>
</xs:sequence>
<xs:sequence>
<xs:element name="complexType" minOccurs="1" maxOccurs="1">

View File

@ -119,15 +119,7 @@
<xs:element type="xs:string" name="defaultValue" minOccurs="0"
maxOccurs="1"/>
<xs:element type="xs:string" name="note" minOccurs="0" maxOccurs="1"/>
<xs:element name="vocabulary" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="vocabularyField"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute type="xs:boolean" name="isMultiSelection"/>
</xs:complexType>
</xs:element>
<xs:element type="VocabularyType" name="vocabulary" minOccurs="0" maxOccurs="1" />
<xs:element name="validator" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
@ -170,6 +162,13 @@
</xs:sequence>
<xs:attribute name="categoryref" use="optional" type="xs:string" />
</xs:complexType>
<xs:complexType name="VocabularyType">
<xs:sequence>
<xs:element type="xs:string" name="vocabularyField"
minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute type="xs:boolean" name="isMultiSelection"/>
</xs:complexType>
<xs:complexType name="Extra">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip">

View File

@ -49,16 +49,18 @@
<dstTypes>
<dstType maxOccur="*">Field</dstType>
</dstTypes>
<comments>
It generates a Resource for each element of the array.
</comments>
</grsf>
</extra>
</metadatafield>
<metadatafield>
<metadatafield categoryref="stock_identity">
<fieldName>Database Source</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note>A list of elements of the type {"name": "a name", "description": "a description", "url": "http://...."}. Name and url are mandatory. For the attribute name there is a controlled vocabulary: FIRMS, RAM, FishSource. Example: "database_sources": [{"name":"FIRMS", "description": "unknown", "url":"http://....."}, ...]</note>
<extra>
<grsf>
<srcField>database_sources</srcField>
@ -82,9 +84,15 @@
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<dstType maxOccur="*">Field</dstType>
<dstType maxOccur="*">Resource</dstType>
</dstTypes>
<comments>It generates a Resource with the content of refers_to input field. No metadata field is created.</comments>
<comments>
A list of elements of the type {"name": "a name", "description": "a description", "url": "http://...."}.
Name and url are mandatory. For the attribute name there is a controlled vocabulary: FIRMS, RAM, FishSource.
Example: "database_sources": [{"name":"FIRMS", "description": "unknown", "url":"http://....."}, ...].
It generates a Resource for each element of the array.
</comments>
</grsf>
</extra>
</metadatafield>
@ -94,7 +102,6 @@
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note>A list of elements of the type {"name": "a name", "description": "a description", "url": "http://...."}. Name and url are mandatory. Example: "source_of_information" : [{"name":"...", "description": "...", "url":"http://....."},...]</note>
<extra>
<grsf>
<srcField>source_of_information</srcField>
@ -120,7 +127,12 @@
<dstTypes>
<dstType maxOccur="*">Resource</dstType>
</dstTypes>
<comments>It generates a Resource with the content of refers_to input field. No metadata field is created.</comments>
<comments>
A list of elements of the type {"name": "a name", "description": "a description", "url": "http://...."}.
Name and url are mandatory.
Example: "source_of_information" : [{"name":"...", "description": "...", "url":"http://....."},...].
It generates a Resource with the content of refers_to input field. No metadata field is created.
</comments>
</grsf>
</extra>
</metadatafield>
@ -130,7 +142,6 @@
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note>A list of objects of the format {"url": "http://", "id": "..."} that allows the aggregated GRSF records to point to their source records already published in the catalogue. The URL and the id are both mandatory and are the ones returned by the services when a source record is published. Example: Check the record http://data.d4science.org/ctlg/GRSF_Admin/f82393dd-d23a-3c26-98d3-ccc5f7910266 The JSON submitted by KB contains: "refers_to" : [ { "id" : "c29b2485-c33f-3c03-8790-55a1dcf045ed", "url" : "http://data.d4science.org/ctlg/GRSF_Admin/c29b2485-c33f-3c03-8790-55a1dcf045ed"}]. The reference is in the generated resource FIRMS.</note>
<extra>
<grsf>
<srcField>refers_to</srcField>
@ -152,7 +163,15 @@
<dstTypes>
<dstType maxOccur="*">Resource</dstType>
</dstTypes>
<comments>It generates a Resource with the content of refers_to input field. No metadata field is created.</comments>
<comments>
It generates a Resource with the content of refers_to input field.
A list of objects of the format {"url": "http://", "id": "..."} that allows the aggregated GRSF records to point to their source records already published in the catalogue.
The URL and the id are both mandatory and are the ones returned by the services when a source record is published.
Example: Check the record http://data.d4science.org/ctlg/GRSF_Admin/f82393dd-d23a-3c26-98d3-ccc5f7910266.
The JSON submitted by KB contains: "refers_to" : [ { "id" : "c29b2485-c33f-3c03-8790-55a1dcf045ed", "url" : "http://data.d4science.org/ctlg/GRSF_Admin/c29b2485-c33f-3c03-8790-55a1dcf045ed"}].
The reference is in the generated resource FIRMS.
No metadata field is created.
</comments>
</grsf>
</extra>
</metadatafield>
@ -162,7 +181,6 @@
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note>. Example: American Plaice NAFO-5YZ - https://data.d4science.org/ctlg/GRSF_Admin/f6342402-b5fb-3457-9b49-c0a018f2ce72</note>
<extra>
<grsf>
<srcField>short_name</srcField>
@ -174,6 +192,10 @@
<dstTypes>
<dstType>Field</dstType>
</dstTypes>
<comments>
Example: "American Plaice NAFO-5YZ".
Check the record https://data.d4science.org/ctlg/GRSF_Admin/f6342402-b5fb-3457-9b49-c0a018f2ce72.
</comments>
</grsf>
</extra>
</metadatafield>
@ -195,7 +217,7 @@
<grsf>
<srcField>sdg_flag</srcField>
<srcType>
<simpleType>String</simpleType>
<simpleType>Boolean</simpleType>
</srcType>
<mandatory>true</mandatory>
<isSensitive>false</isSensitive>
@ -211,7 +233,6 @@
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note>Controlled vocabulary: Pending, Rejected, Confirmed, Archived, Hidden, Merged (i.e. when the aggregated record comes out from more than one source record)</note>
<vocabulary isMultiSelection="false">
<vocabularyField>Pending</vocabularyField>
<vocabularyField>Rejected</vocabularyField>
@ -224,13 +245,23 @@
<grsf>
<srcField>status_grsf_record</srcField>
<srcType>
<simpleType>String</simpleType>
<vocabulary isMultiSelection="false">
<vocabularyField>Pending</vocabularyField>
<vocabularyField>Rejected</vocabularyField>
<vocabularyField>Confirmed</vocabularyField>
<vocabularyField>Archived</vocabularyField>
<vocabularyField>Hidden</vocabularyField>
<vocabularyField>Merged</vocabularyField>
</vocabulary>
</srcType>
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<dstType>Field</dstType>
</dstTypes>
<comments>
Controlled vocabulary: Pending, Rejected, Confirmed, Archived, Hidden, Merged (i.e. when the aggregated record comes out from more than one source record)
</comments>
</grsf>
</extra>
</metadatafield>
@ -240,7 +271,6 @@
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>*</maxOccurs>
<note>A time series of value, unit and date. Example: "catches": [{"unit" : "...", "value": "...", "year": "..."}, ...]</note>
<groups>
<group create="true" propagateUp="false">
<fixedValue>catch-group</fixedValue>
@ -257,6 +287,11 @@
<dstTypes>
<dstType>TimeSeries</dstType>
</dstTypes>
<comments>
A time series of value, unit and date. Example: "catches": [{"unit" : "...", "value": "...", "year": "..."}, ...]
It generate a Resource containing all the content of the input field (i.e. a TimeSeries)
and as many Field as the number of element in the JsonArray.
</comments>
</grsf>
</extra>
</metadatafield>
@ -266,7 +301,6 @@
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>*</maxOccurs>
<note>A time series of value, unit and date. Example: "landings": [{"unit" : "...", "value": "...", "year": "..."}, ...]</note>
<groups>
<group create="true" propagateUp="false">
<fixedValue>landing-group</fixedValue>
@ -283,39 +317,71 @@
<dstTypes>
<dstType>TimeSeries</dstType>
</dstTypes>
<comments>
A time series of value, unit and date. Example: "landings": [{"unit" : "...", "value": "...", "year": "..."}, ...]
It generate a Resource containing all the content of the input field (i.e. a TimeSeries)
and as many Field as the number of element in the JsonArray.
</comments>
</grsf>
</extra>
</metadatafield>
<!--
<metadatafield>
<fieldName></fieldName>
<metadatafield categoryref="stock_identity">
<fieldName>Species</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note></note>
<maxOccurs>*</maxOccurs>
<tags>
<tag create="true">
<how>onValue</how>
</tag>
</tags>
<extra>
<grsf>
<srcField></srcField>
<srcField>species</srcField>
<srcType>
<complexType>JsonArray</complexType>
</srcType>
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<dstType>Field</dstType>
<dstType maxOccur="*">Field</dstType>
</dstTypes>
</grsf>
</extra>
</metadatafield>
<metadatafield categoryref="stock_identity">
<fieldName>Similar GRSF Record</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>*</maxOccurs>
<extra>
<grsf>
<srcField>similar_grsf_records</srcField>
<srcType>
<complexType>JsonArray</complexType>
</srcType>
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<dstType maxOccur="*">Field</dstType>
</dstTypes>
</grsf>
</extra>
</metadatafield>
<metadatafield>
<!--
<metadatafield categoryref="">
<fieldName></fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<note></note>
<maxOccurs>*</maxOccurs>
<tags>
<tag create="true">
<how>onValue</how>
</tag>
</tags>
<extra>
<grsf>
<srcField></srcField>
@ -325,7 +391,7 @@
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<dstType>Field</dstType>
<dstType maxOccur="*">Field</dstType>
</dstTypes>
</grsf>
</extra>