Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我在这个SPARQL查询中的错误在哪里? “@前缀xsd:”+ “选择?o?stringTest?boolTest”+ “其中{”+ “s?p?o。”+ “将(xsd:string(?o)绑定为?stringTest。”+ “绑定(xsd:boolean(?o)as?boolTest)”+ “}\n”;_Sparql_Semantic Web_Ontology - Fatal编程技术网

我在这个SPARQL查询中的错误在哪里? “@前缀xsd:”+ “选择?o?stringTest?boolTest”+ “其中{”+ “s?p?o。”+ “将(xsd:string(?o)绑定为?stringTest。”+ “绑定(xsd:boolean(?o)as?boolTest)”+ “}\n”;

我在这个SPARQL查询中的错误在哪里? “@前缀xsd:”+ “选择?o?stringTest?boolTest”+ “其中{”+ “s?p?o。”+ “将(xsd:string(?o)绑定为?stringTest。”+ “绑定(xsd:boolean(?o)as?boolTest)”+ “}\n”;,sparql,semantic-web,ontology,Sparql,Semantic Web,Ontology,我试图在Eclipse中使用Jena执行此操作,但我找不到我的错误。 这是一个非常简单的问题,我不知道我的错误是什么。有人能给我一些反馈吗 以下是SPARQL代码: "@PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> " + "SELECT ?o ?stringTest ?boolTest " + "where { "+ "?s ?p ?o . "+

我试图在Eclipse中使用Jena执行此操作,但我找不到我的错误。 这是一个非常简单的问题,我不知道我的错误是什么。有人能给我一些反馈吗

以下是SPARQL代码:

"@PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> " +
            "SELECT ?o ?stringTest ?boolTest " +
            "where { "+
            "?s ?p ?o . "+
            "BIND (xsd:string(?o) as ?stringTest). " +
            "BIND (xsd:boolean(?o) as ?boolTest) "+

            "}\n ";
@前缀xsd:
选择?o?stringTest?boolTest
何处{
?s?p?o。
绑定(xsd:string(?o)为stringTest)。
绑定(xsd:boolean(?o)as?boolTest)
}
这就是我得到的错误:

在第1行第1列遇到“@前缀”。 我期待的是: “\ufeff”。。。 “基地”。。。 “前缀”。。。 “选择”。。。 “描述”。。。 “构造”。。。 “问”


正如错误所说,SPARQL处理器在预期的
前缀处遇到了
@prefix

SPARQL 1.1语法使用
前缀
(无
@
符号)


Turtle 1.1语法使用
@PREFIX
(可追溯到SPARQL之前)或
PREFIX
(现在首选,因为它与SPARQL 1.1相协调)。

正如错误所述,SPARQL处理器在其预期的
PREFIX
位置遇到
@PREFIX

SPARQL 1.1语法使用
前缀
(无
@
符号)


Turtle 1.1语法使用
@前缀
(可追溯到SPARQL之前)或
前缀
(现在首选,因为它与SPARQL 1.1相协调)。

前缀开头不应该有“@”,它只是前缀。这似乎是唯一的问题。是的,这是唯一的问题。谢谢。@在turtle RDF语法中是“prefix”的可选前缀…也许这就是你的想法。前缀的开头不应该有“@”,它只是一个前缀。这似乎是唯一的问题。是的,这是唯一的问题。谢谢。@在turtle RDF语法中是“prefix”的可选前缀…也许这就是你的想法。
@PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
            SELECT ?o ?stringTest ?boolTest
            where { 
            ?s ?p ?o . 
            BIND (xsd:string(?o) as ?stringTest). 
            BIND (xsd:boolean(?o) as ?boolTest) 

            }