Difference between revisions of "GCat Background"

From Gcube Wiki
Jump to: navigation, search
(Metadata Profile schema: gcdcmetadataprofile.xsd)
(Users, Roles and Groups)
 
(237 intermediate revisions by 7 users not shown)
Line 1: Line 1:
'''** THIS PAGE IS UNDER CONSTRUCTION **'''
+
 
== gCube Data Catalogue ==
+
{|align=right
 +
||__TOC__
 +
|}
 +
 
 +
A catalogue is a service supporting its users to publish and search collections of descriptive information (metadata) for items including data, services, and related information objects.
  
 
D4Science offers services for seamless access and analysis to a wide spectrum of data including biological and ecological data, geospatial data, statistical data and semi-structured data from multiple authoritative data providers and information systems. These services can be exploited both via web based graphical user interfaces and web based protocols for programmatic access, e.g. OAI-PMH, CSW, WFS, SDMX. This offering nicely complements specific and community-specific applications.
 
D4Science offers services for seamless access and analysis to a wide spectrum of data including biological and ecological data, geospatial data, statistical data and semi-structured data from multiple authoritative data providers and information systems. These services can be exploited both via web based graphical user interfaces and web based protocols for programmatic access, e.g. OAI-PMH, CSW, WFS, SDMX. This offering nicely complements specific and community-specific applications.
 
The gCube Data Catalogue catalogue contains a wealth of resources resulting from several activities, projects and communities including BlueBRIDGE (www.bluebridge-vres.eu/), i-Marine (www.i-marine.eu), SoBigData.eu (www.sobigdata.eu), and FAO (www.fao.org). All the products are accompanied with rich descriptions capturing general attributes, e.g. title and creator(s), as well as usage policies and licences.  
 
The gCube Data Catalogue catalogue contains a wealth of resources resulting from several activities, projects and communities including BlueBRIDGE (www.bluebridge-vres.eu/), i-Marine (www.i-marine.eu), SoBigData.eu (www.sobigdata.eu), and FAO (www.fao.org). All the products are accompanied with rich descriptions capturing general attributes, e.g. title and creator(s), as well as usage policies and licences.  
  
 
+
The gCube Data Catalogue is built using and extending CKAN platform. CKAN is a powerful DMS (data management system) that makes data accessible – by providing tools to streamline publishing, sharing, finding and using data.  
 
+
The gCube Data Catalogue is builded using and extending CKAN platform. CKAN is a powerful DMS (data management system) that makes data accessible – by providing tools to streamline publishing, sharing, finding and using data.  
+
 
CKAN is an open-source DMS for powering data hubs and data portals. CKAN makes it easy to publish, share and use data see: http://ckan.org/
 
CKAN is an open-source DMS for powering data hubs and data portals. CKAN makes it easy to publish, share and use data see: http://ckan.org/
  
Line 13: Line 15:
  
 
[[File:ckan_entities.png|1000px|thumb|center|CKAN: 'Entities and Relations']]
 
[[File:ckan_entities.png|1000px|thumb|center|CKAN: 'Entities and Relations']]
 +
 +
== Available Catalogues and their public locations ==
 +
 +
''BLUEBRIDGE Catalogue''
 +
 +
* https://bluebridge.d4science.org/catalogue-bluebridge
 +
* https://i-marine.d4science.org/catalogue-bluebridge
 +
 +
''D4Science Catalogue''
 +
* https://services.d4science.org/catalogue-d4s1
  
 
== Metadata ==
 
== Metadata ==
Line 98: Line 110:
 
gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.
 
gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.
  
A gCube Metadata Profile is composed by one Metadata Format (<metadataformat>) that contains one or many (<metadatafield>). The schema is shown below.
+
A gCube Metadata Profile is composed by one Metadata Format (<metadataformat>) containing an ordered list of (at least one) '''Metadata Field''' (<metadatafield>).  
 +
From version 3 a Metadata Field can contain also a reference (categoryref="category_id_#") to an entity "Category" using the Namespace of the Category (<namespace id="category_id_#">).
 +
