You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:DatatypePropertyrdf:about="&gist;numericValue">
<rdfs:domainrdf:resource="&gist;Magnitude"/>
<rdfs:isDefinedByrdf:resource="https://w3id.org/semanticarts/ontology/gistCore"/>
<rdfs:range>
<rdfs:Datatype>
<owl:unionOfrdf:parseType="Collection">
<rdf:Descriptionrdf:about="&xsd;byte"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;decimal"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;double"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;float"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;int"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;integer"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;long"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;negativeInteger"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;nonNegativeInteger"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;nonPositiveInteger"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;positiveInteger"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;short"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;unsignedByte"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;unsignedInt"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;unsignedLong"></rdf:Description>
<rdf:Descriptionrdf:about="&xsd;unsignedShort"></rdf:Description>
<rdf:Descriptionrdf:about="&owl;rational"></rdf:Description>
<rdf:Descriptionrdf:about="&owl;real"></rdf:Description>
</owl:unionOf>
</rdfs:Datatype>
</rdfs:range>
<skos:definitionrdf:datatype="&xsd;string">The actual value of a magnitude.</skos:definition>
<skos:prefLabelrdf: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:nonPositiveInteger to a Python type, and has just left it as a plain IRI
it's lost owl:rational altogether, replacing it with None
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?
The text was updated successfully, but these errors were encountered:
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: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:
xsd:nonPositiveInteger
to a Python type, and has just left it as a plain IRIowl:rational
altogether, 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 arexsd:nonPositiveInteger
andowl:rational
being treated differently to the others?The text was updated successfully, but these errors were encountered: