This XSLT is a proof of concept for the HTML+RDFa representation of metadata based on DCAT-AP, and related extensions (as GeoDCAT-AP). The DCAT-AP specification is available on Joinup, the collaboration platform of the EU ISA Programme.
As such, this XSLT must be considered as unstable, and can be updated any time based on the revisions to the DCAT-AP specifications and related extensions.
Comments and inquiries should be sent via the dedicated issue tracker.
dcat-ap-rdf2rdfa.xsl
: The XSLT transforming a set of DCAT-AP records from RDF/XML to HTML+RDFa.LICENCE.md
: The XSLT's licence.README.md
: This document.
The XSLT requires as input DCAT / DCAT-AP compliant metadata records in RDF/XML format.
The following sections provide examples of code from popular programming languages that can be used to run the XSLT.
<?php
// The URL of the RDF/XML document to be transformed.
$xmlURL = "http://some.site/dataset.rdf";
// The URL pointing to the latest version of the XSLT.
$xslURL = "https://webgate.ec.europa.eu/CITnet/stash/projects/ODCKAN/repos/dcat-ap-rdf2html/browse/dcat-ap-rdf2rdfa.xsl?raw";
$xml = new DOMDocument;
$xml->load($xmlURL) or die();
$xsl = new DOMDocument;
$xsl->load($xslURL) or die();
$proc = new XSLTProcessor();
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($xml);
?>
import lxml.etree as ET
# The URL of the RDF/XML document to be transformed.
xmlURL = "http://some.site/dataset.rdf"
# The URL pointing to the latest version of the XSLT.
xslURL = "https://webgate.ec.europa.eu/CITnet/stash/projects/ODCKAN/repos/dcat-ap-rdf2html/browse/dcat-ap-rdf2rdfa.xsl?raw"
xml = ET.parse(xmlURL)
xsl = ET.parse(xslURL)
transform = ET.XSLT(xsl)
print(ET.tostring(transform(xml), pretty_print=True))
TBD
This work is supported by the EU Interoperability Solutions for European Public Administrations Programme (ISA) through Action 1.17: Re-usable INSPIRE Reference Platform (ARe3NA).