Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid column index from SPARQL

687900Nov 13 2009 — edited Nov 18 2009
I'm using the Jena Adaptor 2.0, with 11g R1, Jena 2.5.6, OJDBC6, to make a SPARQL query, and I'm getting a SQLException:

java.sql.SQLException: Invalid column index
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
at oracle.jdbc.driver.ORacleResultSetImpl.getString(OracleResultSetImpl.java:957)
...
at oracle.spatial.rdf.client.jena.ORacleSemIterator.getNodesFromResultSet(OracleSemIterator.java:410)
at oracle.spatial.rdf.client.jena.ORacleSemIterator.next(OracleSemIterator.java:315)
at com.hp.hpl.jena.sparql.engine.iterator.QueryIterBlockTriplesQH$StagePattern.moveToNextBinding(QueryIterBlockTriplesQH.java:104)
...

My SPARQL has this pattern (using p, p1, and p2 as shorthand for property URIs):

SELECT DISTINCT ?s
WHERE {
?s p t1 .
{ { ?s p1 ?t }
UNION
{ ?s p2 ?t .
OPTIONAL { ?s p1 ?t2 } .
FILTER(!bound(?t2)) }
}
}
ORDER BY DESC(?t)

The intent of this query is to get the ?s that match the first pattern, (?s p t1), then sort the results by the p1 value, and use the p2 value as the sort value for those that do not have a p1 value.

Any ideas why the Jena adapter throws this error?

Brian

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 16 2009
Added on Nov 13 2009
2 comments
2,984 views