In Turtle-RDF it is convenient to omit the datatype extension ^^xsd:string
for string literals. But when i try to do reasoning with StarDog, http://www.stardog.com/, only the individual :YYY
with the extension "green"^^xsd:string
is found to be a :GreenButton
@prefix : <http://stackoverflow.com/q/29075078/1281433#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:color a owl:DatatypeProperty ;
rdfs:range xsd:string ;
rdfs:domain :Button .
:XXX :color "green" .
:YYY :color "green"^^xsd:string .
:Button a rdfs:Class .
:GreenButton a rdfs:Class ;
owl:equivalentClass [ a owl:Restriction;
owl:onProperty :color ;
owl:hasValue "green"
] .
:TestButton a :GreenButton .
Reasoning result:
+-------------+----------+----------------------------------------------------+
| s | p | o |
+-------------+----------+----------------------------------------------------+
| :XXX | rdf:type | :Button |
| :YYY | rdf:type | :Button |
| :YYY | rdf:type | :GreenButton |
| :TestButton | rdf:type | :GreenButton |
| :TestButton | :color | "green"^^<http://www.w3.org/2001/XMLSchema#string> |
...
What is the best way to deal with it?
According to the docs:
Have you tried disabling strict-parsing and see what the effects are?
p.s. see Joshua's comment in the question. I am not advising to switch off strict parsing, but it may be the only option if dealing with arbitrary/external data that is sparsely typed (assuming it does resolve the issue).