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