Round-trip of RDF/OWL files in XML & RDF Lists

17 views
Skip to first unread message

Cory Casanave

unread,
Dec 18, 2017, 6:44:43 PM12/18/17
to rdflib-dev
I'm writing a utility for "safe" global search/replace/refactor across multiple rdf/owl xml files without loss or changing them. It is amazing how few libraries can fully round-trip RDF-XML, including rdflib.
The first problems I encountered were with restoring entity definitions and expansions, I was able to hack some of the libraries to get this to work.
But, I now find that a common practice in these ontologies (http://www.edmcouncil.org/financialbusiness) is not supported by rdflib, I was wondering if there was a fix or work-around. I do not have control over how the OWL is formed.

The error I got was: UserWarning: Assertions on rdflib.term.BNode('<some id>') other than RDF.first and RDF.rest are ignored ... including RDF.List

Here is an example of the OWL:
<owl:Class rdf:about="&fibo-sec-dbt-ab-cdo;CreditworthinessSelection">
<rdfs:label>creditworthiness selection</rdfs:label>
<owl:equivalentClass>
<rdfs:Datatype>
<owl:oneOf>
<rdf:List>
<rdf:first>Alt A</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first>NonPrime</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first>Prime</rdf:first>
<rdf:rest>
<rdf:List>
<rdf:first>SubPrime</rdf:first>
<rdf:rest rdf:resource="&rdf;nil"/>
</rdf:List>
</rdf:rest>
</rdf:List>
</rdf:rest>
</rdf:List>
</rdf:rest>
</rdf:List>
</owl:oneOf>
</rdfs:Datatype>
</owl:equivalentClass>
</owl:Class>

What this produced was not valid. Note that I also don't want rdf_nodeID to be generated.

Thanks in advance!


Reply all
Reply to author
Forward
0 new messages