如何解决查询本体时异常
|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] \";
查询periodTable本体异常时出现以下异常
线程\“ AWT-EventQueue-0 \” com.hp.hpl.jena.query.QueryParseException中的异常:在第12行第8列遇到了\“ \”?weight \“ \”
期望以下之一:
...
...
...
\“存在\” ...
。
解决方法
您需要在过滤器表达式周围加上括号:
FILTER (?weight > ?uraniumWeight)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。