rdf4j icon indicating copy to clipboard operation
rdf4j copied to clipboard

Deprecate SPARQLQueryRenderer for removal

Open hmottestad opened this issue 1 year ago • 5 comments

The SPARQLQueryRenderer is incomplete and outputs incorrect results for common queries. There does not seem to be any documentation of what subset of the query language that is supported and there are no errors to indicate that the output is incomplete.

Examples

GROUP BY

Input

select (count(*) as ?cnt) (sample(?s) as ?sample)
where {
  ?s ?p ?o.
} group by ?o

Output

select ?cnt ?sample
where {
  ?s ?p ?o.
  ?s  bind( as ?cnt).
  bind(?s as ?sample).
}

Nested SELECT

Input

select * 
where {
  { 
    select ?s where {
      ?s ?p ?o
    } LIMIT 1
  }

  ?s a ?o. 
}

Output

select ?s ?o ?s
where {
  ?s ?p ?o.
  ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o.
}
limit 1

VALUES

Input

select * where {
  VALUES ?c {1 2 3}
  ?a <http://example.org/number> ?c
}

Output

select ?c ?a
where {
  ?a <http://example.org/number> ?c.
}

hmottestad avatar Oct 27 '22 09:10 hmottestad