Skip to content

Alternative XML to RDF converters

Tim L edited this page Aug 1, 2016 · 22 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)

XSL crib sheet

(see also SDV organization)

<xsl:variable name="prefixes">
<xsl:text><![CDATA[
@prefix prov:    <http://www.w3.org/ns/prov#>.
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#>.
@prefix foaf:    <http://xmlns.com/foaf/0.1/>.
@prefix pext:    <http://www.ontotext.com/proton/protonext#> .
]]></xsl:text>
</xsl:variable>
  • document-uri(/) gives the file path of the input XML document.
  • replace(reverse(tokenize(document-uri(/),'/'))[1],'.tidy','') gives the local name of the input XML document.

See also Scraping HTML

Gibberish

For example data in nsf-gov/awards/version/wget Is there a way to combine conversion:TemplatedTopicsEnhancement with XML as input?

<xsl:template match="rootTag/Award">
         conversion:topic [
            conversion:name "[AwardID]"; ### THIS is an XPath.
            a foaf:Person;
            prov:alternateOf [ 
               a foaf:Person;
               conversion:name "[#4]";
            ];
         ];

         conversion:topic [
            conversion:name "[#2]";
            a bibo:Article;
            prov:alternateOf [
               a bibo:Article;
               conversion:name "[#3]";
            ];
         ];

         conversion:topic [
            conversion:name "http://lod.hackerceo.org/VIVO2DOI/bundle/increment([#1])";
            a prov:Bundle, void:Dataset, void:Linkset;
            prov:wasDerivedFrom [
               a prov:Entity, prv:File;
               conversion:name "[/]id/url/md5/md5([#1])";
               prv:retrievedBy [ 
                  conversion:name "[/]id/url/md5/md5([#1])/access";
                  a prov:Activity, prv:DataAccess;
                  prv:accessedResource [ conversion:name "[#1]" ];
               ];
            ];
            void:target [ conversion:name "domain([#1])", 
                                          "domain([#2])", 
                                          "domain([#3])", 
                                          "domain([#4])" ];
            void:linkPredicate prov:alternateOf;
            sio:has-member [ conversion:name "[#1]", "[#2]", "[#3]", "[#4]" ];
         ];
Clone this wiki locally