Skip to content

A proof of concept for the HTML+RDFa representation of DCAT-AP metadata

License

Notifications You must be signed in to change notification settings

SEMICeu/dcat-ap-rdf2html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

Purpose and usage

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.

Content

How it works

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

<?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);

?>

Python

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))

Java

TBD

Credits

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).

About

A proof of concept for the HTML+RDFa representation of DCAT-AP metadata

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages