blake-regalia / graphy.js

A collection of RDF libraries for JavaScript
https://graphy.link/
ISC License
163 stars 4 forks source link

RDF/XML support #15

Closed namedgraph closed 4 years ago

namedgraph commented 4 years ago

Any chance to include RDF/XML parser/serializer?

blake-regalia commented 4 years ago

Definitely want the serializer. XML parser is more involved and may have to consider if existing parser(s) can be outperformed.

namedgraph commented 4 years ago

There's a streaming parser here: https://github.com/rdfjs/rdfxml-streaming-parser.js /cc @rubensworks

blake-regalia commented 4 years ago

@namedgraph Saw your email; am working on the serializer now. To get this out sooner, I am going to release just the scriber, which will be fully functional but won't support fancy features such as parseType="collection", rdf:li, typed node elements, property attributes, etc. -- those features may eventually end in the writer.

namedgraph commented 4 years ago

Thank you! This should allow me to do XSLT transformations in the browser using Saxon-JS.

May I suggest this Jena's RDFXML_PLAIN as the default layout, or at least one of the "profiles"? It simplifies the post-processing quite a bit by:

Example:

<rdf:RDF
    xmlns:dct="http://purl.org/dc/terms/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:j.0="http://www.w3.org/ns/auth/acl#"
    xmlns:sioc="http://rdfs.org/sioc/ns#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:j.1="https://localhost:4443/ns/default#"
    xmlns:j.2="https://www.w3.org/ns/ldt/document-hierarchy/domain#"
    xmlns:j.3="http://rdfs.org/ns/void#" >
  <rdf:Description rdf:about="https://localhost:4443/test/">
    <j.2:slug>test</j.2:slug>
    <j.2:select rdf:resource="https://localhost:4443/queries/default/select-children/#this"/>
    <foaf:maker rdf:resource="https://localhost:4443/admin/acl/agents/e72284e8-6e48-4a41-8263-42a2a79caf24/#this"/>
    <j.0:owner rdf:resource="https://localhost:4443/admin/acl/agents/e72284e8-6e48-4a41-8263-42a2a79caf24/#this"/>
    <sioc:has_parent rdf:resource="https://localhost:4443/"/>
    <j.3:inDataset rdf:resource="https://localhost:4443/graphs/9b688aa3-1c65-4b28-a87f-80cd3a4f8f96/#this"/>
    <dct:title>Test</dct:title>
    <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-02-26T20:48:11.458+01:00</dct:created>
    <rdf:type rdf:resource="https://localhost:4443/ns/default#Container"/>
  </rdf:Description>
  <rdf:Description rdf:about="https://localhost:4443/concept-schemes/">
    <j.2:slug>concept-schemes</j.2:slug>
    <j.2:select rdf:resource="https://localhost:4443/queries/default/select-children/#this"/>
    <foaf:maker rdf:resource="https://localhost:4443/admin/acl/agents/fd22abae-9aae-4d85-8b75-83d916b246e7/#this"/>
    <j.0:owner rdf:resource="https://localhost:4443/admin/acl/agents/fd22abae-9aae-4d85-8b75-83d916b246e7/#this"/>
    <sioc:has_parent rdf:resource="https://localhost:4443/"/>
    <j.3:inDataset rdf:resource="https://localhost:4443/graphs/25ddbecc-6883-4ddc-ae33-8f2fd5eb52f1/#this"/>
    <dct:title>Concept schemes</dct:title>
    <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-03-16T11:43:49.465+01:00</dct:created>
    <rdf:type rdf:resource="https://localhost:4443/ns/default#Container"/>
  </rdf:Description>
  <rdf:Description rdf:about="https://localhost:4443/d376ee88-ff7d-48ee-81c4-1220c9f482f0/">
    <j.2:slug>d376ee88-ff7d-48ee-81c4-1220c9f482f0</j.2:slug>
    <j.2:select rdf:resource="https://localhost:4443/queries/default/select-children/#this"/>
    <foaf:maker rdf:resource="https://localhost:4443/admin/acl/agents/65066d0f-0e6f-411e-8716-09d8db9eb08d/#this"/>
    <j.0:owner rdf:resource="https://localhost:4443/admin/acl/agents/65066d0f-0e6f-411e-8716-09d8db9eb08d/#this"/>
    <sioc:has_parent rdf:resource="https://localhost:4443/"/>
    <j.3:inDataset rdf:resource="https://localhost:4443/graphs/0cb11f64-4cba-4609-855c-97968d4c28de/#this"/>
    <dct:title>Venskabs byen</dct:title>
    <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-02-13T00:05:15.86+01:00</dct:created>
    <rdf:type rdf:resource="https://localhost:4443/ns/default#Container"/>
  </rdf:Description>
  <rdf:Description rdf:about="https://localhost:4443/concepts/">
    <j.2:slug>concepts</j.2:slug>
    <j.2:select rdf:resource="https://localhost:4443/queries/default/select-children/#this"/>
    <foaf:maker rdf:resource="https://localhost:4443/admin/acl/agents/fd22abae-9aae-4d85-8b75-83d916b246e7/#this"/>
    <j.0:owner rdf:resource="https://localhost:4443/admin/acl/agents/fd22abae-9aae-4d85-8b75-83d916b246e7/#this"/>
    <sioc:has_parent rdf:resource="https://localhost:4443/"/>
    <j.3:inDataset rdf:resource="https://localhost:4443/graphs/90e741f0-d573-43c0-a6c2-a60696f9a440/#this"/>
    <dct:title>Concepts</dct:title>
    <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-03-16T11:43:44.36+01:00</dct:created>
    <rdf:type rdf:resource="https://localhost:4443/ns/default#Container"/>
  </rdf:Description>
  <rdf:Description rdf:about="https://localhost:4443/6a6283d2-2a40-4882-b89d-8073a7c30e17/">
    <j.2:slug>6a6283d2-2a40-4882-b89d-8073a7c30e17</j.2:slug>
    <foaf:maker rdf:resource="https://localhost:4443/admin/acl/agents/faa32f94-bf03-4c0c-9e87-ee877f16e603/#this"/>
    <j.0:owner rdf:resource="https://localhost:4443/admin/acl/agents/faa32f94-bf03-4c0c-9e87-ee877f16e603/#this"/>
    <sioc:has_container rdf:resource="https://localhost:4443/"/>
    <j.3:inDataset rdf:resource="https://localhost:4443/graphs/b778983a-cd16-45b1-a04f-a8bd73b62bcb/#this"/>
    <dct:title>Test1</dct:title>
    <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-02-26T17:24:38.94+01:00</dct:created>
    <rdf:type rdf:resource="https://localhost:4443/ns/default#Item"/>
  </rdf:Description>
</rdf:RDF>
blake-regalia commented 4 years ago

Added @graphy/content.xml.scribe in v4.1.0.

CLI:

graphy read -c nt / scribe -c xml < input.ttl > output.rdf

API:

const factory = require('@graphy/core.data.factory');
const xml_scribe = require('graphy/content.xml.scribe');

// create an RDF/XML content scriber
let ds_writer = xml_scribe({
   prefixes: {
      rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
      rdfs: 'http://www.w3.org/2000/01/rdf-schema#',
      owl: 'http://www.w3.org/2002/07/owl#',
      dbr: 'http://dbpedia.org/resource/',
      dbo: 'http://dbpedia.org/ontology/',
      demo: 'http://ex.org/demo#',
      eg: 'http://ex.org/owl#',
   },
});

// pipe to stdout
ds_writer.pipe(process.stdout);

// write a triple using an RDFJS Quad
{
   let kt_banana = factory.namedNode('http://ex.org/Banana');
   let kt_color = factory.namedNode('http://ex.org/color');
   let kt_yellow = factory.literal('yellow', factory.namedNode('http://ex.org/Color'));

   ds_writer.write(factory.quad(kt_banana, kt_color, kt_yellow));
}

// write some triples using a concise triples hash
ds_writer.write({
   type: 'c3r',
   value: {
      // triples about dbr:Banana
      'dbr:Banana': {
         // `a` is shortcut for rdf:type
         a: ['dbo:Plant'],

         // list of objects
         'rdfs:label': ['@en"Banana', '@fr"Banane', '@es"Plátano'],

         // nested objects are not allowed in strict-mode
         // they must be encoded as blank nodes
         'demo:steps': ['_:b0'],
      },

      '_:b0': {
         'rdf:first': ['demo:Peel'],
         'rdf:rest': ['_:b1'],
      },

      '_:b1': {
         'rdf:first': ['demo:Slice'],
         'rdf:rest': ['_:b2'],
      },

      '_:b2': {
         'rdf:first': ['demo:distribute'],
         'rdf:rest': ['rdf:nil'],
      },
   },
});

// OR pipe an input stream into the serializer
{
   const nt_read = require('@graphy/content.nt.read');

   process.stdin.pipe(nt_read())
      .pipe(ds_writer);
}

// end the writable side of the transform
ds_writer.end();
namedgraph commented 4 years ago

@blake-regalia thanks a lot! Before we try this out, would it be possible to see a snippet of the output somewhere?

blake-regalia commented 4 years ago

@namedgraph Here is an example: Fetch Turtle from DBpedia, read its contents, filter by subjects whose IRI starts with 'dbr:Banana' and exclude triples with literals in languages other than English, sort, then scribe to RDF/XML.

$ graphy --version
4.1.0

$ curl --silent http://dbpedia.org/data/Banana.ttl  \
  | graphy read / filter -x '/^dbr:Banana/c;; @en or not {languaged}' / tree / scribe -c xml

Output:

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dbo="http://dbpedia.org/ontology/"
    xmlns:dbr="http://dbpedia.org/resource/"
    xmlns:ns2="http://purl.org/linguistics/gold/"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:wikipedia-en="http://en.wikipedia.org/wiki/"
    xmlns:umbel-rc="http://umbel.org/umbel/rc/"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dbpedia-pt="http://pt.dbpedia.org/resource/"
    xmlns:dbpedia-eu="http://eu.dbpedia.org/resource/"
    xmlns:dbpedia-id="http://id.dbpedia.org/resource/"
    xmlns:dbpedia-wikidata="http://wikidata.dbpedia.org/resource/"
    xmlns:dbpedia-it="http://it.dbpedia.org/resource/"
    xmlns:dbpedia-fr="http://fr.dbpedia.org/resource/"
    xmlns:wikidata="http://www.wikidata.org/entity/"
    xmlns:dct="http://purl.org/dc/terms/"
    xmlns:dbc="http://dbpedia.org/resource/Category:"
    xmlns:dbp="http://dbpedia.org/property/"
    xmlns:prov="http://www.w3.org/ns/prov#"
    xmlns:ns20="http://dbpedia.org/datatype/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:ns22="http://agritrade.cta.int/Agriculture/Commodities/"
    xmlns:ns23="http://www.kew.org/science-conservation/plants-fungi/">

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_split">
        <dbo:ingredient rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana">
        <rdf:type rdf:resource="http://umbel.org/umbel/rc/BiologicalLivingObject"/>
        <rdf:type rdf:resource="http://umbel.org/umbel/rc/EukaryoticCell"/>
        <rdf:type rdf:resource="http://umbel.org/umbel/rc/Plant"/>
        <rdf:type rdf:resource="http://dbpedia.org/ontology/Plant"/>
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
        <rdfs:label xml:lang="en">Banana</rdfs:label>
        <rdfs:comment xml:lang="en">The banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. In some countries, bananas used for cooking may be called plantains. The fruit is variable in size, color and firmness, but is usually elongated and curved, with soft flesh rich in starch covered with a rind which may be green, yellow, red, purple, or brown when ripe. The fruits grow in clusters hanging from the top of the plant. Almost all modern edible parthenocarpic (seedless) bananas come from two wild species – Musa acuminata and Musa balbisiana. The scientific names of most cultivated bananas are Musa acuminata, Musa balbisiana, and Musa × paradisiaca for the hybrid Musa acuminata × M. balbisiana, depending on their genomic constitution. The old scient</rdfs:comment>
        <rdfs:seeAlso rdf:resource="http://dbpedia.org/resource/Musa_acuminata"/>
        <rdfs:seeAlso rdf:resource="http://dbpedia.org/resource/Cooking_plantain"/>
        <owl:sameAs rdf:resource="http://pt.dbpedia.org/resource/Banana"/>
        <owl:sameAs rdf:resource="http://ko.dbpedia.org/resource/바나나"/>
        <owl:sameAs rdf:resource="http://eu.dbpedia.org/resource/Banana"/>
        <owl:sameAs rdf:resource="http://cs.dbpedia.org/resource/Banán"/>
        <owl:sameAs rdf:resource="http://ja.dbpedia.org/resource/バナナ"/>
        <owl:sameAs rdf:resource="http://nl.dbpedia.org/resource/Banaan_(vrucht)"/>
        <owl:sameAs rdf:resource="http://id.dbpedia.org/resource/Pisang"/>
        <owl:sameAs rdf:resource="http://wikidata.dbpedia.org/resource/Q503"/>
        <owl:sameAs rdf:resource="http://rdf.freebase.com/ns/m.09qck"/>
        <owl:sameAs rdf:resource="http://dbpedia.org/resource/Banana"/>
        <owl:sameAs rdf:resource="http://el.dbpedia.org/resource/Μπανάνα"/>
        <owl:sameAs rdf:resource="http://es.dbpedia.org/resource/Plátano_(fruto)"/>
        <owl:sameAs rdf:resource="http://it.dbpedia.org/resource/Banana"/>
        <owl:sameAs rdf:resource="http://fr.dbpedia.org/resource/Banane"/>
        <owl:sameAs rdf:resource="http://d-nb.info/gnd/4204383-9"/>
        <owl:sameAs rdf:resource="http://www.wikidata.org/entity/Q503"/>
        <dct:subject rdf:resource="http://dbpedia.org/resource/Category:Tropical_fruit"/>
        <dct:subject rdf:resource="http://dbpedia.org/resource/Category:Staple_foods"/>
        <dct:subject rdf:resource="http://dbpedia.org/resource/Category:Tropical_agriculture"/>
        <dct:subject rdf:resource="http://dbpedia.org/resource/Category:Fiber_plants"/>
        <dct:subject rdf:resource="http://dbpedia.org/resource/Category:Bananas"/>
        <foaf:depiction rdf:resource="http://commons.wikimedia.org/wiki/Special:FilePath/Bananavarieties.jpg"/>
        <foaf:isPrimaryTopicOf rdf:resource="http://en.wikipedia.org/wiki/Banana"/>
        <dbp:s rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1911</dbp:s>
        <prov:wasDerivedFrom rdf:resource="http://en.wikipedia.org/wiki/Banana?oldid=740636967"/>
        <dbp:sugars rdf:datatype="http://dbpedia.org/datatype/gram">12.23</dbp:sugars>
        <dbp:opt1v rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">2.2000000000000001776</dbp:opt1v>
        <dbp:opt1n rdf:resource="http://dbpedia.org/resource/Fluoride"/>
        <dbp:cholineMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">9.8000000000000007105</dbp:cholineMg>
        <dbp:group rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">&quot;Note&quot;</dbp:group>
        <dbp:direction rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">vertical</dbp:direction>
        <dbp:carbs rdf:datatype="http://dbpedia.org/datatype/gram">22.84</dbp:carbs>
        <dbp:fat rdf:datatype="http://dbpedia.org/datatype/gram">0.33</dbp:fat>
        <dbp:fiber rdf:datatype="http://dbpedia.org/datatype/gram">2.6</dbp:fiber>
        <dbp:folateUg rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">20</dbp:folateUg>
        <dbp:ironMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.26000000000000000888</dbp:ironMg>
        <dbp:kj rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">371</dbp:kj>
        <dbp:magnesiumMg rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">27</dbp:magnesiumMg>
        <dbp:manganeseMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.27000000000000001776</dbp:manganeseMg>
        <dbp:niacinMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.66500000000000003553</dbp:niacinMg>
        <dbp:pantothenicMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.3340000000000000191</dbp:pantothenicMg>
        <dbp:phosphorusMg rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">22</dbp:phosphorusMg>
        <dbp:potassiumMg rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">358</dbp:potassiumMg>
        <dbp:protein rdf:datatype="http://dbpedia.org/datatype/gram">1.09</dbp:protein>
        <dbp:riboflavinMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.072999999999999995448</dbp:riboflavinMg>
        <dbp:sodiumMg rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</dbp:sodiumMg>
        <dbp:sourceUsda rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</dbp:sourceUsda>
        <dbp:thiaminMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.030999999999999999778</dbp:thiaminMg>
        <dbp:vitb6Mg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.4000000000000000222</dbp:vitb6Mg>
        <dbp:vitcMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">8.6999999999999992895</dbp:vitcMg>
        <dbp:water rdf:datatype="http://dbpedia.org/datatype/gram">74.91</dbp:water>
        <dbp:zincMg rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">0.14999999999999999445</dbp:zincMg>
        <dbo:wikiPageExternalLink rdf:resource="http://agritrade.cta.int/Agriculture/Commodities/Bananas"/>
        <dbo:wikiPageExternalLink rdf:resource="http://www.webcitation.org/6DWPTd1hm"/>
        <dbo:wikiPageExternalLink rdf:resource="http://agroforestry.net/tti/Banana-plantain-overview.pdf"/>
        <dbo:wikiPageExternalLink rdf:resource="http://www.kew.org/science-conservation/plants-fungi/musa-acuminata-banana"/>
        <dbo:wikiPageExternalLink rdf:resource="http://www.ogtr.gov.au/internet/ogtr/publishing.nsf/content/banana-3/$FILE/biologybanana08.pdf"/>
        <dbo:wikiPageExternalLink rdf:resource="http://kukr.lib.ku.ac.th/Fulltext_kukr/KU0222075c.pdf"/>
        <dbo:wikiPageExternalLink rdf:resource="http://ndb.nal.usda.gov/ndb/search/list?qlookup=09040&amp;format=Full"/>
        <dbo:wikiPageExternalLink rdf:resource="http://agroforestry.net/tti/Musa-banana-plantain.pdf"/>
        <dbp:caption rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">Coconut, banana and banana leaves used while worshiping River Kaveri at Tiruchirappalli, India.</dbp:caption>
        <dbp:caption rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">Banana flowers and leaves for sale in the Thanin market in Chiang Mai, Thailand.</dbp:caption>
        <dbp:note rdf:resource="http://ndb.nal.usda.gov/ndb/search/list?qlookup=09040&amp;format=Full"/>
        <dbo:abstract xml:lang="en">The banana is an edible fruit, botanically a berry, produced by several kinds of large herbaceous flowering plants in the genus Musa. In some countries, bananas used for cooking may be called plantains. The fruit is variable in size, color and firmness, but is usually elongated and curved, with soft flesh rich in starch covered with a rind which may be green, yellow, red, purple, or brown when ripe. The fruits grow in clusters hanging from the top of the plant. Almost all modern edible parthenocarpic (seedless) bananas come from two wild species – Musa acuminata and Musa balbisiana. The scientific names of most cultivated bananas are Musa acuminata, Musa balbisiana, and Musa × paradisiaca for the hybrid Musa acuminata × M. balbisiana, depending on their genomic constitution. The old scientific name Musa sapientum is no longer used. Musa species are native to tropical Indomalaya and Australia, and are likely to have been first domesticated in Papua New Guinea. They are grown in at least 107 countries, primarily for their fruit, and to a lesser extent to make fiber, banana wine and banana beer and as ornamental plants. Worldwide, there is no sharp distinction between &quot;bananas&quot; and &quot;plantains&quot;. Especially in the Americas and Europe, &quot;banana&quot; usually refers to soft, sweet, dessert bananas, particularly those of the , which are the main exports from banana-growing countries. By contrast, Musa cultivars with firmer, starchier fruit are called &quot;plantains&quot;. In other regions, such as Southeast Asia, many more kinds of banana are grown and eaten, so the simple two-fold distinction is not useful and is not made in local languages. The term &quot;banana&quot; is also used as the common name for the plants which produce the fruit. This can extend to other members of the genus Musa like the scarlet banana (Musa coccinea), pink banana (Musa velutina) and the Fe&apos;i bananas. It can also refer to members of the genus Ensete, like the snow banana (Ensete glaucum) and the economically important false banana (Ensete ventricosum). Both genera are classified under the banana family, Musaceae.</dbo:abstract>
        <dbo:thumbnail rdf:resource="http://commons.wikimedia.org/wiki/Special:FilePath/Bananavarieties.jpg?width=300"/>
        <dbo:wikiPageRevisionID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">740636967</dbo:wikiPageRevisionID>
        <dbo:wikiPageID rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">38940</dbo:wikiPageID>
        <dbp:image rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">Thanin market banana flowers and leaves.jpg</dbp:image>
        <dbp:image rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">River Kaveri worship Tiruchirappalli.jpg</dbp:image>
        <dbp:b rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">no</dbp:b>
        <dbp:commons rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">Banana</dbp:commons>
        <dbp:n rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">no</dbp:n>
        <dbp:q rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">no</dbp:q>
        <dbp:v rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">Banana production</dbp:v>
        <dbp:voy rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">no</dbp:voy>
        <dbp:wikt rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">banana</dbp:wikt>
        <dbp:name rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString">Bananas, raw</dbp:name>
        <ns2:hypernym rdf:resource="http://dbpedia.org/resource/Fruit"/>
        <dbp:width rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">220</dbp:width>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_plant">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_(fruit)">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_Tree">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_Trees">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_tree">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Bananas">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_trade">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_flower">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_cultivation">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Bananaa">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_stalk_carving">
        <dbo:wikiPageRedirects rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_pudding">
        <dbo:ingredient rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_bread">
        <dbo:ingredient rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_(disambiguation)">
        <dbo:wikiPageDisambiguates rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_boat_(food)">
        <dbo:ingredient rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Bananas_Foster">
        <dbo:ingredient rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>

    <rdf:Description rdf:about="http://dbpedia.org/resource/Banana_custard">
        <dbo:ingredient rdf:resource="http://dbpedia.org/resource/Banana"/>
    </rdf:Description>
</rdf:RDF>
namedgraph commented 4 years ago

Looks awesome!! Can't wait to try this with Saxon-JS.