【问题标题】:Exception while Querying ontology查询本体时出现异常
【发布时间】:2011-08-05 10:01:11
【问题描述】:
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”。 期待其中之一: ... ... ... “存在”... .

【问题讨论】:

    标签: semantics sparql jena


    【解决方案1】:

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

    FILTER (?weight > ?uraniumWeight)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-30
      • 2017-08-06
      • 2015-05-30
      • 2012-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多