是否可以将IRI转换为SPARQL中作为字符串的前缀形式
我需要执行是否可以将IRI转换为SPARQL中作为字符串的前缀形式,sparql,jena,Sparql,Jena,我需要执行CONSTRUCT查询,其中一个谓词值(即IRI)必须在结果中转换为前缀形式的字符串。比如说 TTL中的资源: @prefix sh: <http://www.w3.org/ns/shacl#> @prefix x: <somenamespace does not matter#> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#
CONSTRUCT
查询,其中一个谓词值(即IRI)必须在结果中转换为前缀形式的字符串。比如说
TTL中的资源:
@prefix sh: <http://www.w3.org/ns/shacl#>
@prefix x: <somenamespace does not matter#>
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
x:Test
sh:path rdfs:label
.
实际结果:
x:Test2 x:customPredicate <http://www.w3.org/2000/01/rdf-schema#label> .
可以使用普通SPARQL吗?或者我可能不得不使用某种自定义函数(使用ApacheJena)
x:Test2 x:customPredicate <http://www.w3.org/2000/01/rdf-schema#label> .
x:Test2 x:customPredicate "rdfs:label" .