【发布时间】:2015-07-15 18:13:00
【问题描述】:
我正在尝试运行一个使用 subClassOf 关系进行推理的示例。
由于某种原因,我在使用 xquery 时得到了选择查询结果,但在使用 sparql 时却没有。
xquery
>let $sq :=
'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT *
WHERE { ?s rdf:type <http://www.smartlogic.com/geography#Europe> .
} '
let $rs := sem:ruleset-store("rdfs.rules", sem:store())
return sem:sparql($sq, (), (), $rs)
sparql
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT *
WHERE { ?s rdf:type <http://www.smartlogic.com/geography#Europe> .
}
【问题讨论】:
-
我使用的三元组是: smartlogic.com/document#Credit_Suisse> w3.org/1999/02/22-rdf-syntax-ns#type> smartlogic.com/geo#London> 。 smartlogic.com/geo#London> w3.org/2000/01/rdf-schema#subClassOf> smartlogic.com/geo#Europe> .
标签: xquery sparql marklogic inference