Skip to content

Commit

Permalink
added options for describe algorithms (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaralis authored Apr 30, 2024
1 parent 939bc10 commit 4aade04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions SparqlLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 5 additions & 1 deletion SparqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ constructQuery
;

describeQuery
: DESCRIBE (varOrIRI+ | '*') datasetClause* whereClause? solutionModifier
: DESCRIBE describeAlgorithm? (varOrIRI+ | '*') datasetClause* whereClause? solutionModifier
;

askQuery
Expand All @@ -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
Expand Down

0 comments on commit 4aade04

Please sign in to comment.