是否可以在添加查询范围之外的信息时执行 SPARQL 构造?例如,我想在定义枚举信息时执行 SPARQL 构造,如下所示:
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
construct {
?s a skos:Concept
?s ex:index <enumeration starting from 1 -- this is just a sample>
}
where {
?s a skos:Concept
}
是否可以用纯 SPARQL 做类似的事情?有哪些选择?
* 附加信息 *
可能我没有清楚地解释我的问题,所以基本上我想实现以下目标(假设 ex:index 是有效的 datatypeProperty):
== 初始 RDF 三元组 ==
@prefix skos:<http://www.w3.org/2004/02/skos/core#>
@prefix ex: <http://example.org/> .
ex:abc rdf:type skos:Concept .
ex:def rdf:type skos:Concept .
...
ex:endOfSample rdf:type skos:Concept .
== SPARQL 更新执行后 RDF 三倍 ==
@prefix skos:<http://www.w3.org/2004/02/skos/core#>
@prefix ex: <http://example.org/> .
ex:abc rdf:type skos:Concept ;
ex:index 1 .
ex:def rdf:type skos:Concept ;
ex:index 2 .
...
ex:endOfSample rdf:type skos:Concept ;
ex:index <endOfSampleNumber> .