2
OPTION(传递的)我有以下查询SPARQL查询错误与耶拿
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?type
WHERE
{
{
SELECT *
WHERE
{
?x rdfs:subClassOf ?type .
}
}
OPTION (TRANSITIVE, t_distinct, t_in (?x), t_out (?type)) .
FILTER (?x = <http://dbpedia.org/ontology/Hospital>)
}
当我把它发送到炫技点,但在我的耶拿例如不工作,它工作正常。在具体的我得到以下错误:
INFO [1] 400 Parse error:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?type
WHERE
{
{
SELECT *
WHERE
{
?x rdfs:subClassOf ?type .
}
}
OPTION (TRANSITIVE, t_distinct, t_in (?x), t_out (?type)) .
FILTER (?x = <http://dbpedia.org/ontology/Hospital>)
}
Lexical error at line 12, column 39. Encountered: " " (32), after : "OPTION" (17 ms)
在这种情况下,一个炫技特定的功能,我将不胜感激知道此查询会与*耶拿/标准SPARQL工作等效)。预期结果应该是:
http://dbpedia.org/ontology/Building
http://dbpedia.org/ontology/ArchitecturalStructure
http://dbpedia.org/ontology/Place
http://dbpedia.org/ontology/d0:Location
它代表了“医院”
如果使用耶拿发送带有炫技的特定功能的查询时,您需要将创建一个QueryEngineHTTP(这是一个QueryExecution),并提供只是2串,端点和查询字符串。否则,Jena在本地验证查询,但它不是有效的SPARQL,因此它失败。 – AndyS 2014-09-24 10:48:19
谢谢enridago和@AndyS。这个人[http://blog.pingoured.fr/index.php?post/2011/10/11/Jena%2C-virtuoso-and-option-transitive]声称使用QueryEngineHTTP为他工作。这就是为什么我把什么enridaga建议,但我知道它的Virtuoso具体。不幸的是,建议的代码没有为我运行,Fuseki扔回了相同的例外,所以我猜这符合你们两人的表现。有没有办法重写这个查询来与Jena一起工作? – alexandria 2014-09-24 11:11:11
你能编辑你的问题来描述你期望的结果吗?它仅仅是rdfs:subClassOf的传递性吗?如果是这种情况,则可以使用属性路径,即SPARQL 1.1功能。 – enridaga 2014-09-24 12:26:16