我想使用 SPARQL 查询将空白节点转换为 URI。想象一下类似的事情:
_:N58f332639cbd46d6a5ec9410e5d875a7 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/WebSite> .
_:N3b2eed756126458582bba185ab0fdb0b <http://schema.org/name> "Chefkoch.de" .
_:N3b2eed756126458582bba185ab0fdb0b <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Organization> .
然后我想要一个这样的查询:
SELECT (func(?s) as ?s1) ?p ?o where {
?s ?p ?o
}
并且 func 应该转换某些 URI 中的空白节点。
我发现它是一个非常频繁的用例,但找不到解决方案....
删除{ ?主语 ?谓语 ?o.
}
插入{ ?newUri ?谓词 ?o .
}
哪里{选择*哪里{
?主语?谓语?o。
BIND(IRI(CONCAT(STR("https://domain.nl/resource"), "/", STRAFTER(STR(?subject), "_:"))) AS ?newUri)
过滤器(isBlank(?主题))
}
}
enter code here