My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
GuideOfXsltModule  
A short guide on the opmv xslt module
Updated Aug 28, 2010 by jun.zhao...@gmail.com

Introduction

XML data is one of the most common format of data being transformed into Linked Data. Therefore, the XSLT module is created to provide very fine-grained classes and properties to describe how data was created by applying XSLT transformation. Some of the OPMV Core Ontology classes and corresponding XSLT Module sub-classes include:

  • Agent: Processor
  • Artifact: Binding, Stylesheet, Template, MatchingTemplate, NamedTemplate
  • Process: Transformation

The module also created its own class QName and reused concepts from existing vocabularies, including foaf:Agent and doap:Version.

It defines 8 object properties that extend the OPMV core and the OPMV Common Module:

  • xslt:used, xslt:source and xslt:binding as sub-properties of common:usedData, which itself is the sub-property of opmv:used;
  • xslt:initialTemplate, xslt:module and xslt:stylesheet as sub-properties of common:usedScript, which is another sub-property of opmv:used;
  • xslt:wasResultOf as sub-property of opmv:wasGeneratedBy, to refer to the artifact generated by the XSLT transformation process;
  • xslt:processor as sub-property of opmv:wasControlledBy, to refer to processor that performed the transformation process. The processor can be either a XSLT 1.0 processor or a XSLT 2.0 processor.
Besides, the XSLT module also defines the following stand-alone object properties, some of which are listed below:

Additional object properties and data properties from the XSLT module can be found documented in details in its schema, made available at its namespace: http://purl.org/net/opmv/types/xslt#.

Example

Example: Data creation by data transformation with XSLT

In this use case an RDF graph is created to describe each region based on the NaPTAN/NPTG data. Because the whole NaPTAN/NPTG data is available as one big XML file, the developer uses a stylesheet to split it up into lots of little XML files. Each of these XML files contains information about one region and a number of administrative areas and a number of districts. Then the developer processed this bunch of XML files with an XSLT stylesheet. The XSLT creates a number of RDF documents, one per region, administrative area and district.

The first example triples below use terms from the OPMV core to describe how each RDF graph about a region is created by data transformations with XSLT. The second example shows how the same information can be more precisely expressed using the XSLT module.

### the rdf graph is generated by a transformation process that uses the processor _:saxon

</data/transport/nptg/2010-03-31/region/EA>
   a opmv:Artifact ;
   opmv:wasEncodedBy <nptg/2010-03-31/region/EA.rdf> ;
   opmv:wasGeneratedBy [
     a opmv:Process ;
     opmv:used _:regionData ;
     opmv:used _:transformation ;
     opmv:wasControlledBy   _:saxon ;
     opmv:wasControlledBy <http://www.jenitennison.com/#me> ;
   ] 
.


</data/transport/nptg/2010-03-31/region/EA.rdf>
   a foaf:Document , opmv:Artifact ;
   opmv:wasGeneratedBy [
     a opmv:Process ;
     opmv:used </source/transport/nptg/2010-03-31/region/region-1.xml> ;
     opmv:used </code/transport/nptg/2010-03-31/xsl/region.xsl> ;
     opmv:wasPerformedBy _:saxon ;  ### _:saxon is a software
     opmv:wasPerformedBy <http://www.jenitennison.com/#me> ;
   ] 
.

The example below shows how we can use the XSLT module to:

  • differentiate the different roles played by the processor :saxon and agent :me in the transformation process
  • express that the XML data is the source data and the XLST script is the script used as inputs to the transformation process.

</data/transport/nptg/2010-03-31/region/EA.rdf>
   a foaf:Document , opmv:Artifact ;
   xslt:wasResultOf [
     a xslt:Transformation ;
     xslt:source </source/transport/nptg/2010-03-31/region/region-1.xml> ;
     xslt:stylesheet </code/transport/nptg/2010-03-31/xsl/region.xsl> ;
     xslt:processor _:saxon ;  ### _:saxon is a software
     opmv:wasPerformedBy <http://www.jenitennison.com/#me> ;
   ] 
.

Sign in to add a comment
Powered by Google Project Hosting