-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Importing the Gist ontology using owlready2 is (inconsistently) losing information while trying to parse a complex datatype range.
The numericValue datatype property is defined like so:
<owl:DatatypeProperty rdf:about="&gist;numericValue">
<rdfs:domain rdf:resource="&gist;Magnitude"/>
<rdfs:isDefinedBy rdf:resource="https://w3id.org/semanticarts/ontology/gistCore"/>
<rdfs:range>
<rdfs:Datatype>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="&xsd;byte"></rdf:Description>
<rdf:Description rdf:about="&xsd;decimal"></rdf:Description>
<rdf:Description rdf:about="&xsd;double"></rdf:Description>
<rdf:Description rdf:about="&xsd;float"></rdf:Description>
<rdf:Description rdf:about="&xsd;int"></rdf:Description>
<rdf:Description rdf:about="&xsd;integer"></rdf:Description>
<rdf:Description rdf:about="&xsd;long"></rdf:Description>
<rdf:Description rdf:about="&xsd;negativeInteger"></rdf:Description>
<rdf:Description rdf:about="&xsd;nonNegativeInteger"></rdf:Description>
<rdf:Description rdf:about="&xsd;nonPositiveInteger"></rdf:Description>
<rdf:Description rdf:about="&xsd;positiveInteger"></rdf:Description>
<rdf:Description rdf:about="&xsd;short"></rdf:Description>
<rdf:Description rdf:about="&xsd;unsignedByte"></rdf:Description>
<rdf:Description rdf:about="&xsd;unsignedInt"></rdf:Description>
<rdf:Description rdf:about="&xsd;unsignedLong"></rdf:Description>
<rdf:Description rdf:about="&xsd;unsignedShort"></rdf:Description>
<rdf:Description rdf:about="&owl;rational"></rdf:Description>
<rdf:Description rdf:about="&owl;real"></rdf:Description>
</owl:unionOf>
</rdfs:Datatype>
</rdfs:range>
<skos:definition rdf:datatype="&xsd;string">The actual value of a magnitude.</skos:definition>
<skos:prefLabel rdf:datatype="&xsd;string">numeric value</skos:prefLabel>
</owl:DatatypeProperty>However, what is given to my python code when asking for the range attribute of the property class, is this:
[<class 'int'> | <class 'float'> | <class 'float'> | <class 'float'> | <class 'int'> | <class 'int'> | <class 'int'> | <class 'int'> | <class 'int'> | 'http://www.w3.org/2001/XMLSchema#nonPositiveInteger' | <class 'int'> | <class 'int'> | <class 'int'> | <class 'int'> | <class 'int'> | <class 'int'> | None | <class 'float'>]
There are three obvious problems:
- the distinction between the various different numeric types has been lost, and I don't know of a way to get it back (e.g. for export)
- for some reason it's given up on trying to convert
xsd:nonPositiveIntegerto a Python type, and has just left it as a plain IRI - it's lost
owl:rationalaltogether, replacing it withNone
Is there any way I would be able to get back the original information here once it had been loaded into owlready2 (e.g. if I wanted to re-export it)? Why are xsd:nonPositiveInteger and owl:rational being treated differently to the others?