From 4aade0469c4c6a07f2431c425c96647fdf85ce4b Mon Sep 17 00:00:00 2001 From: Nikolaos Karalis Date: Tue, 30 Apr 2024 15:58:38 +0200 Subject: [PATCH] added options for describe algorithms (#30) --- SparqlLexer.g4 | 4 ++++ SparqlParser.g4 | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SparqlLexer.g4 b/SparqlLexer.g4 index f03ee30..5b8659d 100644 --- a/SparqlLexer.g4 +++ b/SparqlLexer.g4 @@ -37,6 +37,10 @@ CARD_EST_REDUCTION_FACTOR: ('C'|'c')('A'|'a')('R'|'r')('D'|'d')'_'('E'|'e')('S'| CARD_EST_MIN_CARDINALITY: ('C'|'c')('A'|'a')('R'|'r')('D'|'d')'_'('E'|'e')('S'|'s')('T'|'t')'_'('M'|'m')('I'|'i')('N'|'n')'_' ('C'|'c')('A'|'a')('R'|'r')('D'|'d')('I'|'i')('N'|'n')('A'|'a')('L'|'l')('I'|'i')('T'|'t')('Y'|'y'); +CONCISE_BOUNDED_DESCRIPTION: ('C'|'c')('B'|'b')('D'|'d'); + +DESCRIBE_DIRECT: ('D'|'d')('I'|'i')('R'|'r')('E'|'e')('C'|'c')('T'|'t'); + BASE : ('B'|'b')('A'|'a')('S'|'s')('E'|'e'); PREFIX : ('P'|'p')('R'|'r')('E'|'e')('F'|'f')('I'|'i')('X'|'x'); diff --git a/SparqlParser.g4 b/SparqlParser.g4 index 25c0984..f1f0531 100644 --- a/SparqlParser.g4 +++ b/SparqlParser.g4 @@ -72,7 +72,7 @@ constructQuery ; describeQuery - : DESCRIBE (varOrIRI+ | '*') datasetClause* whereClause? solutionModifier + : DESCRIBE describeAlgorithm? (varOrIRI+ | '*') datasetClause* whereClause? solutionModifier ; askQuery @@ -95,6 +95,10 @@ cardinalityEstimation : Q_HINT_CARD_EST (CARD_EST_REDUCTION_FACTOR|CARD_EST_MIN_CARDINALITY) ; +// NOT PART OF THE OFFICIAL GRAMMAR (tentris specific) +describeAlgorithm + : (CONCISE_BOUNDED_DESCRIPTION|DESCRIBE_DIRECT) + ; varOrBlankNode : var | blankNode