Oracle Jena Adaptor Not Binding Variables Correctly

(Doc ID 1296816.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Spatial - Version: 10.2.0.1 and later   [Release: 10.2 and later ]
Information in this document applies to any platform.

Symptoms


Using the Jena API to execute SPARQL queries.
Getting some strange results.
The query results are bound to the wrong parameters for queries with the following pattern:


SELECT ?c ?pl ?literal
WHERE { <http://namespace/100164> <http://www.w3.org/2004/02/skos/core#hasTopConcept> ?c.
OPTIONAL{ ?c <http://www.w3.org/2008/05/skos-xl#prefLabel> ?pl. ?pl <http://www.w3.org/2008/05/skos-xl#literalForm> ?literal. FILTER(lang(?literal) = 'en'). }
}


When executing queries with this pattern:
• The concept uri is assigned/bounded to parameter 'pl' instead of parameter 'c'
• The prefLabel uri is assigned/bounded to parameter 'c' instead of parameter 'pl'

When we use the old Jena adaptor the boundings are correct.

In the logging I can see the following query results:

<domain 0:http://namespace/2180 1:http://namespace/209106 2:"party organisation"@en>
<domain 0:http://namespace/4436 1:http://namespace/209102 2:"political tendency"@en>
<domain 0:http://namespace/2258 1:http://namespace/209116 2:"political parties"@en>


With the new adapter, these results are correct but the bindings done afterwards are incorrect:
http://namespace/2180 is bound to parameter 'pl' but should be bound to 'c' while http://namespace/209106 is bound to parameter ‘c’ but should be bound to parameter 'pl'
http://namespace/4436 is bound to parameter 'pl' but should be bound to ‘c’ while http://namespace/209102 is bound to parameter ‘c’ but should be bound to parameter 'pl'
http://namespace/2258 is bound to parameter 'pl' but should be bound to ‘c’ while http://namespace/209116 is bound to parameter ‘c’ but should be bound to parameter 'pl'

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms