Skip to content

JSON LD ISO19139 mapping proposal

François Prunayre edited this page Mar 1, 2019 · 2 revisions

This page describe a mapping for ISO19139 to JSON-LD. A formatter could be created to return a record as JSON-LD. This description can then be added to the main XSL formatter in order to provide all info in one place (in combination to schema.org tags already available).

Sample

{
    "@context": "http://schema.org/",
    "@type": "Dataset",
    "@id": "https://data.geoscience.fr/id/dataset/borehole",
	"identifier": "https://data.geoscience.fr/id/dataset/borehole",
    "includedInDataCatalog": ["https://data.geoscience.fr/id/catalogue/BRGM","https://data.geocatalogue.fr/id/catalog/geocatalogue"],    
    "name": [{"@value":"Forages (BSS)",  "@language":"fr"},{"@value":"Borehole",  "@language":"en"}],
    "description": "Définition à trouver",
	"distribution": [
		{
		"@type":"DataDownload",
		"contentUrl":"//TODO_the_download_url"		
		},	
		{
		"@id":"https://data.geoscience.fr/api/wms/borehole",
		"@type":["DataDownload","WebAPI"],
		"contentUrl":"http://geoservices.brgm.fr/geologie?service=WMS&request=GetCapabilities "
		},
		{
		"@id":"https://data.geoscience.fr/api/wfs/borehole",
		"@type":["DataDownload","WebAPI"],
		"contentUrl": "http://geoserverref.brgm-rec.fr/geoserver/ows?service=wfs&version=2.0.0&request=GetCapabilities",
		"additionalType":"http://inspire.ec.europa.eu/metadata-codelist/SpatialDataServiceCategory/infoFeatureAccessService"
		}
		],
	"keywords":[
				{"@value":"OUVRAGE", "@language":"fr"},
				{"@value":"BSS", "@language":"fr"},
				{"@value":"SOUS-SOL", "@language":"fr"},
				{"@value":"Géologie", "@language":"fr"},
				{"@value":"Geology", "@language":"en"}
				],	
    "about": [
        {
		"@id":"https://www.eionet.europa.eu/gemet/en/inspire-theme/ge",
		"name":[{"@value":"Géologie", "@language":"fr"},{"@value":"Geology", "@language":"en"}]
		},
		"http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/noLimitations/"
    ],
	"inLanguage":"fr",
	"publisher":{
		"@id":"http://www.brgm.fr",
		"@type":"Organization",
		"email" : "[email protected]",
		"contactPoint":
						{	"@type" : "PostalAddress",
							"addressCountry": "FRANCE",
							"addressLocality": "ORLEANS",
							"postalCode": "45060",
							"streetAddress": "3, avenue Claude Guillemin"						
						}
	},
	"dateModified":"2006-06-17",
	"spatialCoverage":{	"@type":"Place",
						"geo": {
						"@type":"GeoShape",
						"box":["-5.79028,41.36493 9.56222,51.09111",
								"-61.7961,15.87 -61.1871,16.5129",
								"-61.2315,14.4028 -60.817,14.8801",
								"-54.6038,2.11347 -51.6481,5.75542",
								"55.2206,-21.3739 55.8531,-20.8565",
								"45.0392,-12.9925 45.2297,-12.6625"
						]					
					}
	},
	"isBasedOn":"https://inspire.ec.europa.eu/id/document/tg/ge",
	"license":"http://www.data.gouv.fr/Licence-Ouverte-Open-Licence"
	
}

Mapping

XML:

<gmd:MD_Metadata> 
...
</gmd:MD_Metadata>

JSON-LD:

{
"@context": "http://schema.org/",
"@type":  "Dataset",
"includedInDataCatalog":"https://data.geocatalogue.fr/id/catalog/geocatalogue",
...
} 

Catalog

JSON-LD:

"includedInDataCatalog":["https://data.geocatalogue.fr/id/catalog/geocatalogue","$providerCalalog"],

--> use the provider data catalog URI for $providerCalalog

Identifier of metadata

XML:

<gmd:fileIdentifier>
    <gco:CharacterString>$gmdfileidentifier</gco:CharacterString>
</gmd:fileIdentifier>

JSON-LD:

"@id": "https://data.geocatalogue.fr/id/dataset/"+$gmdfileidentifier ,

Identifier of dataset

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
      <gmd:citation>
        <gmd:CI_Citation> 
......   
          <gmd:identifier>
            <gmd:RS_Identifier>
              <gmd:code>
                <gco:CharacterString>$value</gco:CharacterString>
              </gmd:code>
              <gmd:codeSpace>
                <gco:CharacterString>$codeSpace</gco:CharacterString>
              </gmd:codeSpace>
              <gmd:version>
                <gco:CharacterString>$version</gco:CharacterString>
              </gmd:version>
            </gmd:RS_Identifier>
          </gmd:identifier>
  ......
       </gmd:citation>
     </gmd:citation>
   </gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"identifier": {
   "@type": "PropertyValue",
   "propertyID": "$codeSpace",
   "value":  "$value"
 },

Dataset name

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
      <gmd:citation>
        <gmd:CI_Citation>
          <gmd:title>
            <gco:CharacterString>$value </gco:CharacterString>
          </gmd:title>   
     </gmd:citation>
   </gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"name": "$value",

Dataset description

XML:

<gmd:abstract>
        <gco:CharacterString>$value</gco:CharacterString>
</gmd:abstract>

JSON-LD:

"description": "$value"

Dataset creation date

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
      <gmd:citation>
        <gmd:CI_Citation>
            <gmd:date>
              <gmd:CI_Date>
               <gmd:date>
                <gco:Date>$value</gco:Date>
              </gmd:date>
              <gmd:dateType>
                <gmd:CI_DateTypeCode codeListValue="creation" codeList="CI_DateTypeCode" />
              </gmd:dateType>
            </gmd:CI_Date>
          </gmd:date>
           ......
       </gmd:citation>
     </gmd:citation>
   </gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"dateCreated": "$value",

Dataset modification date

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
      <gmd:citation>
        <gmd:CI_Citation>
            <gmd:date>
              <gmd:CI_Date>
               <gmd:date>
                <gco:Date>$value</gco:Date>
              </gmd:date>
              <gmd:dateType>
                <gmd:CI_DateTypeCode codeListValue="modified" codeList="CI_DateTypeCode" />
              </gmd:dateType>
            </gmd:CI_Date>
          </gmd:date>
           ......
       </gmd:citation>
     </gmd:citation>
   </gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"dateModified": "$value",

Dataset publication date

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
      <gmd:citation>
        <gmd:CI_Citation>
            <gmd:date>
              <gmd:CI_Date>
               <gmd:date>
                <gco:Date>$value</gco:Date>
              </gmd:date>
              <gmd:dateType>
                <gmd:CI_DateTypeCode codeListValue="publication" codeList="CI_DateTypeCode" />
              </gmd:dateType>
            </gmd:CI_Date>
          </gmd:date>
           ......
       </gmd:citation>
     </gmd:citation>
   </gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"datePublished": "$value",

Responsible party (role: "point of contact")

XML:

<gmd:pointOfContact>
	<gmd:CI_ResponsibleParty>
	  <gmd:organisationName>
		<gco:CharacterString>$name</gco:CharacterString>
	  </gmd:organisationName>
	  <gmd:contactInfo>
		<gmd:CI_Contact>
		  <gmd:address>
			<gmd:CI_Address>
			  <gmd:electronicMailAddress>
				<gco:CharacterString>$mail</gco:CharacterString>
			  </gmd:electronicMailAddress>
			</gmd:CI_Address>
		  </gmd:address>
		</gmd:CI_Contact>
	  </gmd:contactInfo>
	  <gmd:role>
		<gmd:CI_RoleCode codeListValue="point of contact" codeList="http://www.isotc211.org/2005/resources/codeList.xml#CI_RoleCode" />
	  </gmd:role>
	</gmd:CI_ResponsibleParty>
</gmd:pointOfContact>

JSON-LD:

"publisher":{
  "@type":"Organization",
  "name":"$name",
  "email" : "$mail"  
 }

Distribution: download

XML:

<gmd:distributionInfo>
   .......
    <gmd:MD_Distribution>
      <gmd:distributionFormat>
        <gmd:MD_Format>
          <gmd:name>
            <gco:CharacterString>$formatName</gco:CharacterString>
          </gmd:name>
          <gmd:version>
            <gco:CharacterString>$formatVersion</gco:CharacterString>
          </gmd:version>
        </gmd:MD_Format>
      </gmd:distributionFormat>
      <gmd:transferOptions>
        <gmd:MD_DigitalTransferOptions>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>$url</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>$prtocol</gco:CharacterString>
              </gmd:protocol>
              <gmd:description>
                <gco:CharacterString>$description</gco:CharacterString>
              </gmd:description>
              <gmd:function>
                <gmd:CI_OnLineFunctionCode codeListValue="$functionVlaue" codeList="$functionCode" />
              </gmd:function>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
        </gmd:MD_DigitalTransferOptions>
      </gmd:transferOptions>
    </gmd:MD_Distribution>
   ......
</gmd:distributionInfo>

JSON-LD:

"distribution": [
  {"@type":"DataDownload",
  "contentUrl":{
     "@id": "$url",
     "@type": "URL",
     "encodingFormat":"$formatName"
   
   }
  }
  ],

Distribution :service

XML:

<gmd:distributionInfo>
   .......
    <gmd:MD_Distribution>
      <gmd:distributionFormat>
        <gmd:MD_Format>
          <gmd:name>
            <gco:CharacterString>$formatName</gco:CharacterString>
          </gmd:name>
          <gmd:version>
            <gco:CharacterString>$formatVersion</gco:CharacterString>
          </gmd:version>
        </gmd:MD_Format>
      </gmd:distributionFormat>
      <gmd:transferOptions>
        <gmd:MD_DigitalTransferOptions>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>$url</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gco:CharacterString>$prtocol</gco:CharacterString>
              </gmd:protocol>
              <gmd:description>
                <gco:CharacterString>$description</gco:CharacterString>
              </gmd:description>
              <gmd:function>
                <gmd:CI_OnLineFunctionCode codeListValue="$functionVlaue" codeList="$functionCode" />
              </gmd:function>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
        </gmd:MD_DigitalTransferOptions>
      </gmd:transferOptions>
    </gmd:MD_Distribution>
   ......
</gmd:distributionInfo>

JSON-LD:

"distribution": [
  {
  "@id":"$url",
  "@type":["DataDownload","WebAPI"],
  "contentUrl": "$url",
  "additionalType":"$addType"
  }
  ],

--> generate corresponding INSPIRE $addType from $prtocol ex: if $protocol = "WMS" then $addType = "http://inspire.ec.europa.eu/metadata-codelist/SpatialDataServiceCategory/infoFeatureAccessService""

Textual keywords

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
....
      <gmd:descriptiveKeywords>
        <gmd:MD_Keywords>
….
          <gmd:keyword>
            <gco:CharacterString>$value1</gco:CharacterString>
          </gmd:keyword>          
          <gmd:keyword>
            <gco:CharacterString>$value2</gco:CharacterString>
          </gmd:keyword>
…..
        </gmd:MD_Keywords>
      </gmd:descriptiveKeywords>
.....
   </gmd:MD_DataIdentification>
 </gmd:identificationInfo>

JSON-LD:

"keywords":[
    "$value1","$vlaue2",…….
    ], 

Keywords from schemes

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
....
      <gmd:descriptiveKeywords>
        <gmd:MD_Keywords>
.....
          <gmd:keyword>
            <gco:CharacterString>$value1</gco:CharacterString>
          </gmd:keyword>          
          <gmd:keyword>
            <gco:CharacterString>$value2</gco:CharacterString>
          </gmd:keyword>
.....
          <gmd:type>
                  <gmd:MD_KeywordTypeCode codeList="$codeList" codeListValue="$codeListValue"/>
          </gmd:type>
          <gmd:thesaurusName>
            <gmd:CI_Citation>
              <gmd:title>
                <gco:CharacterString>$thesaurus(example: GEMET)</gco:CharacterString>
    ....
              </gmd:title>
              <gmd:date>
                <gmd:CI_Date>
                  <gmd:date>
                    <gco:Date>$date</gco:Date>
                  </gmd:date>
                  .....
                </gmd:CI_Date>
              </gmd:date>
            </gmd:CI_Citation>
          </gmd:thesaurusName>
        </gmd:MD_Keywords>
      </gmd:descriptiveKeywords>
.....
   </gmd:MD_DataIdentification>
 </gmd:identificationInfo>

JSON-LD:

"about": [
        {
  "@id":"$URI_of_$value1_in_$thesaurus",
  "name":"$value1"
  },{
  "@id":"$URI_of_$value2_in_$thesaurus",
  "name":"$value2"
  },

]

--> no direct way to construct URIs, could be add as jsonld schema "keywords"

Language

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
   <gmd:language>
        <gco:CharacterString>$lang</gco:CharacterString>
...
      </gmd:language>
   </gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"inLanguage":"$lang",

--> not the same standard for encoding (example "fr" in jsonld instead of "fre")

Responsible party (role: "publisher")

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
	.....
		<gmd:pointOfContact>
			<gmd:CI_ResponsibleParty>
			  <gmd:organisationName>
				<gco:CharacterString>$orgName</gco:CharacterString>
			  </gmd:organisationName>
			  <gmd:contactInfo>
				<gmd:CI_Contact>
					<gmd:address>
						<gmd:CI_Address>  
							<gmd:deliveryPoint>
								<gco:CharacterString>$adress</gco:CharacterString>       
							</gmd:deliveryPoint>
							<gmd:city>
								<gco:CharacterString>$city</gco:CharacterString>
							</gmd:city>
							<gmd:administrativeArea>
								<gco:CharacterString>$adminErea<gco:CharacterString/>
							</gmd:administrativeArea>
							<gmd:postalCode>
								<gco:CharacterString>$postalCode</gco:CharacterString>
							</gmd:postalCode>
							<gmd:country>
								<gco:CharacterString>$country</gco:CharacterString>       
							</gmd:country>
							<gmd:electronicMailAddress>
								<gco:CharacterString>$mail</gco:CharacterString>
							</gmd:electronicMailAddress>
						</gmd:CI_Address>
					</gmd:address>
				</gmd:CI_Contact>
			  </gmd:contactInfo>
			  <gmd:role>
				<gmd:CI_RoleCode codeListValue="publisher" codeList="http://www.isotc211.org/2005/resources/codeList.xml#CI_RoleCode" />
			  </gmd:role>
			</gmd:CI_ResponsibleParty>
		</gmd:pointOfContact>
    ....
	</gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"inLanguage":"$lang",

Spatial extent

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
 .....
        <gmd:extent>
            <gmd:EX_Extent>
               <gmd:description>
                  <gco:CharacterString>$description</gco:CharacterString>                  
               </gmd:description>
               <gmd:geographicElement>
                  <gmd:EX_GeographicBoundingBox>
                     <gmd:extentTypeCode>
                        <gco:Boolean>true</gco:Boolean>
                     </gmd:extentTypeCode>
                     <gmd:westBoundLongitude>
                        <gco:Decimal>$xmin</gco:Decimal>
                     </gmd:westBoundLongitude>
                     <gmd:eastBoundLongitude>
                        <gco:Decimal>$xmax</gco:Decimal>
                     </gmd:eastBoundLongitude>
                     <gmd:southBoundLatitude>
                        <gco:Decimal>$ymin</gco:Decimal>
                     </gmd:southBoundLatitude>
                     <gmd:northBoundLatitude>
                        <gco:Decimal>$ymax</gco:Decimal>
                     </gmd:northBoundLatitude>
                  </gmd:EX_GeographicBoundingBox>
               </gmd:geographicElement>
               ...
            </gmd:EX_Extent>
        </gmd:extent>
   ....
	</gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"spatialCoverage":{ "@type":"Place",
      "description": "$description",
      "geo": {
      "@type":"GeoShape",
      "box":[
	  "$xmin, $ymin $xmax,$ymax",
       ...
      ]     
     }
 },

Temporal extent

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
	.....
    <gmd:extent>
            <gmd:EX_Extent>
               <gmd:temporalElement>
                  <gmd:EX_TemporalExtent>
                     <gmd:extent>
                        <gml:TimePeriod gml:id="$id">
                           <gml:beginPosition>$dateBegin<gml:beginPosition/>
                           <gml:endPosition>$dateEnd<gml:endPosition/>
                        </gml:TimePeriod>
                     </gmd:extent>
                  </gmd:EX_TemporalExtent>
               </gmd:temporalElement>
            </gmd:EX_Extent>
         </gmd:extent>
	....
	</gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"datasetTimeInterval": "$dateBegin+/+$dateEnd",

License

XML:

<gmd:identificationInfo>
    <gmd:MD_DataIdentification>
	.....
		<gmd:resourceConstraints>
			<gmd:MD_LegalConstraints>
			  <gmd:useLimitation>
					  <gco:CharacterString>$license</gco:CharacterString>
			  </gmd:useLimitation>
			  <gmd:otherConstraints>
				<gco:CharacterString>$other</gco:CharacterString>
			  </gmd:otherConstraints>
			</gmd:MD_LegalConstraints>
		</gmd:resourceConstraints>
	....
	</gmd:MD_DataIdentification>
</gmd:identificationInfo>

JSON-LD:

"license":"$license"

Author

  • Sylvain Grellet (BRGM)
  • Abdelfettah Feliachi (BRGM)
Clone this wiki locally