^^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> |
...
处理它的最佳方法是什么?