Add a Category Reference to a Metadata Field means that the "field" belongs to the Category referred by Category Identifier (id="category_id_#).
 +
See Metadata Profile v.3. for more details.
  
===== Metadata Profile v.3 (under construction) =====
+
===== Metadata Profile v.4 =====
  
This one will be relased for gCube 4.4. What's new:
+
Metadata Profile v.4 is a XML file having the format:
 
+
Metadata Category:
+
* a metadatacategory defines a "class" for metadata fields having particular characteristics. Each metadatacategory has a unique id (id="category_id_#"). A metadata field can belong to only one Metadata Category referring it via idref (categoryref="id category to which metadata field belongs").
+
 
+
Tagging:
+
* tagging element must be equal one or both values of the list: {onFieldName, onValue}. It is used by Data Catalogue fron-end in order to add the field name (using 'onFieldName') and/or value specified to it (using 'onValue') as a Tag of metadata field. The attribute create="true" is used to specify: create the Tag if does not exist, no otherwise. The attribute separator="char_to_separate" (when both 'onFieldName' and 'onValue' are specified for the metadata field) is the character that will be used to separate the FieldName from its value.
+
 
+
Grouping:
+
* grouping element must be equal one or both values of the list: {onFieldName, onValue}. It is used by Data Catalogue fron-end in order to add the field name (using 'onFieldName') and/or value specified to it (using 'onValue') as a Group of Data Catalogue. Data Catalogue [https://ckan-d4s.d4science.org/group groups] are used for browsing.
+
  
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<metadataformat type="type_of_metadata">
+
<metadataformat type="YOUR TYPE HERE">
    <metadatacategory id="category_id_#">
+
        <title>Title of Category #</title>
+
        <description>Description of Category #</description>
+
    </metadatacategory>
+
 
     <metadatafield categoryref="category_id_#">
 
     <metadatafield categoryref="category_id_#">
 +
        <fieldId>ID of Metadata Field that identifies the field name in the Document (stored in the Service)</fieldId>
 
         <fieldName>Name of Metadata Field</fieldName>
 
         <fieldName>Name of Metadata Field</fieldName>
 +
        <mandatory>true|false</mandatory>
 
         <dataType>String|Time|Time_Interval|Times_ListOf|Text|Boolean|Number|GeoJSON</dataType>
 
         <dataType>String|Time|Time_Interval|Times_ListOf|Text|Boolean|Number|GeoJSON</dataType>
 +
        <maxOccurs>N|*</maxOccurs>
 
         <defaultValue>default value</defaultValue>
 
         <defaultValue>default value</defaultValue>
         <note>shown as suggestions in the insert/update metadata form of CKAN
+
         <note>[the note is shown as a suggestion in the insert/update metadata form of Catalogue Publisher Widget]
 
</note>
 
</note>
 
         <vocabulary isMultiSelection="true|false">
 
         <vocabulary isMultiSelection="true|false">
Line 134: Line 139:
 
             <regularExpression>a regular expression for validating values</regularExpression>
 
             <regularExpression>a regular expression for validating values</regularExpression>
 
         </validator>
 
         </validator>
         <tagging create="true|false" separator="char_to_separate">{onFieldName, onValue}</tagging>
+
         <tagging create="true|false" separator="char_to_separate">onFieldName|onValue|onFieldName_onValue|onValue_onFieldName</tagging>  
         <grouping create="true|false">{onFieldName, onValue}</grouping>
+
         <grouping create="true|false">onFieldName|onValue|onFieldName_onValue|onValue_onFieldName</grouping>
 
     </metadatafield>
 
     </metadatafield>
 
</metadataformat>
 
</metadataformat>
 
</pre>
 
</pre>
  
DataType values:
 
* GeoJSON: is a string. [http://geojson.org/geojson-spec.html GeoJSON] is a format for encoding a variety of geographic data structures.
 
  
Instance of MedataField for GeoSpatial:
+
The <fieldId> is optional. It declares (if present in the profile) the value that will be used to specify the field name in the Document (e.g. JSON Document) passed to Service that will store the resulting Document.
 +
If the <fieldId> is absent in the profile, the value of the <fieldName> (which is mandatory) will be used as field name in the Document.
 +
 
 +
The <fieldName> field contains the name of the metadata field.
 +
 
 +
The <mandatory> field declares if the <metadatafield> is a field mandatory (by using 'true') or not (by using 'false').
 +
 
 +
'''DataType values''':
 +
 
 +
The <dataType> field specifies the kind of data. A valid dataType must be equal to one of the values {String, Time, Time_Interval, Times_ListOf, Text, Boolean, Number, GeoJSON}. When the data type is not specified the metadata field has the default value "String". '''Temporal type''':  can be specified by using the value Time or Time_Interval or Times_ListOf (based on [https://en.wikipedia.org/wiki/ISO_8601 ISO 8601]). '''Spatial type''': can be specified by using the value GeoJSON.
 +
 
 +
In detail:
 +
* String: is a string;
 +
* Time: an instant time that follows the general format: YYYY-MM-DD [HH:MM] where: YYYY: 4-digit year, MM: 2-digit month, DD: 2-digit day, [optional HH: 2-digit hour], [optional MM: 2-digit minute] (e.g. "2005-03-01");
 +
* Time_Interval: a continuous interval instead of a single instant by specifying a start and end time, separated by one '/' ('slash') character (e.g. "2005-03-01/2006-05-11");
 +
* Times_ListOf: a list of discrete time values, separated by a ',' ('comma') character (e.g. "2005-03-01, 2006-05-11, 2006-05-11-2007-04-12");
 +
* Text: is a text;
 +
* Boolean: is True/False;
 +
* Number: is a valid Java number, see: Apache Commons NumberUtils.isNumber;
 +
* GeoJSON: is a string in the JSON format of kind GeoJSON (in particular it should contain a '''GeoJSON geometry'''). The [http://geojson.org/geojson-spec.html GeoJSON] is a format for encoding a variety of geographic data structures.
 +
 
 +
: '''GeoSpatial Data (the ''spatial'' field)''':
 +
 
 +
: In order to make a metadata a GeoSpatial Data and searchable by location via GeoSpatial Search Widget (see at [[#GeoSpatial_search_for_datasets:_via_API_or_Search_Widget]]), it must have a 'fieldName' named `spatial` with 'dataType' GeoJSON and a valid GeoJSON geometry as value.
 +
 
 +
: E.g. A MedataField with GeoSpatial data:
 
<pre>
 
<pre>
 
     <metadatafield idref="category_id_#">
 
     <metadatafield idref="category_id_#">
         <fieldName>spatial</fieldName>  <!--'spatial' is mandatory name of GeoSpatial field -->
+
         <fieldName>spatial</fieldName>  <!--'spatial' is the reserved field name to assign a GeoSpatial dimension to metadata -->
 
         <dataType>GeoJSON</dataType>
 
         <dataType>GeoJSON</dataType>
         <defaultValue>{GEO JSON DEFAULT VALUE}/defaultValue>
+
         <defaultValue>{"type": "Point","coordinates": [-20.145,74.078]}</defaultValue>
         <note>shown as suggestions in the insert/update metadata form of CKAN</note>
+
         <note>Please, insert a valid GeoJSON</note>
 
     </metadatafield>
 
     </metadatafield>
 +
</pre>
  
 +
: see more details about [[#Geo_Datasets]]
 +
 +
: '''Temporal Data (the ''time_date'' field)''':
 +
 +
: In order to make a metadata a Temporal Data and searchable by time via Time Search Widget, it must have a 'fieldName' named `time_date` with 'dataType' Time and a valid ISO 8601 date as value.
 +
 +
: E.g. A MedataField with Temporal data:
 +
<pre>
 +
    <metadatafield idref="category_id_#">
 +
        <fieldName>time_date</fieldName>  <!--'time_date' is the reserved field name to assign a Temporal dimension to metadata -->
 +
        <dataType>Time</dataType>
 +
        <defaultValue>2019-7-29</defaultValue>
 +
        <note>Please, insert a valid ISO 8601 date</note>
 +
    </metadatafield>
 
</pre>
 
</pre>
  
====== Metadata Profile schema: gcdcmetadataprofile.xsd ======
+
: see more details about [[#Temporal_Datasets]]
  
The gCube Data Catalogue Metadata Profile schema:
+
'''maxOccurs Indicator''':
 +
 
 +
The <maxOccurs> indicator specifies the maximum number of times that <metadatafield> can occur:
 +
* N (as number): if the field must appear N  times;
 +
* * (as char asterisk): if the field can appear an unlimited number of times.
 +
 
 +
'''Categories as "Namespaces"''':
 +
 
 +
* the Namespace of a Category declares a "class" for metadata fields having particular characteristics. It has been introduced in order to group metadata fields for categories and displaying them in a dedicated area through advanced GUI provided by CKAN D4Science plugin.
 +
 
 +
Namespaces (for Categories) are defined in an XML file made by one Namespaces element (<namespaces>) containing a list of (at least) one or many Namespace (<namespace>). The file has the format:
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<namespaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 +
<namespace id="category_id_#">
 +
<name>Category Name</name>
 +
<title>Category Title</title>
 +
<description>This section is about Category description</description>
 +
</namespace>
 +
</namespaces>
 +
</pre>
 +
 
 +
A Namespace element (<namespace>) has an attribute (id) and three entities. The attribute "id" must be unique in the file [[#Namespaces_Categories_schema:_NamespacesCatalogueCategories.xsd]], it represents the category identifier for the Category. The elements are: name (is mandatory), title (is mandatory), description (is optional).
 +
 
 +
Metadata Field and Category Reference (categoryref="category_id_#"):
 +
* categoryref is an optional attribute. It is a unique id (id="category_id_#"). A metadata field can belong to only one Namespace of a Category referring it via idref (categoryref="id category to which metadata field belongs one").
 +
 
 +
Type of (meta)data (is Mandatory):
 +
* type: a Metadata Format (metadataformat) must have a unique 'type' (as a xml attribute) that declares a "type" for it. This mandatory information is saved as custom key (system:type="value of type") of the item stored in the Data Catalogue.
 +
 
 +
'''Tagging''':
 +
* It is used by gCube Data Catalogue front-end for adding a metadata field as a Tag of the metadata. A Tag is a string between 2 and 100 characters long containing only alphanumeric characters and '-' (hyphen), '_' (underscore), . (dot). Tagging element in the Metadata Profile schema v3 must have a value equal to one of the values: {onFieldName, onValue, onFieldName_onValue, onValue_onFieldName}. Tagging values meanings:
 +
** onFieldName: (only) the fieldName specified to metadata field must be added as a Tag;
 +
** onValue: (only) the value specified to metadata field must be added as a Tag;
 +
** onFieldName_onValue: both the fieldName and the value (in this order) specified to metadata field must be added as a Tag. They are separated by string used as separator (<tagging create="true|false" separator="char_to_separate">{onFieldName_onValue}</tagging>);
 +
** onValue_onFieldName: both the value and the fieldName (in this order) specified to metadata field  must be added as a Tag. They are separated by string used as separator (<tagging create="true|false" separator="char_to_separate">{onValue_onFieldName}</tagging>).
 +
* Moreover, Tagging has two (optional) attribute: 'create' and 'separator'. The first one (create="true"|"false") is used to mean: create the Tag if does not exist, no otherwise. The second one (separator="char_to_separate") is the string that will be used to separate the FieldName from its value. Default value for separator is the character '-' if it is not specified.
 +
 
 +
Tagging example: using following instance of metadata field
 +
<pre>
 +
<metadatafield categoryref="contact">
 +
<fieldName>Name</fieldName>
 +
<dataType>String</dataType>
 +
<defaultValue>My Name</defaultValue>
 +
<note>Insert your Name</note>
 +
<tagging create="true" separator="-">onFieldName_onValue</tagging>
 +
</metadatafield>
 +
</pre>
 +
 
 +
where My Name is "Francesco", gCube Data Catalogue adds the tag Name-Francesco to metadata field if it does not exist
 +
 
 +
'''Grouping''':
 +
* It is used by Data Catalogue fron-end for adding a metadata field to a Group of Data Catalogue. Data Catalogue [https://ckan-d4s.d4science.org/group groups] are used for browsing. Grouping element in the Metadata Profile schema v3 must have a value equal to one of the values: {onFieldName, onValue, onFieldName_onValue, onValue_onFieldName}. The (optional) attribute create="true" is used to mean: create the Group if does not exist, no otherwise. Grouping values meanings:
 +
** onFieldName: (only) the fieldName specified to metadata field must be added to a Group;
 +
** onValue: (only) the value specified to metadata field must be added to a Group;
 +
** onFieldName_onValue: both the fieldName and the value (in this order) specified to metadata field must be added to a Group (<grouping create="true|false">{onFieldName_onValue}</grouping>);
 +
** onValue_onFieldName: both the value and the fieldName (in this order) specified to metadata field must be added to a Group (<grouping create="true|false">{onValue_onFieldName}</grouping>).
 +
* Moreover, Grouping has one (optional) attribute: 'propagateUp' This property will let a user specify if an item, that is going to be added to that group, must be also added to the hierarchical chain of groups involving it. For instance, if we have group B as child of group A, and item I is going to be added to B, then it will also be added to A.
 +
 
 +
====== Metadata Profile schema: gcdcmetadataprofilev3.xsd ======
 +
 
 +
The gCube Data Catalogue Metadata Profile (v.3) schema:
  
 
<pre>
 
<pre>
Line 162: Line 266:
 
<xs:schema attributeFormDefault="unqualified"
 
<xs:schema attributeFormDefault="unqualified"
 
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
 +
<xs:include schemaLocation="NamespacesCatalogueCategories.xsd"/>
 
<xs:element name="metadataformat">
 
<xs:element name="metadataformat">
 
<xs:complexType>
 
<xs:complexType>
 
<xs:sequence>
 
<xs:sequence>
<xs:element name="metadatacategory" minOccurs="0"
+
<xs:element name="metadatafield" minOccurs="0" maxOccurs="unbounded">
maxOccurs="unbounded">
+
<xs:complexType>
+
<xs:sequence>
+
<xs:element type="xs:string" name="title" />
+
<xs:element type="xs:string" name="description" />
+
</xs:sequence>
+
<xs:attribute name="id" use="required" type="xs:ID" />
+
</xs:complexType>
+
</xs:element>
+
<xs:element name="metadatafield" minOccurs="1" maxOccurs="unbounded">
+
 
<xs:complexType>
 
<xs:complexType>
 
<xs:sequence>
 
<xs:sequence>
 
<xs:element type="xs:string" name="fieldName" />
 
<xs:element type="xs:string" name="fieldName" />
 +
<xs:element type="xs:boolean" name="mandatory"
 +
minOccurs="0" maxOccurs="1" />
 
<xs:element name="dataType">
 
<xs:element name="dataType">
 
<xs:simpleType>
 
<xs:simpleType>
Line 193: Line 290:
 
</xs:simpleType>
 
</xs:simpleType>
 
</xs:element>
 
</xs:element>
<xs:element type="xs:string" name="defaultValue" />
+
<xs:element type="xs:string" name="maxOccurs"
<xs:element type="xs:string" name="note" />
+
minOccurs="0" maxOccurs="1" />
<xs:element name="vocabulary">
+
<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:complexType>
 
<xs:sequence>
 
<xs:sequence>
 
<xs:element type="xs:string" name="vocabularyField"
 
<xs:element type="xs:string" name="vocabularyField"
maxOccurs="unbounded" minOccurs="1" />
+
minOccurs="1" maxOccurs="unbounded" />
 
</xs:sequence>
 
</xs:sequence>
 
<xs:attribute type="xs:boolean" name="isMultiSelection" />
 
<xs:attribute type="xs:boolean" name="isMultiSelection" />
 
</xs:complexType>
 
</xs:complexType>
 
</xs:element>
 
</xs:element>
<xs:element name="validator">
+
<xs:element name="validator" minOccurs="0" maxOccurs="1">
 
<xs:complexType>
 
<xs:complexType>
 
<xs:sequence>
 
<xs:sequence>
Line 211: Line 312:
 
</xs:complexType>
 
</xs:complexType>
 
</xs:element>
 
</xs:element>
<xs:element name="tagging" type="TaggingType">
+
<xs:element name="tagging" type="TaggingType"
 +
minOccurs="0" maxOccurs="1">
 
</xs:element>
 
</xs:element>
<xs:element name="grouping" type="GroupingType">
+
<xs:element name="grouping" type="GroupingType"
 +
minOccurs="0" maxOccurs="1">
 
</xs:element>
 
</xs:element>
 
</xs:sequence>
 
</xs:sequence>
<xs:attribute name="cateogoryref" use="optional"
+
<xs:attribute name="categoryref" use="optional" type="xs:string" />
type="xs:IDREF" />
+
 
</xs:complexType>
 
</xs:complexType>
 
</xs:element>
 
</xs:element>
 
</xs:sequence>
 
</xs:sequence>
<xs:attribute type="NotNull" use="required" name="type" />
+
<xs:attribute type="NotEmpty" use="required" name="type" />
 
</xs:complexType>
 
</xs:complexType>
 
</xs:element>
 
</xs:element>
 
<xs:simpleType name="TaggingGroupingValue">
 
<xs:simpleType name="TaggingGroupingValue">
<xs:list>
+
<xs:restriction base="xs:string">
<xs:simpleType>
+
<xs:enumeration value="onFieldName" />
<xs:restriction base="xs:string">
+
<xs:enumeration value="onValue" />
<xs:enumeration value="onFieldName" />
+
<xs:enumeration value="onFieldName_onValue" />
<xs:enumeration value="onValue" />
+
<xs:enumeration value="onValue_onFieldName" />
</xs:restriction>
+
</xs:restriction>
</xs:simpleType>
+
</xs:list>
+
 
</xs:simpleType>
 
</xs:simpleType>
 
<xs:complexType name="TaggingType">
 
<xs:complexType name="TaggingType">
Line 238: Line 338:
 
<xs:extension base="TaggingGroupingValue">
 
<xs:extension base="TaggingGroupingValue">
 
<xs:attribute type="xs:boolean" name="create" />
 
<xs:attribute type="xs:boolean" name="create" />
<xs:attribute type="NotNull" name="separator" />
+
<xs:attribute type="NotEmpty" name="separator" />
 
</xs:extension>
 
</xs:extension>
 
</xs:simpleContent>
 
</xs:simpleContent>
Line 246: Line 346:
 
<xs:extension base="TaggingGroupingValue">
 
<xs:extension base="TaggingGroupingValue">
 
<xs:attribute type="xs:boolean" name="create" />
 
<xs:attribute type="xs:boolean" name="create" />
 +
<xs:attribute type="xs:boolean" name="propagateUp" />
 
</xs:extension>
 
</xs:extension>
 
</xs:simpleContent>
 
</xs:simpleContent>
 
</xs:complexType>
 
</xs:complexType>
<xs:simpleType name="NotNull">
+
<xs:simpleType name="NotEmpty">
 
<xs:restriction base="xs:string">
 
<xs:restriction base="xs:string">
 
<xs:minLength value="1" />
 
<xs:minLength value="1" />
Line 257: Line 358:
 
</pre>
 
</pre>
  
Instance of a valid Metadata Profile .xml:
+
You can download it by clicking on [https://wiki.gcube-system.org/images_gcube/e/e8/Gcdcmetadataprofilev3.xsd Gcdcmetadataprofilev3.xsd]
 +
 
 +
A "generic" example of MetadataProfile.xml:  
  
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<metadataformat type="metadata_type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="gcdcmetadataprofile.xsd">
+
<metadataformat type="the_metadata_type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="gcdcmetadataprofilev3.xsd">
  <metadatacategory id="idvalue0">
+
   <metadatafield categoryref="idvalue0">
    <title>title</title>
+
    <description>description</description>
+
  </metadatacategory>
+
   <metadatafield cateogoryref="idvalue0">
+
 
     <fieldName>fieldName</fieldName>
 
     <fieldName>fieldName</fieldName>
 
     <dataType>String</dataType>
 
     <dataType>String</dataType>
Line 277: Line 376:
 
       <regularExpression>regularExpression</regularExpression>
 
       <regularExpression>regularExpression</regularExpression>
 
     </validator>
 
     </validator>
     <tagging create="true" separator=";">onFieldName onValue</tagging>
+
     <tagging create="true" separator="-">onFieldName_onValue</tagging>
 
     <grouping create="true">onFieldName</grouping>
 
     <grouping create="true">onFieldName</grouping>
 
   </metadatafield>
 
   </metadatafield>
Line 283: Line 382:
 
</pre>
 
</pre>
  
===== Metadata Profile v.2 =====
+
Another example (of MetadataProfile.xml ) is the following one:
 
+
Relased in gCube 4.1. What's new:
+
 
+
* Added datatype field (<datatype>). A valid datatype must be equal to one of the values {String, Time, Time_Interval, Times_ListOf, Text, Boolean, Number}. When data type is not specified the metadata field has default value as "String". DataType values:
+
** String: is a string;
+
** Time: an instant time that follows the general format: YYYY-MM-DD [HH:MM] where: YYYY: 4-digit year, MM: 2-digit month, DD: 2-digit day, [optional HH: 2-digit hour], [optional MM: 2-digit minute] (e.g. "2005-03-01");
+
** Time_Interval: a continuous interval instead of a single instant by specifying a start and end time, separated by one '/' ('slash') character (e.g. "2005-03-01/2006-05-11");
+
** Times_ListOf: a list of discrete time values, separated by a ',' ('comma') character (e.g. "2005-03-01, 2006-05-11, 2006-05-11-2007-04-12");
+
** Text: is a text;
+
** Boolean: is True/False;
+
** Number: is a valid Java number, see: Apache Commons NumberUtils.isNumber.
+
 
+
* Added multi selection attribute ('isMultiSelection=true|false') to vocabulary.
+
Values of Time, Time_Interval and Times_ListOf are based on [https://en.wikipedia.org/wiki/ISO_8601 ISO 8601]
+
  
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<metadataformat>
+
<metadataformat type="the_metadata_type"
<metadatafield>
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 +
xsi:noNamespaceSchemaLocation="gcdcmetadataprofilev3.xsd">
 +
<metadatafield categoryref="contact">
 
<fieldName>Name</fieldName>
 
<fieldName>Name</fieldName>
<mandatory>true</mandatory>
+
<dataType>String</dataType>
<dataType>String|Time|Time_Interval|Times_ListOf|Text|Boolean|Number</dataType>
+
<defaultValue>My Name</defaultValue>
<defaultValue>default value</defaultValue>
+
<note>Insert your Name</note>
<note>shown as suggestions in the insert/update metadata form of CKAN
+
<tagging create="true" separator="-">onFieldName_onValue</tagging>
</note>
+
</metadatafield>
<vocabulary isMultiSelection="true|false">
+
<metadatafield categoryref="contact">
<vocabularyField>field1</vocabularyField>
+
<fieldName>Surname</fieldName>
<vocabularyField>field2</vocabularyField>
+
<dataType>String</dataType>
<vocabularyField>field3</vocabularyField>
+
<defaultValue>My Surname</defaultValue>
</vocabulary>
+
<note>Insert your Surname</note>
<validator>
+
<regularExpression>a regular expression for validating values
+
</regularExpression>
+
</validator>
+
 
</metadatafield>
 
</metadatafield>
 
</metadataformat>
 
</metadataformat>
 
</pre>
 
</pre>
  
It's possible to validate a Metadata Format schema using following DTD v2
+
====== Namespaces Categories schema: NamespacesCatalogueCategories.xsd ======
 +
 
 +
The Namespaces Catalogue Categories schema:
  
 
<pre>
 
<pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT metadataformat (metadatafield+)>
+
<xs:schema attributeFormDefault="unqualified"
<!ELEMENT metadatafield (fieldName, mandatory, datatype?, defaultValue?, note?, vocabulary?, validator?)>
+
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
<!ELEMENT fieldName (#PCDATA)>
+
xmlns:category="http://www.w3.org/TR/html4/">
<!ELEMENT mandatory (#PCDATA)>
+
<xs:element name="namespaces">
<!ELEMENT dataType (#PCDATA)>
+
<xs:complexType>
<!ELEMENT defaultValue (#PCDATA)>  
+
<xs:sequence>
<!ELEMENT note (#PCDATA)>  
+
<xs:element name="namespace" minOccurs="1" maxOccurs="unbounded">
<!ELEMENT vocabulary (vocabularyField+)>  
+
<xs:complexType>
<!ATTLIST vocabulary isMultiSelection (true|false) "false">
+
<xs:sequence>
<!ELEMENT vocabularyField (#PCDATA)>  
+
<xs:element type="xs:string" name="name" minOccurs="1"
<!ELEMENT validator (regularExpression)>
+
maxOccurs="1" />
<!ELEMENT regularExpression (#PCDATA)>
+
<xs:element type="xs:string" name="title" minOccurs="1"
 
+
maxOccurs="1" />
<!--
+
<xs:element type="xs:string" name="description"
Where datatype element is the enum: {String, Time, Time_Interval, Times_ListOf, Text, Boolean, Number}
+
minOccurs="0" maxOccurs="1" />
Its xml schema:
+
</xs:sequence>
<xs:element name="dataType">
+
<xs:attribute type="xs:string" name="id" use="required" />
  <xs:simpleType>
+
</xs:complexType>
    <xs:restriction base="xs:string">
+
</xs:element>
      <xs:enumeration value="String"/>
+
</xs:sequence>
      <xs:enumeration value="Time"/>
+
</xs:complexType>
      <xs:enumeration value="Time_Interval"/>
+
<xs:unique name="unique-namespace-id">
      <xs:enumeration value="Times_ListOf"/>
+
<xs:selector xpath="namespace" />
      <xs:enumeration value="Text"/>
+
<xs:field xpath="@id" />
      <xs:enumeration value="Boolean"/>
+
</xs:unique>
      <xs:enumeration value="Number"/>
+
</xs:element>
    </xs:restriction>
+
</xs:schema>
  </xs:simpleType>
+
</xs:element>
+
-->
+
 
</pre>
 
</pre>
  
===== Metadata Profile v.1 =====
+
You can download it by clicking on [https://wiki.gcube-system.org/images_gcube/d/d5/NamespacesCatalogueCategories.xsd NamespacesCatalogueCategories]
  
Relased in gCube 4.0. The schema is:
+
An example of valid Namespaces.xml:
 
+
<pre>
+
<?xml version="1.0" encoding="UTF-8">
+
<metadataformat>
+
    <metadatafield>
+
        <fieldName>Name</fieldName>
+
        <mandatory>true</mandatory>
+
        <isBoolean>false</isBoolean>
+
        <defaultValue>default value</defaultValue>
+
        <note>shown as suggestions in the insert/update metadata form of CKAN</note>
+
        <vocabulary>
+
            <vocabularyField>field1</vocabularyField>
+
            <vocabularyField>field2</vocabularyField>
+
            <!-- ... others vocabulary fields -->
+
        </vocabulary>
+
        <validator>
+
            <regularExpression>a regular expression for validating values</regularExpression>
+
        </validator>
+
    </metadatafield>
+
    <!-- ... others metadata fields -->
+
</metadataformat>
+
</pre>
+
  
It's possible to validate a Metadata Format schema using following DTD v1
 
 
<pre>
 
<pre>
 
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT metadataformat (metadatafield+)>
+
<namespaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<!ELEMENT metadatafield (fieldName, mandatory, isBoolean?, defaultValue?, note?, vocabulary?, validator?)>
+
xsi:noNamespaceSchemaLocation="NamespacesCatalogueCategories.xsd">
<!ELEMENT fieldName (#PCDATA)>
+
<namespace id="contact">
<!ELEMENT mandatory (#PCDATA)>
+
<name>Contact</name>
<!ELEMENT isBoolean (#PCDATA)>  <!-- MUST BE (true|false) -->
+
<title>Contact Title</title>
<!ELEMENT defaultValue (#PCDATA)>  
+
<description>This section is about Contact(s)</description>
<!ELEMENT note (#PCDATA)>  
+
</namespace>
<!ELEMENT vocabulary (vocabularyField+)>  
+
<namespace id="developer_information">
<!ELEMENT vocabularyField (#PCDATA)>
+
<name>Developer</name>
<!ELEMENT validator (regularExpression)>  
+
<title>Developer Title</title>
<!ELEMENT regularExpression (#PCDATA)>
+
<description>This section is about Developer(s)</description>
 
+
</namespace>
</pre>
+
<namespace id="extra_information">
 
+
<name>Extra</name>
A possible instance of Metadata Field (<metadatafield>):
+
<title>Extra Title</title>
 
+
<description>This section is about Extra(s)</description>
<pre>
+
</namespace>
<metadatafield>
+
</namespaces>
  <fieldName>Accessibility</fieldName>
+
  <mandatory>true</mandatory>
+
  <defaultValue>virtual/public</defaultValue>
+
  <vocabulary>
+
      <vocabularyField>virtual/public</vocabularyField>
+
      <vocabularyField>virtual/private</vocabularyField>
+
      <vocabularyField>transactional</vocabularyField>
+
  </vocabulary>
+
</metadatafield>
+
 
</pre>
 
</pre>
  
Line 427: Line 476:
 
== Ckan Connector ==
 
== Ckan Connector ==
  
TODO @Lucio
+
The Ckan Connector Service is a gCube RESTFul service that allows infrastructure users to interact with CKAN.
 +
 
 +
It implements two methods:
 +
* /connect: creates a new CKAN session. The user can interact with CKAN while the session is alive (not expired or destroyed by the user).
 +
* /disconnect : destroys the current CKAN session.
  
 
== Geo Harvesting ==
 
== Geo Harvesting ==
Line 434: Line 487:
  
 
Several harvesters to import geospatial metadata (like ISO 19139 format) into CKAN from other sources have been created in gCube Data Catalogue.
 
Several harvesters to import geospatial metadata (like ISO 19139 format) into CKAN from other sources have been created in gCube Data Catalogue.
In particular all metadata created into gCube Geonetwork (GeoNetwork is the catalog application to manage spatially referenced resources generated into D4Science Infrastructure) are harvested through the 'Geonetwork Resolver' a "middle tier" able to:
+
In particular all metadata created into gCube Geonetwork (GeoNetwork is the catalog application to manage spatially referenced resources generated into D4Science Infrastructure) are harvested through the '''Geonetwork Resolver'''.
 
+
* use the Geonetwork Manager in order to harvest private metadata (via authentication) stored in gCube Geonetwork on CKAN Data Catalogue (e.g. http://data-d.d4science.org/geonetwork/gcube|devsec|devVRE to harvest private metadata generated from scope /gcube/devsec/devVRE);
+
 
+
* create a CKAN Harvester that skip all public metadata via configuration during scope harvesting (e.g. http://data-d.d4science.org/geonetwork/gcube|devsec|devVRE%23filterpublicids to filter public ids during harvesting of /gcube/devsec/devVRE);
+
 
+
* create a CKAN Harvester to harvest only public metadata (saved on Geonetwork) avoiding the Geonetwork authentication via configuration (e.g. http://data-d.d4science.org/geonetwork/gcube|devsec|devVRE%23noauthentication).
+
  
 
Mapping (among fields) from an ISO19139 Metadata to Ckan Dataset via ckanext-geonetwork is shown in the following table:
 
Mapping (among fields) from an ISO19139 Metadata to Ckan Dataset via ckanext-geonetwork is shown in the following table:
Line 487: Line 534:
 
| Description
 
| Description
 
|}
 
|}
 +
 +
=== Geonetwork harvester for CKAN  ===
 +
 +
Geonetwork harvester for CKAN based on [https://github.com/geosolutions-it/ckanext-geonetwork ckanext-geonetwork] plugin has been enhanced to implement the D4Science and their communities needs.
 +
 +
The base configuration options to control the CKAN harvesters behaviour are available at [https://github.com/ckan/ckanext-harvest#the-ckan-harvester the-ckan-harvester]
 +
 +
Moreover, the following configuration options have been added to support specific D4Science requirements.
 +
 +
'''Add the "ITEM URL" field by default to harvested items''':
 +
 +
TODO
 +
 +
=== Geonetwork Resolver ===
 +
 +
The 'Geonetwork Resolver' is a "middle tier" that authorizing the CKAN's harvesters to CSW harvesting of ISO19139 items provided through the gCube Geonetworks.
 +
 +
See more at https://wiki.gcube-system.org/gcube/URI_Resolver#Geonetwork_Resolver
  
 
== Geo Datasets ==
 
== Geo Datasets ==
  
In order to make a dataset queryable by location (geospatial dataset), a special extra must be defined, with its key named ‘spatial’. The value must be a valid GeoJSON geometry, for example:
+
In order to make a dataset queryable by Location (geospatial dataset), a reserved extra with the field name (the key) named ‘spatial’ must be defined. The value must be a '''valid GeoJSON geometry''', for example:
  
 
<pre>
 
<pre>
Line 529: Line 594:
 
</pre>
 
</pre>
  
Otherwise default bounding box is 4326. CKAN Wiki page for [http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html#legacy-api Legacy API]
+
Otherwise, the default bounding box is 4326. CKAN Wiki page for [http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html#legacy-api Legacy API]
  
 
Moreover, you can perform spatial queries using an integrated map widget available on CKAN, which allows filtering results by an area of interest. You can try it on [https://ckan-d4s.d4science.org/dataset D4Science Data Catalogue]
 
Moreover, you can perform spatial queries using an integrated map widget available on CKAN, which allows filtering results by an area of interest. You can try it on [https://ckan-d4s.d4science.org/dataset D4Science Data Catalogue]
  
 
CKAN Wiki page for [http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html#spatial-search-widget Spatial Search Widget ]
 
CKAN Wiki page for [http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html#spatial-search-widget Spatial Search Widget ]
 +
 +
== Temporal Datasets ==
 +
 +
In order to make a dataset queryable by Time (temporal dataset), a reserved extra with the field name (the key) named ‘time_date’ must be defined. The value must be a valid '''ISO 18161 date'''.
  
 
== Users, Roles and Groups ==
 
== Users, Roles and Groups ==
Line 552: Line 621:
 
** Edit or delete any of the organization’s datasets;
 
** Edit or delete any of the organization’s datasets;
 
** Make datasets public or private.
 
** Make datasets public or private.
 +
 +
* '''''Catalogue_Manager''''' - users with this role are allowed to:
 +
** View the organization’s private datasets;
 +
** Publish new datasets (into the organization);
 +
** Edit or delete any of the organization’s datasets;
 +
** Make datasets public or private;
 +
** Configure the catalogue.
 
    
 
    
 
The default role assigned to every VRE user is ''Catalogue_Member'', i.e. every user of a VRE is entitled to view the private datasets published in the VRE scope in addition to any public dataset. VRE Managers can assign other roles to selected users to enlarge their capabilities.
 
The default role assigned to every VRE user is ''Catalogue_Member'', i.e. every user of a VRE is entitled to view the private datasets published in the VRE scope in addition to any public dataset. VRE Managers can assign other roles to selected users to enlarge their capabilities.
Line 557: Line 633:
 
'''CKAN Groups''' can used to create and manage collections of datasets. This could be to catalogue datasets for a particular project or team, or on a particular theme, or as a very simple way to help people find and search your own published datasets.
 
'''CKAN Groups''' can used to create and manage collections of datasets. This could be to catalogue datasets for a particular project or team, or on a particular theme, or as a very simple way to help people find and search your own published datasets.
  
== D4Science CKAN plugin ==
+
== Dataset Update ==
  
@TODO Francesco
+
As above presented only '''Catalogue_Editor''' (Editor) and '''Catalogue_Admin''' (Admin) can update existing dataset. The update can be performed by them via REST API (see: https://wiki.gcube-system.org/gcube/Catalogue_restful_service)
  
 +
However, it is possible to edit a dataset also through the CKAN GUI (via Manage), but in this case If Editor or Admin need to edit records by adding/updating resources to them, they need to:
  
=== Release procedure to D4Science CKAN plugin ===
+
*1. store the file on the workspace;
 +
*2. get a public link to the that file;
 +
*3. edit the record by adding that link.
  
 +
== Access the Catalogue via RESTful service ==
  
@TODO Francesco
+
You can find more details at [[gCat Service | gCat Service]] page.
 +
 
 +
== Complex Query to Catalogue via gCube Catalogue Portlet ==
 +
 
 +
You can use two parameters `path` and `query` to perform complex query via HTTP provided by CKAN-engine also via ''gCube Catalogue Portlet''.
 +
 
 +
You need to use:
 +
 
 +
* the ''path'' parameter to specify the location which is a route/page rendered by CKAN-engine (e.g. dataset, organization, group);
 +
 
 +
* the ''query'' parameter to specify the query string (e.g. q=sarda). Its value must be encoded in BASE64.
 +
 
 +
For example:
 +
 
 +
* if someone is willing to refer to the catalogue items belonging to a catalogue group, he/she should specify path=/group/<<groupName>>
 +
 
 +
* if someone is willing to refer to all the catalogue items matching a given query, he/she should specify path=dataset and query=<<base64 query>>
 +
 
 +
Below a complete example.
 +
 
 +
Let's assume
 +
 
 +
* the CKAN instance is https://ckan-grsf.d4science.org
 +
* the 'gCube Catalogue Portlet' is in action at https://i-marine.d4science.org/web/grsf/data-catalogue
 +
 
 +
We want to perform the query https://ckan-grsf.d4science.org/dataset?q=sarda via ''gCube Catalogue Portlet''
 +
 
 +
* The ''path'' parameter must be: path=dataset
 +
* The ''query'' parameter must be: query=BASE64(q=sarda), that is query=cT1zYXJkYQ==
 +
 
 +
Thus the URL to perform the query via 'gCube Catalogue Portlet' will be:  https://i-marine.d4science.org/web/grsf/data-catalogue?path=dataset&query=cT1zYXJkYQ==
 +
 
 +
== Widget to show Catalogue Statistics: Catalogue Badge ==
 +
 
 +
You can find how to configure the ''Catalogue Badge'' Widget for a D4Scince infra-gateway at [https://wiki.gcube-system.org/gcube/ServiceManager_Guide#Catalogue_Badge Catalogue_Badge Service Manager] page.
  
 
== Related Issues ==
 
== Related Issues ==
  
 
[1] gCube Data Catalogue for Global Record of Stocks and Fisheries - https://wiki.gcube-system.org/gcube/GCube_Data_Catalogue_for_GRSF
 
[1] gCube Data Catalogue for Global Record of Stocks and Fisheries - https://wiki.gcube-system.org/gcube/GCube_Data_Catalogue_for_GRSF
 +
 +
[2] Data Catalogue Resolver - https://wiki.gcube-system.org/gcube/URI_Resolver#CATALOGUE_Resolver
 +
 +
[4] How-to Purge a Catalogue Instance - https://wiki.gcube-system.org/gcube/How-to_purge_a_ckan_catalogue_instance

Latest revision as of 14:55, 9 March 2023

A catalogue is a service supporting its users to publish and search collections of descriptive information (metadata) for items including data, services, and related information objects.

D4Science offers services for seamless access and analysis to a wide spectrum of data including biological and ecological data, geospatial data, statistical data and semi-structured data from multiple authoritative data providers and information systems. These services can be exploited both via web based graphical user interfaces and web based protocols for programmatic access, e.g. OAI-PMH, CSW, WFS, SDMX. This offering nicely complements specific and community-specific applications. The gCube Data Catalogue catalogue contains a wealth of resources resulting from several activities, projects and communities including BlueBRIDGE (www.bluebridge-vres.eu/), i-Marine (www.i-marine.eu), SoBigData.eu (www.sobigdata.eu), and FAO (www.fao.org). All the products are accompanied with rich descriptions capturing general attributes, e.g. title and creator(s), as well as usage policies and licences.

The gCube Data Catalogue is built using and extending CKAN platform. CKAN is a powerful DMS (data management system) that makes data accessible – by providing tools to streamline publishing, sharing, finding and using data. CKAN is an open-source DMS for powering data hubs and data portals. CKAN makes it easy to publish, share and use data see: http://ckan.org/

CKAN model is made by the following entities (and their relations):

CKAN: 'Entities and Relations'

Available Catalogues and their public locations

BLUEBRIDGE Catalogue

D4Science Catalogue

Metadata

A Metadata in the gCube Data Catalogue is made by two parts: CKAN's default metadata fields and gCube Metadata Profile.

CKAN's default metadata fields

Those are metadata fields common for all metadata types in the gCube Data Catalogue (and used by default in the CKAN platform).

Label Field Name (API) Definition Guidelines Example
Title* title Name given to the dataset. Short phrase, written in plain language. Should be sufficiently descriptive to allow for search and discovery. Aquaculture Production and Consumption in Africa (2011)
Description description Short description explaining the content and its origins. Description of a few sentences, written in plain language. Should,provide a sufficiently comprehensive overview of the resource for anyone,to understand its content, origins, and any continuing work on it. The,description can be written at the end, since it summarizes key,information from the other metadata fields. This dataset contains attributes of aquaculture production and,consumption for each of Africa’s provinces in 2011. The data was,provided by………
Tags tags An array of Taxonomic terms stored as tags Taxonomic terms Access to education, Bamboo
License* lincese_title the license that applies to published dataset.
Organization* organization Organization the datasets belongs to See list of organizations on

https://ckan-d-d4s.d4science.org/organization

D4Science
Version version Version of dataset Increase manually after editing 1.0
Author* Owner of dataset The person who created the dataset in the format: Surname, Name Bloggs, Joe
Author Contact Contact details of owner The email or other contact details of the person who created the dataset. joe@example.com
Mantainer Mantainer of the dataset The person or the authority that maintains the dataset A person: Bloggs, Joe. An authority: D4Science
Mantainer

Contact

Contact details of mantainer The email or other contact details of the person who maintains the dataset. joe@example.com

mandatory fields are marked with an asterisk (*)

gCube Metadata Profile

gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.

A gCube Metadata Profile is composed by one Metadata Format (<metadataformat>) containing an ordered list of (at least one) Metadata Field (<metadatafield>). From version 3 a Metadata Field can contain also a reference (categoryref="category_id_#") to an entity "Category" using the Namespace of the Category (<namespace id="category_id_#">). Add a Category Reference to a Metadata Field means that the "field" belongs to the Category referred by Category Identifier (id="category_id_#). See Metadata Profile v.3. for more details.

Metadata Profile v.4

Metadata Profile v.4 is a XML file having the format:

<?xml version="1.0" encoding="UTF-8"?>
<metadataformat type="YOUR TYPE HERE">
    <metadatafield categoryref="category_id_#">
        <fieldId>ID of Metadata Field that identifies the field name in the Document (stored in the Service)</fieldId>
        <fieldName>Name of Metadata Field</fieldName>
        <mandatory>true|false</mandatory>
        <dataType>String|Time|Time_Interval|Times_ListOf|Text|Boolean|Number|GeoJSON</dataType>
        <maxOccurs>N|*</maxOccurs>
        <defaultValue>default value</defaultValue>
        <note>[the note is shown as a suggestion in the insert/update metadata form of Catalogue Publisher Widget]
		</note>
        <vocabulary isMultiSelection="true|false">
            <vocabularyField>field1</vocabularyField>
            <vocabularyField>field2</vocabularyField>
            <vocabularyField>field3</vocabularyField>
        </vocabulary>
        <validator>
            <regularExpression>a regular expression for validating values</regularExpression>
        </validator>
        <tagging create="true|false" separator="char_to_separate">onFieldName|onValue|onFieldName_onValue|onValue_onFieldName</tagging> 
        <grouping create="true|false">onFieldName|onValue|onFieldName_onValue|onValue_onFieldName</grouping>
    </metadatafield>
</metadataformat>


The <fieldId> is optional. It declares (if present in the profile) the value that will be used to specify the field name in the Document (e.g. JSON Document) passed to Service that will store the resulting Document. If the <fieldId> is absent in the profile, the value of the <fieldName> (which is mandatory) will be used as field name in the Document.

The <fieldName> field contains the name of the metadata field.

The <mandatory> field declares if the <metadatafield> is a field mandatory (by using 'true') or not (by using 'false').

DataType values:

The <dataType> field specifies the kind of data. A valid dataType must be equal to one of the values {String, Time, Time_Interval, Times_ListOf, Text, Boolean, Number, GeoJSON}. When the data type is not specified the metadata field has the default value "String". Temporal type: can be specified by using the value Time or Time_Interval or Times_ListOf (based on ISO 8601). Spatial type: can be specified by using the value GeoJSON.

In detail:

  • String: is a string;
  • Time: an instant time that follows the general format: YYYY-MM-DD [HH:MM] where: YYYY: 4-digit year, MM: 2-digit month, DD: 2-digit day, [optional HH: 2-digit hour], [optional MM: 2-digit minute] (e.g. "2005-03-01");
  • Time_Interval: a continuous interval instead of a single instant by specifying a start and end time, separated by one '/' ('slash') character (e.g. "2005-03-01/2006-05-11");
  • Times_ListOf: a list of discrete time values, separated by a ',' ('comma') character (e.g. "2005-03-01, 2006-05-11, 2006-05-11-2007-04-12");
  • Text: is a text;
  • Boolean: is True/False;
  • Number: is a valid Java number, see: Apache Commons NumberUtils.isNumber;
  • GeoJSON: is a string in the JSON format of kind GeoJSON (in particular it should contain a GeoJSON geometry). The GeoJSON is a format for encoding a variety of geographic data structures.
GeoSpatial Data (the spatial field):
In order to make a metadata a GeoSpatial Data and searchable by location via GeoSpatial Search Widget (see at #GeoSpatial_search_for_datasets:_via_API_or_Search_Widget), it must have a 'fieldName' named `spatial` with 'dataType' GeoJSON and a valid GeoJSON geometry as value.
E.g. A MedataField with GeoSpatial data:
    <metadatafield idref="category_id_#">
        <fieldName>spatial</fieldName>  <!--'spatial' is the reserved field name to assign a GeoSpatial dimension to metadata  -->
        <dataType>GeoJSON</dataType>
        <defaultValue>{"type": "Point","coordinates": [-20.145,74.078]}</defaultValue>
        <note>Please, insert a valid GeoJSON</note>
    </metadatafield>
see more details about #Geo_Datasets
Temporal Data (the time_date field):
In order to make a metadata a Temporal Data and searchable by time via Time Search Widget, it must have a 'fieldName' named `time_date` with 'dataType' Time and a valid ISO 8601 date as value.
E.g. A MedataField with Temporal data:
    <metadatafield idref="category_id_#">
        <fieldName>time_date</fieldName>  <!--'time_date' is the reserved field name to assign a Temporal dimension to metadata -->
        <dataType>Time</dataType>
        <defaultValue>2019-7-29</defaultValue>
        <note>Please, insert a valid ISO 8601 date</note>
    </metadatafield>
see more details about #Temporal_Datasets

maxOccurs Indicator:

The <maxOccurs> indicator specifies the maximum number of times that <metadatafield> can occur:

  • N (as number): if the field must appear N times;
  • * (as char asterisk): if the field can appear an unlimited number of times.

Categories as "Namespaces":

  • the Namespace of a Category declares a "class" for metadata fields having particular characteristics. It has been introduced in order to group metadata fields for categories and displaying them in a dedicated area through advanced GUI provided by CKAN D4Science plugin.

Namespaces (for Categories) are defined in an XML file made by one Namespaces element (<namespaces>) containing a list of (at least) one or many Namespace (<namespace>). The file has the format:

<?xml version="1.0" encoding="UTF-8"?>
<namespaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<namespace id="category_id_#">
		<name>Category Name</name>
		<title>Category Title</title>
		<description>This section is about Category description</description>
	</namespace>
</namespaces>

A Namespace element (<namespace>) has an attribute (id) and three entities. The attribute "id" must be unique in the file #Namespaces_Categories_schema:_NamespacesCatalogueCategories.xsd, it represents the category identifier for the Category. The elements are: name (is mandatory), title (is mandatory), description (is optional).

Metadata Field and Category Reference (categoryref="category_id_#"):

  • categoryref is an optional attribute. It is a unique id (id="category_id_#"). A metadata field can belong to only one Namespace of a Category referring it via idref (categoryref="id category to which metadata field belongs one").

Type of (meta)data (is Mandatory):

  • type: a Metadata Format (metadataformat) must have a unique 'type' (as a xml attribute) that declares a "type" for it. This mandatory information is saved as custom key (system:type="value of type") of the item stored in the Data Catalogue.

Tagging:

  • It is used by gCube Data Catalogue front-end for adding a metadata field as a Tag of the metadata. A Tag is a string between 2 and 100 characters long containing only alphanumeric characters and '-' (hyphen), '_' (underscore), . (dot). Tagging element in the Metadata Profile schema v3 must have a value equal to one of the values: {onFieldName, onValue, onFieldName_onValue, onValue_onFieldName}. Tagging values meanings:
    • onFieldName: (only) the fieldName specified to metadata field must be added as a Tag;
    • onValue: (only) the value specified to metadata field must be added as a Tag;
    • onFieldName_onValue: both the fieldName and the value (in this order) specified to metadata field must be added as a Tag. They are separated by string used as separator (<tagging create="true|false" separator="char_to_separate">{onFieldName_onValue}</tagging>);
    • onValue_onFieldName: both the value and the fieldName (in this order) specified to metadata field must be added as a Tag. They are separated by string used as separator (<tagging create="true|false" separator="char_to_separate">{onValue_onFieldName}</tagging>).
  • Moreover, Tagging has two (optional) attribute: 'create' and 'separator'. The first one (create="true"|"false") is used to mean: create the Tag if does not exist, no otherwise. The second one (separator="char_to_separate") is the string that will be used to separate the FieldName from its value. Default value for separator is the character '-' if it is not specified.

Tagging example: using following instance of metadata field

	<metadatafield categoryref="contact">
		<fieldName>Name</fieldName>
		<dataType>String</dataType>
		<defaultValue>My Name</defaultValue>
		<note>Insert your Name</note>
		<tagging create="true" separator="-">onFieldName_onValue</tagging>
	</metadatafield>

where My Name is "Francesco", gCube Data Catalogue adds the tag Name-Francesco to metadata field if it does not exist

Grouping:

  • It is used by Data Catalogue fron-end for adding a metadata field to a Group of Data Catalogue. Data Catalogue groups are used for browsing. Grouping element in the Metadata Profile schema v3 must have a value equal to one of the values: {onFieldName, onValue, onFieldName_onValue, onValue_onFieldName}. The (optional) attribute create="true" is used to mean: create the Group if does not exist, no otherwise. Grouping values meanings:
    • onFieldName: (only) the fieldName specified to metadata field must be added to a Group;
    • onValue: (only) the value specified to metadata field must be added to a Group;
    • onFieldName_onValue: both the fieldName and the value (in this order) specified to metadata field must be added to a Group (<grouping create="true|false">{onFieldName_onValue}</grouping>);
    • onValue_onFieldName: both the value and the fieldName (in this order) specified to metadata field must be added to a Group (<grouping create="true|false">{onValue_onFieldName}</grouping>).
  • Moreover, Grouping has one (optional) attribute: 'propagateUp' This property will let a user specify if an item, that is going to be added to that group, must be also added to the hierarchical chain of groups involving it. For instance, if we have group B as child of group A, and item I is going to be added to B, then it will also be added to A.
Metadata Profile schema: gcdcmetadataprofilev3.xsd

The gCube Data Catalogue Metadata Profile (v.3) schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
	elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:include schemaLocation="NamespacesCatalogueCategories.xsd"/>
	<xs:element name="metadataformat">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="metadatafield" minOccurs="0" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element type="xs:string" name="fieldName" />
							<xs:element type="xs:boolean" name="mandatory"
								minOccurs="0" maxOccurs="1" />
							<xs:element name="dataType">
								<xs:simpleType>
									<xs:restriction base="xs:string">
										<xs:enumeration value="String" />
										<xs:enumeration value="Time" />
										<xs:enumeration value="Time_Interval" />
										<xs:enumeration value="Times_ListOf" />
										<xs:enumeration value="Text" />
										<xs:enumeration value="Boolean" />
										<xs:enumeration value="Number" />
										<xs:enumeration value="GeoJSON" />
									</xs:restriction>
								</xs:simpleType>
							</xs:element>
							<xs:element type="xs:string" name="maxOccurs"
								minOccurs="0" maxOccurs="1" />
							<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 name="validator" minOccurs="0" maxOccurs="1">
								<xs:complexType>
									<xs:sequence>
										<xs:element type="xs:string" name="regularExpression" />
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="tagging" type="TaggingType"
								minOccurs="0" maxOccurs="1">
							</xs:element>
							<xs:element name="grouping" type="GroupingType"
								minOccurs="0" maxOccurs="1">
							</xs:element>
						</xs:sequence>
						<xs:attribute name="categoryref" use="optional" type="xs:string" />
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute type="NotEmpty" use="required" name="type" />
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="TaggingGroupingValue">
		<xs:restriction base="xs:string">
			<xs:enumeration value="onFieldName" />
			<xs:enumeration value="onValue" />
			<xs:enumeration value="onFieldName_onValue" />
			<xs:enumeration value="onValue_onFieldName" />
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="TaggingType">
		<xs:simpleContent>
			<xs:extension base="TaggingGroupingValue">
				<xs:attribute type="xs:boolean" name="create" />
				<xs:attribute type="NotEmpty" name="separator" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="GroupingType">
		<xs:simpleContent id="TaggingGroupingValue">
			<xs:extension base="TaggingGroupingValue">
				<xs:attribute type="xs:boolean" name="create" />
				<xs:attribute type="xs:boolean" name="propagateUp" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:simpleType name="NotEmpty">
		<xs:restriction base="xs:string">
			<xs:minLength value="1" />
		</xs:restriction>
	</xs:simpleType>
</xs:schema>

You can download it by clicking on Gcdcmetadataprofilev3.xsd

A "generic" example of MetadataProfile.xml:

<?xml version="1.0" encoding="UTF-8"?>
<metadataformat type="the_metadata_type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="gcdcmetadataprofilev3.xsd">
  <metadatafield categoryref="idvalue0">
    <fieldName>fieldName</fieldName>
    <dataType>String</dataType>
    <defaultValue>defaultValue</defaultValue>
    <note>note</note>
    <vocabulary isMultiSelection="true">
      <vocabularyField>vocabularyField</vocabularyField>
    </vocabulary>
    <validator>
      <regularExpression>regularExpression</regularExpression>
    </validator>
    <tagging create="true" separator="-">onFieldName_onValue</tagging>
    <grouping create="true">onFieldName</grouping>
  </metadatafield>
</metadataformat>

Another example (of MetadataProfile.xml ) is the following one:

<?xml version="1.0" encoding="UTF-8"?>
<metadataformat type="the_metadata_type"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="gcdcmetadataprofilev3.xsd">
	<metadatafield categoryref="contact">
		<fieldName>Name</fieldName>
		<dataType>String</dataType>
		<defaultValue>My Name</defaultValue>
		<note>Insert your Name</note>
		<tagging create="true" separator="-">onFieldName_onValue</tagging>
	</metadatafield>
	<metadatafield categoryref="contact">
		<fieldName>Surname</fieldName>
		<dataType>String</dataType>
		<defaultValue>My Surname</defaultValue>
		<note>Insert your Surname</note>
	</metadatafield>
</metadataformat>
Namespaces Categories schema: NamespacesCatalogueCategories.xsd

The Namespaces Catalogue Categories schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified"
	elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:category="http://www.w3.org/TR/html4/">
	<xs:element name="namespaces">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="namespace" minOccurs="1" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element type="xs:string" name="name" minOccurs="1"
								maxOccurs="1" />
							<xs:element type="xs:string" name="title" minOccurs="1"
								maxOccurs="1" />
							<xs:element type="xs:string" name="description"
								minOccurs="0" maxOccurs="1" />
						</xs:sequence>
						<xs:attribute type="xs:string" name="id" use="required" />
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
		<xs:unique name="unique-namespace-id">
			<xs:selector xpath="namespace" />
			<xs:field xpath="@id" />
		</xs:unique>
	</xs:element>
</xs:schema>

You can download it by clicking on NamespacesCatalogueCategories

An example of valid Namespaces.xml:

<?xml version="1.0" encoding="UTF-8"?>
<namespaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="NamespacesCatalogueCategories.xsd">
	<namespace id="contact">
		<name>Contact</name>
		<title>Contact Title</title>
		<description>This section is about Contact(s)</description>
	</namespace>
	<namespace id="developer_information">
		<name>Developer</name>
		<title>Developer Title</title>
		<description>This section is about Developer(s)</description>
	</namespace>
	<namespace id="extra_information">
		<name>Extra</name>
		<title>Extra Title</title>
		<description>This section is about Extra(s)</description>
	</namespace>
</namespaces>

Instances of Metadata Profile

The following list shows the instances of metadata profile created in the D4Sciece infrastructure and currently used in gCube Data Catalogue:

SoBigData.eu

SoBigData.eu: Metadata Profile for gCube Data Catalogue

Ckan Connector

The Ckan Connector Service is a gCube RESTFul service that allows infrastructure users to interact with CKAN.

It implements two methods:

  • /connect: creates a new CKAN session. The user can interact with CKAN while the session is alive (not expired or destroyed by the user).
  • /disconnect : destroys the current CKAN session.

Geo Harvesting

This extension contains plugins like ckanext-geonetwork (and others) which add geospatial capabilities to CKAN.

Several harvesters to import geospatial metadata (like ISO 19139 format) into CKAN from other sources have been created in gCube Data Catalogue. In particular all metadata created into gCube Geonetwork (GeoNetwork is the catalog application to manage spatially referenced resources generated into D4Science Infrastructure) are harvested through the Geonetwork Resolver.

Mapping (among fields) from an ISO19139 Metadata to Ckan Dataset via ckanext-geonetwork is shown in the following table:

ISO19139 Ckan Dataset
Title Title
Description Description
bbox spatial
Descriptive Keywords
gmd:keyword Tag
Additional Info
metadata language, age,

reference system, etc.

key/value
Digital Transfer Option Data and Resource
CI_OnlineResource
gmd:url URL
gmd:name Name
gmd:description Description

Geonetwork harvester for CKAN

Geonetwork harvester for CKAN based on ckanext-geonetwork plugin has been enhanced to implement the D4Science and their communities needs.

The base configuration options to control the CKAN harvesters behaviour are available at the-ckan-harvester

Moreover, the following configuration options have been added to support specific D4Science requirements.

Add the "ITEM URL" field by default to harvested items:

TODO

Geonetwork Resolver

The 'Geonetwork Resolver' is a "middle tier" that authorizing the CKAN's harvesters to CSW harvesting of ISO19139 items provided through the gCube Geonetworks.

See more at https://wiki.gcube-system.org/gcube/URI_Resolver#Geonetwork_Resolver

Geo Datasets

In order to make a dataset queryable by Location (geospatial dataset), a reserved extra with the field name (the key) named ‘spatial’ must be defined. The value must be a valid GeoJSON geometry, for example:

{
  "type":"Polygon",
  "coordinates":[[[2.05827, 49.8625],[2.05827, 55.7447], [-6.41736, 55.7447], [-6.41736, 49.8625], [2.05827, 49.8625]]]
}

[Note: the polygon must be closed]

or

{
  "type": "Point",
  "coordinates": [-3.145,53.078]
}

GeoJSON Format Specification are available here: http://geojson.org/geojson-spec.html Datasets with spatial values are automatically geo-indexed, for example so that they can be searched using spatial filters.

GeoSpatial search for datasets: via API or Search Widget

Once your datasets are geo-indexed, you can perform spatial queries by bounding box (coordinates format is [LONG, LAT]), via the following API call:

/api/2/search/dataset/geo?bbox={minx,miny,maxx,maxy}[&crs={srid}]

If the bounding box coordinates are not in the same projection as the one defined in the database, a CRS must be provided, in one of the following forms:

    urn:ogc:def:crs:EPSG::4326
    EPSG:4326
    4326

Otherwise, the default bounding box is 4326. CKAN Wiki page for Legacy API

Moreover, you can perform spatial queries using an integrated map widget available on CKAN, which allows filtering results by an area of interest. You can try it on D4Science Data Catalogue

CKAN Wiki page for Spatial Search Widget

Temporal Datasets

In order to make a dataset queryable by Time (temporal dataset), a reserved extra with the field name (the key) named ‘time_date’ must be defined. The value must be a valid ISO 18161 date.

Users, Roles and Groups

Three roles are envisaged to capture the actions users are allowed to execute by the catalogue in the context of each VRE:

  • Catalogue_Member - users with this role are allowed to:
    • View the organization’s private datasets.
  • Catalogue_Editor - users with this role are allowed to:
    • View the organization’s private datasets;
    • Publish new datasets (into the organization);
    • Edit or delete the organization’s datasets the user is owner of.
  • Catalogue_Admin - users with this role are allowed to:
    • View the organization’s private datasets;
    • Publish new datasets (into the organization);
    • Edit or delete any of the organization’s datasets;
    • Make datasets public or private.
  • Catalogue_Manager - users with this role are allowed to:
    • View the organization’s private datasets;
    • Publish new datasets (into the organization);
    • Edit or delete any of the organization’s datasets;
    • Make datasets public or private;
    • Configure the catalogue.

The default role assigned to every VRE user is Catalogue_Member, i.e. every user of a VRE is entitled to view the private datasets published in the VRE scope in addition to any public dataset. VRE Managers can assign other roles to selected users to enlarge their capabilities.

CKAN Groups can used to create and manage collections of datasets. This could be to catalogue datasets for a particular project or team, or on a particular theme, or as a very simple way to help people find and search your own published datasets.

Dataset Update

As above presented only Catalogue_Editor (Editor) and Catalogue_Admin (Admin) can update existing dataset. The update can be performed by them via REST API (see: https://wiki.gcube-system.org/gcube/Catalogue_restful_service)

However, it is possible to edit a dataset also through the CKAN GUI (via Manage), but in this case If Editor or Admin need to edit records by adding/updating resources to them, they need to:

  • 1. store the file on the workspace;
  • 2. get a public link to the that file;
  • 3. edit the record by adding that link.

Access the Catalogue via RESTful service

You can find more details at gCat Service page.

Complex Query to Catalogue via gCube Catalogue Portlet

You can use two parameters `path` and `query` to perform complex query via HTTP provided by CKAN-engine also via gCube Catalogue Portlet.

You need to use:

  • the path parameter to specify the location which is a route/page rendered by CKAN-engine (e.g. dataset, organization, group);
  • the query parameter to specify the query string (e.g. q=sarda). Its value must be encoded in BASE64.

For example:

  • if someone is willing to refer to the catalogue items belonging to a catalogue group, he/she should specify path=/group/<<groupName>>
  • if someone is willing to refer to all the catalogue items matching a given query, he/she should specify path=dataset and query=<<base64 query>>

Below a complete example.

Let's assume

We want to perform the query https://ckan-grsf.d4science.org/dataset?q=sarda via gCube Catalogue Portlet

  • The path parameter must be: path=dataset
  • The query parameter must be: query=BASE64(q=sarda), that is query=cT1zYXJkYQ==

Thus the URL to perform the query via 'gCube Catalogue Portlet' will be: https://i-marine.d4science.org/web/grsf/data-catalogue?path=dataset&query=cT1zYXJkYQ==

Widget to show Catalogue Statistics: Catalogue Badge

You can find how to configure the Catalogue Badge Widget for a D4Scince infra-gateway at Catalogue_Badge Service Manager page.

Related Issues

[1] gCube Data Catalogue for Global Record of Stocks and Fisheries - https://wiki.gcube-system.org/gcube/GCube_Data_Catalogue_for_GRSF

[2] Data Catalogue Resolver - https://wiki.gcube-system.org/gcube/URI_Resolver#CATALOGUE_Resolver

[4] How-to Purge a Catalogue Instance - https://wiki.gcube-system.org/gcube/How-to_purge_a_ckan_catalogue_instance