1

concat在 SPARQL(Netbeans 中的 Servlet)中收到错误消息。你能建议任何解决这个问题的方法吗?

PREFIX table:<http://www.daltons.com#>
SELECT ?name
WHERE{
  ?Author table:hasFirstName ?FN. 
  ?Author table:hasLastName ?LN. 
  bind (concat(str(?FN),str(?LN)) as ?name) 
}

第 1 行第 132 列出现词汇错误。遇到:“(”(40),之后:“绑定”

4

1 回答 1

0
"PREFIX table:<http://www.example.com#>" 
+"SELECT " 
+ "(CONCAT(?FN, \" \",COALESCE(?MD,\"\"),\" \", ?LN) AS ?name)" 
+"WHERE{" 
+"?Author table:hasFirstName ?FN. " 
+"OPTIONAL{?Author table:hasMiddleName ?MD}." 
+"?Author table:hasLastName ?LN} "; 

Finally found the right answer with this code and used 2.8.8 version arq of jena . Thanks for your interest and suggestions.
于 2013-05-08T14:35:41.093 回答