Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

w3c benchmark: incomplete query: functions/coalesce #5

Open
Rintarou opened this issue Jul 18, 2018 · 0 comments
Open

w3c benchmark: incomplete query: functions/coalesce #5

Rintarou opened this issue Jul 18, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@Rintarou
Copy link
Collaborator

Rintarou commented Jul 18, 2018

When running the query
functions/coalesce
from the w3c SPARQL 1.1 compliance benchmark

which has this exact form:

PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT
	(COALESCE(?x, -1) AS ?cx)     # error when ?x is unbound -> -1
	(COALESCE(?o/?x, -2) AS ?div) # error when ?x is unbound or zero -> -2
	(COALESCE(?z, -3) AS ?def)    # always unbound -> -3
	(COALESCE(?z) AS ?err)        # always an error -> unbound
WHERE {
	?s :p ?o .
	OPTIONAL {
		?s :q ?x
	}
}

we obtain the following response:

<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="cx"/>
    <variable name="div"/>
    <variable name="def"/>
    <variable name="err"/>
  </head>
  <results>
    <result>
      <binding name="cx">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">0</literal>
      </binding>
      <binding name="div">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-2</literal>
      </binding>
      <binding name="def">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-3</literal>
      </binding>
    </result>
    <result>
      <binding name="cx">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
      </binding>
      <binding name="div">
        <literal datatype="http://www.w3.org/2001/XMLSchema#decimal">0.0</literal>
      </binding>
      <binding name="def">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-3</literal>
      </binding>
    </result>
    <result>
      <binding name="cx">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">2</literal>
      </binding>
      <binding name="div">
        <literal datatype="http://www.w3.org/2001/XMLSchema#decimal">2.0</literal>
      </binding>
      <binding name="def">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-3</literal>
      </binding>
    </result>
  </results>
</sparql>

but this response is incomplete and misses the following result:

<result>
    <binding name="cx">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-1</literal>
    </binding>
    <binding name="div">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-2</literal>
    </binding>
    <binding name="def">
        <literal datatype="http://www.w3.org/2001/XMLSchema#integer">-3</literal>
    </binding>
</result>

It is yet unclear why this happens.

It is unlikely to be related to the underlying Jena codebase, as the query runs fine on the jena-hdt module.

attached is the Query, Results, and Expected files.
QRE.zip

@Rintarou Rintarou added the bug Something isn't working label Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant