2011-04-14 41 views
0
QUERY=" PREFIX table: <http://www.daml.org/2003/01/periodictable/PeriodicTable#> \n"+ 
      "SELECT ?name ?symbol ?weight ?number \n"+ 
      "FROM <http://www.daml.org/2003/01/periodictable/PeriodicTable.owl> \n" + 
      "WHERE \n" + 
      "{ \n"+ 
      "?uranium table:name \"uranium\". \n"+ 
      "?uranium table:atomicWeight ?uraniumWeight. \n"+ 
      "?element table:name ?name. \n"+ 
      "?element table:symbol ?symbol. \n" + 
      "?element table:atomicWeight ?weight. \n" + 
      "?element table:atomicNumber ?number. \n" + 
      "FILTER ?weight > ?uraniumWeight. \n" + 
      "} \n"+ 
      "ORDER BY ASC[?weight] "; 

我得到以下異常而查詢元素週期表本體異常異常而查詢本體

異常在線程「AWT-EventQueue的 - 0」 com.hp.hpl.jena.query.QueryParseException:遇到「 」第12行,列8 期待的一個「重?​​「: ... ... ...... 」存在「 ... 。

回答

1

您需要周圍的過濾器表達式的括號:

FILTER (?weight > ?uraniumWeight)