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 列遇到“?weight”。期待以下之一: ... ... ... “存在”……

4

1 回答 1

1

您需要在过滤器表达式周围加上括号:

FILTER (?weight > ?uraniumWeight)
于 2011-04-14T15:29:27.427 回答