Improved profile schema version 5

This commit is contained in:
Luca Frosini 2023-03-21 11:38:33 +01:00
parent 89fce46380
commit 372462cffb
3 changed files with 128 additions and 57 deletions

View File

@ -5,15 +5,30 @@
vc:minVersion="1.1">
<xs:redefine schemaLocation="profile5.xsd">
<xs:complexType name="Extra">
<xs:complexType name="ExtraMetadataFieldType">
<xs:complexContent>
<xs:restriction base="Extra">
<xs:restriction base="ExtraMetadataFieldType">
<xs:sequence>
<xs:element type="GRSFType" name="grsf" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ExtraMetadataFormatType">
<xs:complexContent>
<xs:restriction base="ExtraMetadataFormatType">
<xs:sequence>
<xs:element name="grsfFields" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="GRSFType" name="grsfField" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:redefine>
<xs:complexType name="GRSFType">
@ -32,9 +47,10 @@
<xs:element type="xs:boolean" name="isSensitive" minOccurs="1" maxOccurs="1" />
<xs:element name="dstTypes" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element type="DestinationType" name="dstType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:element type="xs:string" name="topField" minOccurs="1" maxOccurs="unbounded"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element type="xs:string" name="comments" minOccurs="0" maxOccurs="1" />

View File

@ -7,6 +7,15 @@
<xs:complexType>
<xs:sequence>
<xs:element type="ExtendedMetadataFieldType" name="metadatafield" minOccurs="0" maxOccurs="unbounded" />
<xs:element type="ExtraMetadataFormatType" name="extra" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
Any additional tag in this 'extra' tag.
This tag and its content are ignored by the validators.
They are used by any external tools producing/consuming the profile definition and instances.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute type="NotEmpty" use="required" name="type">
<xs:annotation>
@ -178,7 +187,16 @@
</xs:sequence>
<xs:attribute type="xs:boolean" name="isMultiSelection"/>
</xs:complexType>
<xs:complexType name="Extra">
<xs:complexType name="ExtraMetadataFieldType">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip">
<xs:annotation>
<xs:documentation>Any tags are allowed</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ExtraMetadataFormatType">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip">
<xs:annotation>
@ -191,10 +209,12 @@
<xs:complexContent>
<xs:extension base="MetadataFieldType">
<xs:sequence>
<xs:element type="Extra" name="extra" minOccurs="0" maxOccurs="1">
<xs:element type="ExtraMetadataFieldType" name="extra" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>
Any 'metadataField' definition can include any additional attribute in this 'extra' tag. This tag and its content are ignored by the validators. They are used by any external tools producing/consuming the profile definition and instances.
Any additional tag in this 'extra' tag.
This tag and its content are ignored by the validators.
They are used by any external tools producing/consuming the profile definition and instances.
</xs:documentation>
</xs:annotation>
</xs:element>

View File

@ -2,6 +2,15 @@
<!DOCTYPE xml>
<metadataformat type="Assessment Unit" version="5">
<!--
Examples from
Stock - Assessment Unit - GRSF - https://data.d4science.org/ctlg/GRSF_Admin/00a1f849-1b43-3fd1-9255-1d1134c969bb
-->
<!-- Starts of Common Metadata -->
<metadatafield categoryref="stock_identity">
@ -23,44 +32,49 @@
<grsf>
<srcField>grsf_type</srcField>
<srcType>
<simpleType>String</simpleType>
<vocabulary isMultiSelection="false">
<vocabularyField>assessment unit</vocabularyField>
</vocabulary>
</srcType>
<mandatory>true</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<dstType>Field</dstType>
</dstTypes>
<comments>
Example: "grsf_type" : "assessment unit". https://data.d4science.org/ctlg/GRSF_Admin/00a1f849-1b43-3fd1-9255-1d1134c969bb
</comments>
</grsf>
</extra>
</metadatafield>
<metadatafield categoryref="stock_identity">
<fieldName>Short Name</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<remove>false</remove>
<extra>
<grsf>
<srcField>short_name</srcField>
<srcType>
<simpleType>String</simpleType>
</srcType>
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<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>
<!-- Source not needed in profile -->
<metadatafield categoryref="stock_data">
<fieldName>Data Owner</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>*</maxOccurs>
<remove>false</remove>
<extra>
<grsf>
<srcField>data_owner</srcField>
<srcType>
<complexType>JsonArray</complexType>
</srcType>
<mandatory>false</mandatory>
<isSensitive>true</isSensitive>
<!-- Set remove tag to true in GRSF Public VRE -->
<dstTypes>
<dstType maxOccur="*">Field</dstType>
</dstTypes>
<comments>
It generates a Resource for each element of the array.
</comments>
</grsf>
</extra>
</metadatafield>
<metadatafield categoryref="stock_identity">
<fieldName>Database Source</fieldName>
<mandatory>false</mandatory>
@ -103,6 +117,31 @@
</extra>
</metadatafield>
<metadatafield categoryref="stock_data">
<fieldName>Data Owner</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>*</maxOccurs>
<remove>false</remove>
<extra>
<grsf>
<srcField>data_owner</srcField>
<srcType>
<complexType>JsonArray</complexType>
</srcType>
<mandatory>false</mandatory>
<isSensitive>true</isSensitive>
<!-- Set remove tag to true in GRSF Public VRE -->
<dstTypes>
<dstType maxOccur="*">Field</dstType>
</dstTypes>
<comments>
It generates a Resource for each element of the array.
</comments>
</grsf>
</extra>
</metadatafield>
<metadatafield>
<fieldName>Source of Information</fieldName>
<mandatory>false</mandatory>
@ -184,30 +223,7 @@
</extra>
</metadatafield>
<metadatafield categoryref="stock_identity">
<fieldName>Short Name</fieldName>
<mandatory>false</mandatory>
<dataType>String</dataType>
<maxOccurs>1</maxOccurs>
<remove>false</remove>
<extra>
<grsf>
<srcField>short_name</srcField>
<srcType>
<simpleType>String</simpleType>
</srcType>
<mandatory>aggregated</mandatory>
<isSensitive>false</isSensitive>
<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>
<metadatafield>
<fieldName>SDG Flag</fieldName>
@ -1011,5 +1027,24 @@
</extra>
</metadatafield>
-->
<extra>
<grsfFields>
<grsfField>
<srcField>stock_name</srcField>
<srcType>
<simpleType>String</simpleType>
</srcType>
<mandatory>true</mandatory>
<isSensitive>false</isSensitive>
<dstTypes>
<topField>title</topField>
</dstTypes>
<comments>
Example: "stock_name" : "Cancer pagurus - Central North Sea (Division 27.4.b)". https://data.d4science.org/ctlg/GRSF_Admin/00a1f849-1b43-3fd1-9255-1d1134c969bb
</comments>
</grsfField>
</grsfFields>
</extra>
</metadataformat>