查询本体时出现异常
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] ";
我在查询periodicTable本体时遇到以下异常异常
线程“AWT-EventQueue-0”com.hp.hpl.jena.query.QueryParseException中的异常:在行遇到“”?weight“” 12,第 8 栏。 期待其中之一: ... ... ... “存在”... 。
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] ";
I am getting the following Exception while querying the periodicTable ontology Exception
Exception in thread "AWT-EventQueue-0" com.hp.hpl.jena.query.QueryParseException: Encountered " "?weight "" at line 12, column 8.
Was expecting one of:
...
...
...
"exists" ...
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在过滤器表达式两边加上括号:
You need parentheses around the filter expression: