0
这个例子不适用于我。sparql中的变量
$title = "Hamlet";
$q =' http://localhost/arc2-starter-pack/OL24929270M.rdf { http://openlibrary.org/books/OL24929270M http://purl.org/dc/terms/title ' . $title . ' };
这个例子不适用于我。sparql中的变量
$title = "Hamlet";
$q =' http://localhost/arc2-starter-pack/OL24929270M.rdf { http://openlibrary.org/books/OL24929270M http://purl.org/dc/terms/title ' . $title . ' };
你需要引号围绕你的字符串,例如。
$q =' http://localhost/arc2-starter-pack/OL24929270M.rdf { http://openlibrary.org/books/OL24929270M http://purl.org/dc/terms/title "' . $title . '" }';
否则,哈姆雷特这个词将出现在查询内部作为一个裸词,这将是一个语法错误。
但是请注意,你应该真的逃避$ title以保证安全。
定义“不工作” – jprofitt 2012-03-25 14:16:28
此代码从何而来?这不是语法正确的SPARQL查询。这应该是什么? – 2013-09-25 00:32:31