^^xsd:string
Turtle-RDF では、文字列リテラルのデータ型拡張を省略すると便利です。しかし、StarDog http://www.stardog.com/:YYY
で推論しようとすると、拡張子を持つ個体だけ"green"^^xsd:string
が: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 .
推論結果:
+-------------+----------+----------------------------------------------------+
| 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> |
...
それに対処する最善の方法は何ですか?