ProgramME
ProgramME

Reputation: 653

Exception while Querying ontology

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" ... .

Upvotes: 0

Views: 89

Answers (1)

Ian Dickinson
Ian Dickinson

Reputation: 13305

You need parentheses around the filter expression:

FILTER (?weight > ?uraniumWeight)

Upvotes: 1

Related Questions