Next sparql/triples patterns bgp#275
Merged
abdessamad-abdoun merged 18 commits intoMar 4, 2026
Merged
Conversation
|
4d2c8ce to
2cf1377
Compare
|
2cf1377 to
04bed7f
Compare
|
MaillPierre
requested changes
Feb 26, 2026
|
|
MaillPierre
approved these changes
Mar 2, 2026
070e1e6 to
0117c55
Compare
|
0117c55 to
88c7161
Compare
|
abdessamad-abdoun
approved these changes
Mar 3, 2026
|
|
||
| /** | ||
| * if true stop the parsing and throw an exception | ||
| * @return |
|
|
||
| /** | ||
| * if true collect the error in a List | ||
| * @return |
| /** | ||
| * Returns collected errors as human-friendly strings. | ||
| * <p>Prefer {@link #getDiagnostics()} for structured access.</p> | ||
| * @return |
|
|
||
| /** | ||
| * Constructor | ||
| * @param kind |
Contributor
There was a problem hiding this comment.
'@param kind' tag description is missing
'@param severity' tag description is missing
'@param message' tag description is missing
'@param column' tag description is missing
'@param offendingText' tag description is missing
'@param source' tag description is missing
| * Abstract Syntax Tree (AST) representation of a SPARQL {@code ASK} query. | ||
| * ASK WHERE { pattern } returns a boolean. | ||
| * | ||
| * PREFIX foaf: <http://xmlns.com/foaf/0.1/> |
Contributor
There was a problem hiding this comment.
Link specified as plain text
| * Abstract Syntax Tree (AST) representation of a SPARQL {@code CONSTRUCT} query. | ||
| * CONSTRUCT { template } WHERE { pattern }. | ||
| * | ||
| * PREFIX foaf: <http://xmlns.com/foaf/0.1/> |
Contributor
There was a problem hiding this comment.
Link specified as plain text
| * Abstract Syntax Tree (AST) representation of a SPARQL {@code DESCRIBE} query. | ||
| * DESCRIBE (var|uri)* WHERE { pattern } or DESCRIBE (var|uri)*. | ||
| * | ||
| * DESCRIBE <http://example.org/> |
Contributor
There was a problem hiding this comment.
Link specified as plain text
| package fr.inria.corese.core.next.query.impl.sparql.bridge; | ||
|
|
||
| public class CoresePatternBuilder { | ||
| import fr.inria.corese.core.next.query.impl.sparql.ast.BgpAst; |
Contributor
There was a problem hiding this comment.
Unused import statement
| public class CoreseTermAdapter { | ||
|
|
||
| import fr.inria.corese.core.next.query.impl.sparql.ast.IriAst; | ||
| import fr.inria.corese.core.next.query.impl.sparql.ast.LiteralAst; |
Contributor
There was a problem hiding this comment.
Unused import statement
| package fr.inria.corese.core.next.query.impl.sparql; | ||
|
|
||
| public class CoreseQueryArtifactAdapter { | ||
| import fr.inria.corese.core.next.query.impl.sparql.ast.QueryAst; |
Contributor
There was a problem hiding this comment.
Unused import statement
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SPARQL NEXT : Triples patterns and Basic Graph Pattern :
We add
Overview of the code :
QueryAst).Parser
For the Parser we follow the pattern and implementation of the IO Parser i.e; parser, options, and listener.
QueryParserproduce aQueryAstfrom a String aReaderor anInputStream. We also have error handling.SparqlParserOptions
The Options are following the same builder pattern we can find in IO.
SparqlListener
The SparqlListener follow the delegate pattern we can find in the Turtle and Trig Listerners. This is the rules we support for the moment :
GroupGraphPattern,TriplesBlock,TriplesSameSubjectSparqlAstBuilder
The SparqlAstBuilder construct the AST form the listeners. It should produce a QueryAST
SparqlBgpFeature
feature of ANTLR that drive the builder for triple patterns and BGP.
AST
The AST are the Immutable representation of the query and the terms in the query. (equivalent of case class in scala)