数据:
<untitled-ontology-5:OperationName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
Adhesive Curing
</untitled-ontology-5:OperationName>
Run Code Online (Sandbox Code Playgroud)
SPARQL查询:
PREFIX rdf:<http://wwww.semanticweb.org/ontologies/2012/7/9/untitled-ontology-5#>
SELECT ?object
WHERE { ?subject rdf:OperationName ?object .
}
Run Code Online (Sandbox Code Playgroud)
结果:
Adhesive Curing^^http://www.w3.org/2001/XMLSchema#string
Run Code Online (Sandbox Code Playgroud)
我的问题:
SPARQL查询的结果不是我想要的结果.正确的结果应该只包含没有URI部分的Literal/String.我想创建以下结果:
正确的结果:
Adhesive Curing
Run Code Online (Sandbox Code Playgroud)
Jee*_*tra 13
您需要使用该STR()函数来检索文字的词法标签:
查询:
SELECT (str(?object) as ?label)
WHERE { ?subject rdf:OperationName ?object . }
Run Code Online (Sandbox Code Playgroud)