Summary
Support compilation and materialization of RDF collection lists ((...)) and ensure blank node identifier freshness per solution mapping in CONSTRUCT templates.
Target Branch
Specification & Semantics
According to W3C SPARQL 1.1 Query (§16.2):
- RDF collection syntax
( ?s ?o ) inside a CONSTRUCT template must expand to standard rdf:first and rdf:rest chains terminating with rdf:nil. No additional rdf:type rdf:List triple is required.
- Blank nodes in a
CONSTRUCT template must generate fresh blank node identifiers for each solution mapping in the result sequence.
- Multiple occurrences of the same blank node label within a single template instance must refer to the same instantiated blank node for that solution, preserving internal graph reification structure.
- Note:
Basic - List 1 tests () inside a SELECT WHERE pattern, which is independent of CONSTRUCT template processing and is tracked separately.
Targeted W3C SPARQL 1.0 / 1.1 Test Cases
dawg-construct-reification-1 (Reification of default graph)
dawg-construct-reification-2 (Reification of default graph)
construct_list (CONSTRUCT { (?s ?o) :prop ?p } WHERE { ?s ?p ?o })
Technical Context & Points to Investigate
- In
CoreseAstQueryBuilder.java, examine compileConstructTemplate and how RDF collection AST nodes (ListPatternAst or equivalent) are compiled into the template Exp.
- In construct result materialization (
CoreseGraphQuery.java / ConstructTemplate), verify how blank node terms are allocated: fresh per solution mapping, while caching identity within the same solution mapping.
Acceptance Criteria
[ ] Unit test demonstrating blank node freshness across multiple solutions in a CONSTRUCT query.
[ ] Blank nodes generated in CONSTRUCT instantiate unique identifiers per solution row while preserving internal graph structure.
[ ] RDF collections in construct templates produce valid rdf:first / rdf:rest chains terminating in rdf:nil.
[ ] Targeted W3C construct reification and list tests pass.
[ ] 0 SonarLint issues and cognitive complexity < 15.
Summary
Support compilation and materialization of RDF collection lists (
(...)) and ensure blank node identifier freshness per solution mapping inCONSTRUCTtemplates.Target Branch
feature/corese-nextSpecification & Semantics
According to W3C SPARQL 1.1 Query (§16.2):
( ?s ?o )inside aCONSTRUCTtemplate must expand to standardrdf:firstandrdf:restchains terminating withrdf:nil. No additionalrdf:type rdf:Listtriple is required.CONSTRUCTtemplate must generate fresh blank node identifiers for each solution mapping in the result sequence.Basic - List 1tests()inside aSELECTWHERE pattern, which is independent ofCONSTRUCTtemplate processing and is tracked separately.Targeted W3C SPARQL 1.0 / 1.1 Test Cases
dawg-construct-reification-1(Reification of default graph)dawg-construct-reification-2(Reification of default graph)construct_list(CONSTRUCT { (?s ?o) :prop ?p } WHERE { ?s ?p ?o })Technical Context & Points to Investigate
CoreseAstQueryBuilder.java, examinecompileConstructTemplateand how RDF collection AST nodes (ListPatternAstor equivalent) are compiled into the templateExp.CoreseGraphQuery.java/ConstructTemplate), verify how blank node terms are allocated: fresh per solution mapping, while caching identity within the same solution mapping.Acceptance Criteria
[ ] Unit test demonstrating blank node freshness across multiple solutions in a
CONSTRUCTquery.[ ] Blank nodes generated in
CONSTRUCTinstantiate unique identifiers per solution row while preserving internal graph structure.[ ] RDF collections in construct templates produce valid
rdf:first/rdf:restchains terminating inrdf:nil.[ ] Targeted W3C construct reification and list tests pass.
[ ] 0 SonarLint issues and cognitive complexity < 15.