rdfio / RDFIO

RDF triples import, export and PHP SPARQL endpoint for Semantic MediaWiki
http://www.mediawiki.org/wiki/Extension:RDFIO
Other
29 stars 12 forks source link

Handle BNode object type #35

Closed samuell closed 7 years ago

samuell commented 7 years ago

This happens when trying to import certain RDF/XML constructs:

selection_195

(Relevant piece of code)

Some links with relevant info:

samuell commented 7 years ago

After adding a switch case for bnode (adfe9de43eca605a994daa8e7553616742444307), one can now see how badly RDF/XML import works.

Trying to import this:

<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:ns0="http://www.recshop.fake/cd#"
         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

  <rdf:Description rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
    <ns0:artist>Bob Dylan</ns0:artist>
    <ns0:country>
      <rdf:Description rdf:about="http://www.countries.org/onto/USA">
        <rdfs:label>USA</rdfs:label>
      </rdf:Description>
    </ns0:country>

    <ns0:company>Columbia</ns0:company>
    <ns0:price>10.90</ns0:price>
    <ns0:year>1985</ns0:year>
    <rdf:type>Album</rdf:type>
  </rdf:Description>

  <rdf:Description rdf:about="http://www.recshop.fake/cd/Hide your heart">
    <ns0:artist>Bonnie Tyler</ns0:artist>
    <ns0:country>UK</ns0:country>
    <ns0:company>CBS Records</ns0:company>
    <ns0:price>9.90</ns0:price>
    <ns0:year>1988</ns0:year>
    <rdf:type>Album</rdf:type>
  </rdf:Description>

  <rdf:Description rdf:about="http://www.countries.org/onto/Albums">
    <rdfs:subClassOf rdf:resource="http://www.countries.org/onto/MediaCollections"/>
  </rdf:Description>

</rdf:RDF>

... results in this:

selection_196

samuell commented 7 years ago

@zidama It seems this was easier to fix than I thought! Need to test a bit more though. Will get back with more info as soon as I have tested a bit more.

samuell commented 7 years ago

This is now fixed in v2.3.0. (Ping @zidama)