You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2024/09/10 10:45:52 UTC
(jena) branch main updated (3143309c2e -> 0ad2f7b616)
This is an automated email from the ASF dual-hosted git repository.
andy pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
from 3143309c2e Clear-up same-term/same-value graphs for the Model API.
new b31068049a GH-2518: Adds support for SPARQL CDTs (lists and maps as literals) (#2501)
new 0ad2f7b616 GH-2518: Integrate CDTs into current development
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
jena-arq/Grammar/CDTs/.gitignore | 3 +
jena-arq/Grammar/CDTs/README | 11 +
jena-arq/Grammar/CDTs/cdt-literals | 65 +
jena-arq/Grammar/CDTs/cdt_literals.jj | 370 +++
jena-arq/Grammar/arq.jj | 55 +
jena-arq/Grammar/main.jj | 62 +
.../main/java/org/apache/jena/cdt/CDTFactory.java | 64 +
.../src/main/java/org/apache/jena/cdt/CDTKey.java | 66 +
.../CDTLiteralParseException.java} | 24 +-
.../org/apache/jena/cdt/CDTLiteralParserBase.java | 51 +
.../main/java/org/apache/jena/cdt/CDTValue.java | 144 +
.../org/apache/jena/cdt/CompositeDatatypeBase.java | 60 +
.../org/apache/jena/cdt/CompositeDatatypeList.java | 353 +++
.../org/apache/jena/cdt/CompositeDatatypeMap.java | 413 +++
.../org/apache/jena/cdt/ParserForCDTLiterals.java | 109 +
.../apache/jena/cdt/parser/CDTLiteralParser.java | 603 ++++
.../jena/cdt/parser/CDTLiteralParserConstants.java | 147 +
.../cdt/parser/CDTLiteralParserTokenManager.java | 1093 +++++++
.../sparql_11 => cdt/parser}/JavaCharStream.java | 101 +-
.../org/apache/jena/cdt/parser/ParseException.java | 213 ++
.../java/org/apache/jena/cdt/parser/Token.java | 150 +
.../org/apache/jena/cdt/parser/TokenMgrError.java | 167 +
.../src/main/java/org/apache/jena/query/ARQ.java | 7 +
.../main/java/org/apache/jena/riot/RDFParser.java | 2 +-
.../jena/riot/system/CDTAwareParserProfile.java | 136 +
.../java/org/apache/jena/riot/system/RiotLib.java | 4 +-
.../java/org/apache/jena/sparql/ARQConstants.java | 3 +
.../jena/sparql/algebra/AlgebraGenerator.java | 4 +
.../org/apache/jena/sparql/algebra/OpAsQuery.java | 9 +
.../org/apache/jena/sparql/algebra/OpVars.java | 21 +
.../org/apache/jena/sparql/algebra/OpVisitor.java | 1 +
.../apache/jena/sparql/algebra/OpVisitorBase.java | 2 +
.../jena/sparql/algebra/OpVisitorByType.java | 4 +
.../org/apache/jena/sparql/algebra/Transform.java | 1 +
.../apache/jena/sparql/algebra/TransformCopy.java | 2 +
.../jena/sparql/algebra/TransformSingle.java | 2 +
.../jena/sparql/algebra/TransformWrapper.java | 2 +
.../apache/jena/sparql/algebra/op/OpUnfold.java | 96 +
.../algebra/optimize/VariableUsageVisitor.java | 12 +
.../algebra/walker/ApplyTransformVisitor.java | 9 +
.../sparql/algebra/walker/OpVisitorByType.java | 5 +
.../algebra/walker/OpVisitorByTypeAndExpr.java | 6 +
.../jena/sparql/algebra/walker/WalkerVisitor.java | 9 +
.../sparql/engine/iterator/QueryIterUnfold.java | 342 +++
.../jena/sparql/engine/main/ExecutionDispatch.java | 7 +
.../apache/jena/sparql/engine/main/OpExecutor.java | 6 +
.../apache/jena/sparql/engine/main/VarFinder.java | 14 +-
.../apache/jena/sparql/engine/ref/Evaluator.java | 2 +
.../jena/sparql/engine/ref/EvaluatorDispatch.java | 7 +
.../jena/sparql/engine/ref/EvaluatorSimple.java | 8 +
.../org/apache/jena/sparql/expr/NodeValueCmp.java | 57 +-
.../org/apache/jena/sparql/expr/ValueSpace.java | 11 +
.../sparql/expr/aggregate/AccumulatorExpr.java | 2 +-
.../jena/sparql/expr/aggregate/AggFoldList.java | 279 ++
.../jena/sparql/expr/aggregate/AggFoldMap.java | 285 ++
.../jena/sparql/expr/aggregate/AggregatorBase.java | 3 +
.../sparql/expr/aggregate/AggregatorFactory.java | 10 +
.../apache/jena/sparql/function/ARQFunctions.java | 2 +
.../library/cdt/CDTLiteralFunctionUtils.java | 153 +
.../function/library/cdt/CDTLiteralFunctions.java | 43 +
.../sparql/function/library/cdt/ConcatFct.java | 61 +
.../sparql/function/library/cdt/ContainsFct.java | 52 +
.../function/library/cdt/ContainsKeyFct.java | 53 +
.../function/library/cdt/ContainsTermFct.java | 52 +
.../cdt/FunctionBase1List.java} | 27 +-
.../jena/sparql/function/library/cdt/GetFct.java | 102 +
.../jena/sparql/function/library/cdt/HeadFct.java | 46 +
.../jena/sparql/function/library/cdt/KeysFct.java | 46 +
.../jena/sparql/function/library/cdt/ListFct.java | 65 +
.../jena/sparql/function/library/cdt/MapFct.java | 102 +
.../jena/sparql/function/library/cdt/MergeFct.java | 48 +
.../jena/sparql/function/library/cdt/PutFct.java | 112 +
.../sparql/function/library/cdt/RemoveFct.java | 58 +
.../cdt/ReverseFct.java} | 36 +-
.../jena/sparql/function/library/cdt/SizeFct.java | 48 +
.../sparql/function/library/cdt/SubSeqFct.java | 101 +
.../cdt/TailFct.java} | 29 +-
.../apache/jena/sparql/lang/SyntaxVarScope.java | 17 +
.../org/apache/jena/sparql/lang/arq/ARQParser.java | 1651 ++++++----
.../apache/jena/sparql/lang/arq/ARQParserBase.java | 68 +-
.../jena/sparql/lang/arq/ARQParserConstants.java | 374 +--
.../sparql/lang/arq/ARQParserTokenManager.java | 1754 +++++------
.../jena/sparql/lang/sparql_11/JavaCharStream.java | 2 +-
.../jena/sparql/lang/sparql_12/JavaCharStream.java | 81 +-
.../jena/sparql/lang/sparql_12/SPARQLParser12.java | 1 +
.../lang/sparql_12/SPARQLParser12TokenManager.java | 93 +-
.../jena/sparql/serializer/FormatterElement.java | 12 +
.../main/java/org/apache/jena/sparql/sse/Tags.java | 1 +
.../apache/jena/sparql/sse/builders/BuilderOp.java | 15 +
.../apache/jena/sparql/sse/writers/WriterOp.java | 19 +
.../apache/jena/sparql/syntax/ElementUnfold.java | 76 +
.../apache/jena/sparql/syntax/ElementVisitor.java | 1 +
.../jena/sparql/syntax/ElementVisitorBase.java | 3 +
.../apache/jena/sparql/syntax/ElementWalker.java | 8 +
.../jena/sparql/syntax/PatternVarsVisitor.java | 7 +
.../ApplyElementTransformVisitor.java | 12 +
.../syntax/syntaxtransform/ElementTransform.java | 1 +
.../ElementTransformCleanGroupsOfOne.java | 1 +
.../syntaxtransform/ElementTransformCopyBase.java | 7 +
.../syntaxtransform/ElementTransformIdentity.java | 2 +
.../apache/jena/external/Scripts_SPARQLCDTs.java | 50 +
jena-arq/testing/README.txt | 3 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-01.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-02.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-03.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-04.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-05.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-06.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-07.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-08.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-09.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-11.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-12.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-13.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-14.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-15.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-16.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-17.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-18.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-21.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-22.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-23.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-24.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-25.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-26.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-27.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-28.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-01.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-01.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-02.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-02.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-03.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-03.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-04.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-04.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-05.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-05.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-06.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-06.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-07.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-07.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-08.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-08.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-09.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-09.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-10.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-10.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-11.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-11.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-12.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-12.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-13.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-13.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-14.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-14.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-15.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-15a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-15b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-16.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-16a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-16b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-17.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-17a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-17b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-18.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-18a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-18b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-19.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-19a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-19b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-21.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-21.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-22.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-22.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-23.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-23.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-24.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-24.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-25.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-25.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-26.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-26.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-27.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-27.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-28.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-28.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-29.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-29.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-30.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-30.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-31.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-31.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-32.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-32.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-41.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-42.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-43.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-44.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-45.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-46.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-47.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-48.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-49.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-50.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-51.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-52.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-01.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-01.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-02.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-02.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-03.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-03.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-04.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-04.ttl | 7 +
.../{RIOT/Parser => SPARQL-CDTs/bnodes}/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/bnodes/manifest.ttl | 749 +++++
jena-arq/testing/SPARQL-CDTs/bnodes/true.srx | 5 +
.../{RIOT/Parser => SPARQL-CDTs/fold}/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/fold/fold-list-01.rq | 11 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-02.rq | 11 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-03.rq | 15 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-04.rq | 21 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-05.rq | 24 +
.../SPARQL-CDTs/fold/fold-list-distinct-01.rq | 11 +
.../SPARQL-CDTs/fold/fold-list-distinct-02.rq | 18 +
.../SPARQL-CDTs/fold/fold-list-distinct-03.rq | 18 +
.../SPARQL-CDTs/fold/fold-list-distinct-04.rq | 21 +
.../SPARQL-CDTs/fold/fold-list-distinct-05.rq | 21 +
.../SPARQL-CDTs/fold/fold-list-distinct-06.rq | 21 +
.../SPARQL-CDTs/fold/fold-list-distinct-07.rq | 22 +
.../SPARQL-CDTs/fold/fold-list-distinct-08.rq | 22 +
.../fold/fold-list-distinct-orderby-01.rq | 31 +
.../fold/fold-list-distinct-orderby-02.rq | 22 +
.../fold/fold-list-distinct-orderby-03.rq | 40 +
.../SPARQL-CDTs/fold/fold-list-orderby-01.rq | 11 +
.../SPARQL-CDTs/fold/fold-list-orderby-02.rq | 11 +
.../SPARQL-CDTs/fold/fold-list-orderby-03.rq | 15 +
.../SPARQL-CDTs/fold/fold-list-orderby-04.rq | 18 +
.../SPARQL-CDTs/fold/fold-list-orderby-05.rq | 15 +
.../SPARQL-CDTs/fold/fold-list-orderby-06.rq | 16 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-01.rq | 11 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-02.rq | 15 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-03.rq | 19 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-04.rq | 15 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-05.rq | 19 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-06.rq | 15 +
.../SPARQL-CDTs/fold/fold-map-orderby-01.rq | 16 +
.../SPARQL-CDTs/fold/fold-map-orderby-02.rq | 16 +
jena-arq/testing/SPARQL-CDTs/fold/manifest.ttl | 354 +++
jena-arq/testing/SPARQL-CDTs/fold/true.srx | 5 +
.../SPARQL-CDTs/list-functions/concat-01.rq | 8 +
.../SPARQL-CDTs/list-functions/concat-02.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-03.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-04.rq | 9 +
.../SPARQL-CDTs/list-functions/concat-05.rq | 9 +
.../SPARQL-CDTs/list-functions/concat-06.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-07.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-08.rq | 8 +
.../SPARQL-CDTs/list-functions/concat-09.rq | 9 +
.../SPARQL-CDTs/list-functions/concat-10.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/concat-error-02.rq | 7 +
.../SPARQL-CDTs/list-functions/concat-null-01.rq | 14 +
.../SPARQL-CDTs/list-functions/contains-01.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-02.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-03.rq | 22 +
.../SPARQL-CDTs/list-functions/contains-04.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-05.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-06.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-07.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-08.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-09.rq | 12 +
.../SPARQL-CDTs/list-functions/contains-10.rq | 12 +
.../list-functions/contains-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-null-01.rq | 9 +
.../list-functions}/empty.ttl | 0
.../testing/SPARQL-CDTs/list-functions/get-01.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/get-02.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/get-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/get-04.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/get-05.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/get-06.rq | 11 +
.../testing/SPARQL-CDTs/list-functions/get-07.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/get-08.rq | 10 +
.../testing/SPARQL-CDTs/list-functions/get-09.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/get-10.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/get-11.rq | 12 +
.../testing/SPARQL-CDTs/list-functions/get-12.rq | 12 +
.../testing/SPARQL-CDTs/list-functions/get-13.rq | 12 +
.../SPARQL-CDTs/list-functions/get-error-01.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-02.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-03.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-04.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-05.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-06.rq | 7 +
.../SPARQL-CDTs/list-functions/get-null-01.rq | 7 +
.../SPARQL-CDTs/list-functions/get-null-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-01.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-04.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-05.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-06.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-07.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-08.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-09.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-10.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-11.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-12.rq | 11 +
.../SPARQL-CDTs/list-functions/head-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/head-null-01.rq | 7 +
.../SPARQL-CDTs/list-functions/head-null-02.rq | 7 +
.../list-functions/list-constructor-01.rq | 7 +
.../list-functions/list-constructor-02.rq | 8 +
.../list-functions/list-constructor-03.rq | 8 +
.../list-functions/list-constructor-04.rq | 8 +
.../list-functions/list-constructor-05.rq | 8 +
.../list-functions/list-constructor-06.rq | 8 +
.../list-functions/list-constructor-09.rq | 8 +
.../list-functions/list-constructor-10.rq | 8 +
.../list-functions/list-constructor-11.rq | 8 +
.../list-functions/list-constructor-12.rq | 12 +
.../list-functions/list-constructor-13.rq | 9 +
.../list-functions/list-constructor-14.rq | 8 +
.../list-functions/list-constructor-15.rq | 9 +
.../list-functions/list-constructor-16.rq | 12 +
.../list-functions/list-constructor-null-01.rq | 12 +
.../list-functions/list-constructor-null-02.rq | 12 +
.../SPARQL-CDTs/list-functions/list-equals-01.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-02.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-03.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-04.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-05.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-06.rq | 7 +
.../SPARQL-CDTs/list-functions/list-equals-07.rq | 7 +
.../SPARQL-CDTs/list-functions/list-equals-08.rq | 9 +
.../SPARQL-CDTs/list-functions/list-equals-09.rq | 8 +
.../list-functions/list-equals-null-01.rq | 7 +
.../list-functions/list-equals-null-02.rq | 7 +
.../list-functions/list-greater-equal-01.rq | 8 +
.../list-functions/list-greater-equal-02.rq | 8 +
.../list-functions/list-greater-equal-03.rq | 8 +
.../list-functions/list-greater-equal-04.rq | 8 +
.../list-functions/list-greater-equal-05.rq | 8 +
.../list-functions/list-greater-equal-06.rq | 8 +
.../list-functions/list-greater-equal-07.rq | 8 +
.../list-functions/list-greater-equal-08.rq | 8 +
.../list-functions/list-greater-equal-09.rq | 8 +
.../list-functions/list-greater-equal-10.rq | 8 +
.../list-functions/list-greater-equal-11.rq | 8 +
.../list-functions/list-greater-equal-12.rq | 8 +
.../list-functions/list-greater-equal-13.rq | 8 +
.../list-functions/list-greater-equal-14.rq | 8 +
.../list-functions/list-greater-equal-15.rq | 8 +
.../list-functions/list-greater-equal-16.rq | 8 +
.../list-functions/list-greater-equal-19.rq | 8 +
.../list-functions/list-greater-equal-20.rq | 8 +
.../list-functions/list-greater-equal-21.rq | 8 +
.../list-functions/list-greater-equal-22.rq | 8 +
.../list-functions/list-greater-equal-23.rq | 8 +
.../list-functions/list-greater-equal-24.rq | 8 +
.../list-functions/list-greater-equal-25.rq | 8 +
.../list-functions/list-greater-equal-26.rq | 8 +
.../list-functions/list-greater-equal-27.rq | 9 +
.../list-functions/list-greater-equal-28.rq | 7 +
.../list-functions/list-greater-equal-29.rq | 8 +
.../list-functions/list-greater-equal-31.rq | 8 +
.../list-functions/list-greater-equal-error-03.rq | 8 +
.../list-functions/list-greater-equal-error-04.rq | 8 +
.../list-functions/list-greater-equal-null-01.rq | 8 +
.../list-functions/list-greater-equal-null-02.rq | 8 +
.../list-functions/list-greater-equal-null-03.rq | 7 +
.../list-functions/list-greater-equal-null-04.rq | 11 +
.../list-functions/list-greater-equal-null-05.rq | 8 +
.../list-functions/list-greater-equal-null-06.rq | 9 +
.../list-functions/list-greater-than-01.rq | 8 +
.../list-functions/list-greater-than-02.rq | 8 +
.../list-functions/list-greater-than-03.rq | 8 +
.../list-functions/list-greater-than-04.rq | 8 +
.../list-functions/list-greater-than-05.rq | 8 +
.../list-functions/list-greater-than-06.rq | 8 +
.../list-functions/list-greater-than-07.rq | 8 +
.../list-functions/list-greater-than-08.rq | 8 +
.../list-functions/list-greater-than-09.rq | 8 +
.../list-functions/list-greater-than-10.rq | 8 +
.../list-functions/list-greater-than-11.rq | 8 +
.../list-functions/list-greater-than-12.rq | 8 +
.../list-functions/list-greater-than-13.rq | 8 +
.../list-functions/list-greater-than-14.rq | 8 +
.../list-functions/list-greater-than-15.rq | 8 +
.../list-functions/list-greater-than-16.rq | 8 +
.../list-functions/list-greater-than-19.rq | 8 +
.../list-functions/list-greater-than-20.rq | 8 +
.../list-functions/list-greater-than-21.rq | 8 +
.../list-functions/list-greater-than-22.rq | 8 +
.../list-functions/list-greater-than-23.rq | 8 +
.../list-functions/list-greater-than-24.rq | 8 +
.../list-functions/list-greater-than-25.rq | 8 +
.../list-functions/list-greater-than-26.rq | 8 +
.../list-functions/list-greater-than-27.rq | 9 +
.../list-functions/list-greater-than-28.rq | 7 +
.../list-functions/list-greater-than-29.rq | 8 +
.../list-functions/list-greater-than-31.rq | 8 +
.../list-functions/list-greater-than-error-03.rq | 8 +
.../list-functions/list-greater-than-error-04.rq | 8 +
.../list-functions/list-greater-than-null-01.rq | 8 +
.../list-functions/list-greater-than-null-02.rq | 8 +
.../list-functions/list-greater-than-null-03.rq | 9 +
.../list-functions/list-greater-than-null-04.rq | 11 +
.../list-functions/list-greater-than-null-05.rq | 8 +
.../list-functions/list-greater-than-null-06.rq | 9 +
.../list-functions/list-less-equal-01.rq | 8 +
.../list-functions/list-less-equal-02.rq | 8 +
.../list-functions/list-less-equal-03.rq | 8 +
.../list-functions/list-less-equal-04.rq | 8 +
.../list-functions/list-less-equal-05.rq | 8 +
.../list-functions/list-less-equal-06.rq | 8 +
.../list-functions/list-less-equal-07.rq | 8 +
.../list-functions/list-less-equal-08.rq | 8 +
.../list-functions/list-less-equal-09.rq | 8 +
.../list-functions/list-less-equal-10.rq | 8 +
.../list-functions/list-less-equal-11.rq | 8 +
.../list-functions/list-less-equal-12.rq | 8 +
.../list-functions/list-less-equal-13.rq | 8 +
.../list-functions/list-less-equal-14.rq | 8 +
.../list-functions/list-less-equal-15.rq | 8 +
.../list-functions/list-less-equal-16.rq | 8 +
.../list-functions/list-less-equal-19.rq | 8 +
.../list-functions/list-less-equal-20.rq | 8 +
.../list-functions/list-less-equal-21.rq | 8 +
.../list-functions/list-less-equal-22.rq | 8 +
.../list-functions/list-less-equal-23.rq | 8 +
.../list-functions/list-less-equal-24.rq | 8 +
.../list-functions/list-less-equal-25.rq | 8 +
.../list-functions/list-less-equal-26.rq | 8 +
.../list-functions/list-less-equal-27.rq | 9 +
.../list-functions/list-less-equal-28.rq | 7 +
.../list-functions/list-less-equal-29.rq | 8 +
.../list-functions/list-less-equal-31.rq | 8 +
.../list-functions/list-less-equal-error-03.rq | 8 +
.../list-functions/list-less-equal-error-04.rq | 8 +
.../list-functions/list-less-equal-null-01.rq | 8 +
.../list-functions/list-less-equal-null-02.rq | 8 +
.../list-functions/list-less-equal-null-03.rq | 9 +
.../list-functions/list-less-equal-null-04.rq | 11 +
.../list-functions/list-less-equal-null-05.rq | 8 +
.../list-functions/list-less-equal-null-06.rq | 9 +
.../list-functions/list-less-than-01.rq | 8 +
.../list-functions/list-less-than-02.rq | 8 +
.../list-functions/list-less-than-03.rq | 8 +
.../list-functions/list-less-than-04.rq | 8 +
.../list-functions/list-less-than-05.rq | 8 +
.../list-functions/list-less-than-06.rq | 8 +
.../list-functions/list-less-than-07.rq | 8 +
.../list-functions/list-less-than-08.rq | 8 +
.../list-functions/list-less-than-09.rq | 8 +
.../list-functions/list-less-than-10.rq | 8 +
.../list-functions/list-less-than-11.rq | 8 +
.../list-functions/list-less-than-12.rq | 8 +
.../list-functions/list-less-than-13.rq | 8 +
.../list-functions/list-less-than-14.rq | 8 +
.../list-functions/list-less-than-15.rq | 8 +
.../list-functions/list-less-than-16.rq | 8 +
.../list-functions/list-less-than-19.rq | 8 +
.../list-functions/list-less-than-20.rq | 8 +
.../list-functions/list-less-than-21.rq | 8 +
.../list-functions/list-less-than-22.rq | 8 +
.../list-functions/list-less-than-23.rq | 8 +
.../list-functions/list-less-than-24.rq | 8 +
.../list-functions/list-less-than-25.rq | 8 +
.../list-functions/list-less-than-26.rq | 8 +
.../list-functions/list-less-than-27.rq | 9 +
.../list-functions/list-less-than-28.rq | 7 +
.../list-functions/list-less-than-29.rq | 8 +
.../list-functions/list-less-than-31.rq | 8 +
.../list-functions/list-less-than-error-03.rq | 8 +
.../list-functions/list-less-than-error-04.rq | 8 +
.../list-functions/list-less-than-null-01.rq | 8 +
.../list-functions/list-less-than-null-02.rq | 8 +
.../list-functions/list-less-than-null-03.rq | 9 +
.../list-functions/list-less-than-null-04.rq | 11 +
.../list-functions/list-less-than-null-05.rq | 8 +
.../list-functions/list-less-than-null-06.rq | 9 +
.../SPARQL-CDTs/list-functions/manifest.ttl | 3226 ++++++++++++++++++++
.../SPARQL-CDTs/list-functions/reverse-01.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-02.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-03.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-04.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-05.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-06.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-07.rq | 9 +
.../SPARQL-CDTs/list-functions/reverse-08.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-09.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-10.rq | 9 +
.../SPARQL-CDTs/list-functions/reverse-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/sameterm-01.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-02.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-03.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-04.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-null-01.rq | 6 +
.../testing/SPARQL-CDTs/list-functions/size-01.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-04.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-05.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-06.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-07.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-08.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-09.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-10.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-11.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-12.rq | 7 +
.../SPARQL-CDTs/list-functions/size-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-01.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-02.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-03.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-04.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-05.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-06.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-07.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-08.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-09.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-10.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-11.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-12.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-13.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-error-02.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/tail-01.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/tail-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-04.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-05.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-06.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-07.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-08.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-09.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-10.rq | 7 +
.../SPARQL-CDTs/list-functions/tail-error-01.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/true.srx | 5 +
jena-arq/testing/SPARQL-CDTs/manifest-all.ttl | 16 +
.../SPARQL-CDTs/map-functions/containsKey-01.rq | 9 +
.../SPARQL-CDTs/map-functions/containsKey-02.rq | 9 +
.../SPARQL-CDTs/map-functions/containsKey-03.rq | 11 +
.../Parser => SPARQL-CDTs/map-functions}/empty.ttl | 0
.../testing/SPARQL-CDTs/map-functions/get-01.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/get-02.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/get-03.rq | 12 +
.../testing/SPARQL-CDTs/map-functions/get-04.rq | 12 +
.../SPARQL-CDTs/map-functions/get-error-01.rq | 8 +
.../SPARQL-CDTs/map-functions/get-null-01.rq | 8 +
.../testing/SPARQL-CDTs/map-functions/keys-01.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/keys-02.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/keys-03.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/manifest.ttl | 2081 +++++++++++++
.../map-functions/map-constructor-01.rq | 7 +
.../map-functions/map-constructor-02.rq | 7 +
.../map-functions/map-constructor-03.rq | 7 +
.../map-functions/map-constructor-04.rq | 7 +
.../map-functions/map-constructor-05.rq | 7 +
.../map-functions/map-constructor-06.rq | 7 +
.../map-functions/map-constructor-07.rq | 7 +
.../map-functions/map-constructor-08.rq | 7 +
.../map-functions/map-constructor-09.rq | 7 +
.../map-functions/map-constructor-10.rq | 15 +
.../map-functions/map-constructor-11.rq | 17 +
.../SPARQL-CDTs/map-functions/map-equals-01.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-02.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-03.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-04.rq | 7 +
.../SPARQL-CDTs/map-functions/map-equals-05.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-06.rq | 7 +
.../SPARQL-CDTs/map-functions/map-equals-07.rq | 7 +
.../SPARQL-CDTs/map-functions/map-equals-08.rq | 9 +
.../SPARQL-CDTs/map-functions/map-equals-09.rq | 8 +
.../map-functions/map-equals-null-01.rq | 9 +
.../map-functions/map-equals-null-02.rq | 9 +
.../map-functions/map-greater-equal-01.rq | 8 +
.../map-functions/map-greater-equal-02.rq | 8 +
.../map-functions/map-greater-equal-03.rq | 8 +
.../map-functions/map-greater-equal-04.rq | 8 +
.../map-functions/map-greater-equal-05.rq | 8 +
.../map-functions/map-greater-equal-06.rq | 8 +
.../map-functions/map-greater-equal-07.rq | 8 +
.../map-functions/map-greater-equal-08.rq | 8 +
.../map-functions/map-greater-equal-09.rq | 8 +
.../map-functions/map-greater-equal-10.rq | 8 +
.../map-functions/map-greater-equal-11.rq | 8 +
.../map-functions/map-greater-equal-12.rq | 8 +
.../map-functions/map-greater-equal-13.rq | 8 +
.../map-functions/map-greater-equal-14.rq | 8 +
.../map-functions/map-greater-equal-15.rq | 10 +
.../map-functions/map-greater-equal-16.rq | 10 +
.../map-functions/map-greater-equal-17.rq | 10 +
.../map-functions/map-greater-equal-18.rq | 10 +
.../map-functions/map-greater-equal-19.rq | 10 +
.../map-functions/map-greater-equal-20.rq | 10 +
.../map-functions/map-greater-equal-21.rq | 10 +
.../map-functions/map-greater-equal-error-01.rq | 10 +
.../map-functions/map-greater-equal-error-02.rq | 10 +
.../map-functions/map-greater-equal-null-01.rq | 7 +
.../map-functions/map-greater-equal-null-02.rq | 8 +
.../map-functions/map-greater-equal-null-03.rq | 9 +
.../map-functions/map-greater-equal-null-04.rq | 9 +
.../map-functions/map-greater-than-01.rq | 8 +
.../map-functions/map-greater-than-02.rq | 8 +
.../map-functions/map-greater-than-03.rq | 8 +
.../map-functions/map-greater-than-04.rq | 8 +
.../map-functions/map-greater-than-05.rq | 8 +
.../map-functions/map-greater-than-06.rq | 8 +
.../map-functions/map-greater-than-07.rq | 8 +
.../map-functions/map-greater-than-08.rq | 8 +
.../map-functions/map-greater-than-09.rq | 8 +
.../map-functions/map-greater-than-10.rq | 8 +
.../map-functions/map-greater-than-11.rq | 8 +
.../map-functions/map-greater-than-12.rq | 8 +
.../map-functions/map-greater-than-13.rq | 8 +
.../map-functions/map-greater-than-14.rq | 8 +
.../map-functions/map-greater-than-15.rq | 10 +
.../map-functions/map-greater-than-16.rq | 10 +
.../map-functions/map-greater-than-17.rq | 10 +
.../map-functions/map-greater-than-18.rq | 10 +
.../map-functions/map-greater-than-19.rq | 10 +
.../map-functions/map-greater-than-20.rq | 10 +
.../map-functions/map-greater-than-21.rq | 10 +
.../map-functions/map-greater-than-error-01.rq | 10 +
.../map-functions/map-greater-than-error-02.rq | 10 +
.../map-functions/map-greater-than-null-01.rq | 7 +
.../map-functions/map-greater-than-null-02.rq | 8 +
.../map-functions/map-greater-than-null-03.rq | 9 +
.../map-functions/map-greater-than-null-04.rq | 9 +
.../SPARQL-CDTs/map-functions/map-less-equal-01.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-02.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-03.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-04.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-05.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-06.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-07.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-08.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-09.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-10.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-11.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-12.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-13.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-14.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-15.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-16.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-17.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-18.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-19.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-20.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-21.rq | 10 +
.../map-functions/map-less-equal-error-01.rq | 10 +
.../map-functions/map-less-equal-error-02.rq | 10 +
.../map-functions/map-less-equal-null-01.rq | 7 +
.../map-functions/map-less-equal-null-02.rq | 8 +
.../map-functions/map-less-equal-null-03.rq | 9 +
.../map-functions/map-less-equal-null-04.rq | 9 +
.../SPARQL-CDTs/map-functions/map-less-than-01.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-02.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-03.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-04.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-05.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-06.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-07.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-08.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-09.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-10.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-11.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-12.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-13.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-14.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-15.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-16.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-17.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-18.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-19.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-20.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-21.rq | 10 +
.../map-functions/map-less-than-error-01.rq | 10 +
.../map-functions/map-less-than-error-02.rq | 10 +
.../map-functions/map-less-than-null-01.rq | 7 +
.../map-functions/map-less-than-null-02.rq | 8 +
.../map-functions/map-less-than-null-03.rq | 9 +
.../map-functions/map-less-than-null-04.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/merge-01.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-02.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-03.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-04.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-05.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-06.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-07.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-08.rq | 10 +
.../SPARQL-CDTs/map-functions/merge-null-01.rq | 18 +
.../SPARQL-CDTs/map-functions/merge-null-02.rq | 18 +
.../SPARQL-CDTs/map-functions/merge-null-03.rq | 14 +
.../SPARQL-CDTs/map-functions/merge-null-04.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/put-01.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-02.rq | 12 +
.../testing/SPARQL-CDTs/map-functions/put-03.rq | 12 +
.../testing/SPARQL-CDTs/map-functions/put-04.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-05.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-06.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-07.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-08.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-09.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-10.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-11.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-12.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/put-13.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-14.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-15.rq | 9 +
.../SPARQL-CDTs/map-functions/put-error-01.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-02.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-03.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-04.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-05.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/remove-01.rq | 11 +
.../testing/SPARQL-CDTs/map-functions/remove-02.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-03.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-04.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-05.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/remove-06.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/remove-07.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/remove-08.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-09.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-10.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-11.rq | 9 +
.../SPARQL-CDTs/map-functions/sameterm-01.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-02.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-03.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-04.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-05.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-null-01.rq | 6 +
.../testing/SPARQL-CDTs/map-functions/size-01.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-02.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-03.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-04.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-05.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/true.srx | 5 +
.../{RIOT/Parser => SPARQL-CDTs/orderby}/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/orderby/manifest.ttl | 291 ++
.../testing/SPARQL-CDTs/orderby/order-list-03.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-04.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-05.rq | 18 +
.../testing/SPARQL-CDTs/orderby/order-list-06.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-07.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-08.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-09.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-10.rq | 15 +
.../SPARQL-CDTs/orderby/order-list-null-01.rq | 15 +
.../SPARQL-CDTs/orderby/order-list-null-02.rq | 16 +
.../testing/SPARQL-CDTs/orderby/order-map-03.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-04.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-05.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-06.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-07.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-08.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-09.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-10.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-11.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-12.rq | 18 +
.../testing/SPARQL-CDTs/orderby/order-map-13.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-14.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-15.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-16.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-17.rq | 15 +
.../SPARQL-CDTs/orderby/order-map-null-01.rq | 15 +
.../SPARQL-CDTs/orderby/order-map-null-02.rq | 16 +
jena-arq/testing/SPARQL-CDTs/orderby/true.srx | 5 +
.../{RIOT/Parser => SPARQL-CDTs/unfold}/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/unfold/manifest.ttl | 483 +++
jena-arq/testing/SPARQL-CDTs/unfold/true.srx | 5 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-01.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-02.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-03.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-04.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-01.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-02.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-03.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-04.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-05.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-06.rq | 10 +
.../SPARQL-CDTs/unfold/unfold-list-1var-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-01.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-02.srj | 17 +
.../SPARQL-CDTs/unfold/unfold-list-1var-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-03.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-04.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-05.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-05.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-06.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-06.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-07.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-07.srj | 17 +
.../SPARQL-CDTs/unfold/unfold-list-1var-08.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-08.srj | 17 +
.../SPARQL-CDTs/unfold/unfold-list-1var-09.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-09.srj | 13 +
.../SPARQL-CDTs/unfold/unfold-list-1var-10.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-10.srj | 15 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-01.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-02.srj | 20 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-03.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-04.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-05.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-05.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-06.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-06.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-07.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-07.srj | 20 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-08.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-08.srj | 20 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-09.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-09.srj | 15 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-10.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-10.srj | 18 +
.../SPARQL-CDTs/unfold/unfold-map-1var-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-01.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-1var-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-02.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-1var-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-03.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-1var-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-04.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-01.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-02.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-03.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-04.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-05.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-05.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-06.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-06.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-07.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-07.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-08.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-08.srj | 15 +
.../org/apache/jena/graph/impl/LiteralLabel.java | 22 +
.../jena/graph/impl/LiteralLabelFactory.java | 15 +
.../rewriters/BuildElementVisitor.java | 8 +-
.../querybuilder/rewriters/ElementRewriter.java | 20 +-
.../arq/querybuilder/rewriters/OpRewriter.java | 8 +-
.../updatebuilder/QuadIteratorBuilder.java | 8 +-
.../jena/arq/querybuilder/WhereValidator.java | 8 +-
.../permissions/query/rewriter/OpRewriter.java | 13 +
855 files changed, 23678 insertions(+), 1858 deletions(-)
create mode 100644 jena-arq/Grammar/CDTs/.gitignore
create mode 100644 jena-arq/Grammar/CDTs/README
create mode 100755 jena-arq/Grammar/CDTs/cdt-literals
create mode 100644 jena-arq/Grammar/CDTs/cdt_literals.jj
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CDTFactory.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CDTKey.java
copy jena-arq/src/main/java/org/apache/jena/{sparql/function/ARQFunctions.java => cdt/CDTLiteralParseException.java} (58%)
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParserBase.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CDTValue.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeBase.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeList.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeMap.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserConstants.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java
copy jena-arq/src/main/java/org/apache/jena/{sparql/lang/sparql_11 => cdt/parser}/JavaCharStream.java (92%)
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldList.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldMap.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java
copy jena-arq/src/main/java/org/apache/jena/sparql/function/{ARQFunctions.java => library/cdt/FunctionBase1List.java} (58%)
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java
copy jena-arq/src/main/java/org/apache/jena/sparql/function/{ARQFunctions.java => library/cdt/ReverseFct.java} (52%)
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java
copy jena-arq/src/main/java/org/apache/jena/sparql/function/{ARQFunctions.java => library/cdt/TailFct.java} (58%)
create mode 100644 jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementUnfold.java
create mode 100644 jena-arq/src/test/java/org/apache/jena/external/Scripts_SPARQLCDTs.java
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-18.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-22.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-23.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-24.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-25.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-26.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-27.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-sparql-28.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-01.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-02.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-03.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-04.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-05.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-06.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-07.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-08.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-09.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-10.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-11.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-12.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-13.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-14.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-15a.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-15b.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-16a.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-16b.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-17a.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-17b.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-18.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-18a.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-18b.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-19a.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-19b.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-21.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-22.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-22.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-23.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-23.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-24.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-24.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-25.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-25.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-26.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-26.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-27.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-27.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-28.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-28.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-29.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-29.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-30.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-30.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-31.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-31.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-32.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-32.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-41.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-42.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-43.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-44.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-45.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-46.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-47.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-48.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-49.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-50.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-51.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-52.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-01.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-02.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-03.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/bnodes-turtle-sparql-04.ttl
copy jena-arq/testing/{RIOT/Parser => SPARQL-CDTs/bnodes}/empty.ttl (100%)
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/manifest.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/bnodes/true.srx
copy jena-arq/testing/{RIOT/Parser => SPARQL-CDTs/fold}/empty.ttl (100%)
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-orderby-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-orderby-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-distinct-orderby-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-orderby-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-orderby-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-orderby-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-orderby-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-orderby-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-list-orderby-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-orderby-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/fold-map-orderby-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/manifest.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/fold/true.srx
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/concat-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/contains-null-01.rq
copy jena-arq/testing/{RIOT/Parser => SPARQL-CDTs/list-functions}/empty.ttl (100%)
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-error-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-error-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-error-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-error-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/get-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/head-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-constructor-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-equals-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-22.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-23.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-24.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-25.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-26.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-27.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-28.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-29.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-31.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-error-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-error-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-null-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-equal-null-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-22.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-23.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-24.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-25.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-26.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-27.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-28.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-29.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-31.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-error-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-error-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-null-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-greater-than-null-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-22.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-23.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-24.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-25.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-26.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-27.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-28.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-29.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-31.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-error-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-error-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-null-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-equal-null-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-22.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-23.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-24.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-25.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-26.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-27.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-28.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-29.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-31.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-error-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-error-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-null-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/list-less-than-null-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/manifest.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/reverse-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/sameterm-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/sameterm-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/sameterm-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/sameterm-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/sameterm-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/size-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/subseq-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/tail-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/list-functions/true.srx
create mode 100644 jena-arq/testing/SPARQL-CDTs/manifest-all.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/containsKey-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/containsKey-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/containsKey-03.rq
copy jena-arq/testing/{RIOT/Parser => SPARQL-CDTs/map-functions}/empty.ttl (100%)
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/get-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/get-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/get-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/get-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/get-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/get-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/keys-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/keys-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/keys-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/manifest.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-constructor-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-equals-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-18.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-equal-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-18.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-greater-than-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-18.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-equal-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-18.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-19.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-20.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-21.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/map-less-than-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-null-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/merge-null-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-error-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-error-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-error-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-error-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/put-error-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/remove-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/sameterm-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/sameterm-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/sameterm-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/sameterm-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/sameterm-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/sameterm-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/size-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/size-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/size-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/size-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/size-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/map-functions/true.srx
copy jena-arq/testing/{RIOT/Parser => SPARQL-CDTs/orderby}/empty.ttl (100%)
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/manifest.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-list-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-11.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-12.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-13.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-14.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-15.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-16.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-17.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-null-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/order-map-null-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/orderby/true.srx
copy jena-arq/testing/{RIOT/Parser => SPARQL-CDTs/unfold}/empty.ttl (100%)
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/manifest.ttl
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/true.srx
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-1var-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-1var-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-1var-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-1var-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-2vars-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-2vars-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-2vars-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-2vars-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-2vars-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-get-list-2vars-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-01.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-02.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-03.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-04.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-05.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-06.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-07.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-08.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-09.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-1var-10.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-01.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-02.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-03.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-04.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-05.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-06.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-07.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-08.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-09.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-09.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-10.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-list-2vars-10.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-01.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-02.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-03.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-1var-04.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-01.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-01.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-02.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-02.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-03.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-03.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-04.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-04.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-05.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-05.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-06.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-06.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-07.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-07.srj
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-08.rq
create mode 100644 jena-arq/testing/SPARQL-CDTs/unfold/unfold-map-2vars-08.srj
(jena) 01/02: GH-2518: Adds support for SPARQL CDTs (lists and maps as literals) (#2501)
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit b31068049a6cf89566dd769c0d0590959baf15f4
Author: Olaf Hartig <oh...@amazon.com>
AuthorDate: Wed Aug 28 11:15:38 2024 +0200
GH-2518: Adds support for SPARQL CDTs (lists and maps as literals) (#2501)
---
jena-arq/Grammar/CDTs/cdt_literals.jj | 370 ++
jena-arq/Grammar/CDTs/generate | 65 +
jena-arq/Grammar/arq.jj | 56 +
jena-arq/Grammar/main.jj | 74 +
.../main/java/org/apache/jena/cdt/CDTFactory.java | 64 +
.../src/main/java/org/apache/jena/cdt/CDTKey.java | 66 +
.../CDTLiteralParseException.java} | 24 +-
.../org/apache/jena/cdt/CDTLiteralParserBase.java | 51 +
.../main/java/org/apache/jena/cdt/CDTValue.java | 144 +
.../org/apache/jena/cdt/CompositeDatatypeBase.java | 60 +
.../org/apache/jena/cdt/CompositeDatatypeList.java | 353 ++
.../org/apache/jena/cdt/CompositeDatatypeMap.java | 413 ++
.../org/apache/jena/cdt/ParserForCDTLiterals.java | 115 +
.../apache/jena/cdt/parser/CDTLiteralParser.java | 560 ++
.../jena/cdt/parser/CDTLiteralParserConstants.java | 147 +
.../cdt/parser/CDTLiteralParserTokenManager.java | 1045 ++++
.../sparql_11 => cdt/parser}/JavaCharStream.java | 240 +-
.../lang/arq => cdt/parser}/ParseException.java | 68 +-
.../{sparql/lang/arq => cdt/parser}/Token.java | 27 +-
.../lang/arq => cdt/parser}/TokenMgrError.java | 56 +-
.../src/main/java/org/apache/jena/query/ARQ.java | 7 +
.../main/java/org/apache/jena/riot/RDFParser.java | 2 +-
.../jena/riot/system/CDTAwareParserProfile.java | 132 +
.../java/org/apache/jena/riot/system/RiotLib.java | 4 +-
.../java/org/apache/jena/sparql/ARQConstants.java | 3 +
.../jena/sparql/algebra/AlgebraGenerator.java | 4 +
.../org/apache/jena/sparql/algebra/OpAsQuery.java | 9 +
.../org/apache/jena/sparql/algebra/OpVars.java | 21 +
.../org/apache/jena/sparql/algebra/OpVisitor.java | 1 +
.../apache/jena/sparql/algebra/OpVisitorBase.java | 2 +
.../jena/sparql/algebra/OpVisitorByType.java | 4 +
.../org/apache/jena/sparql/algebra/Transform.java | 1 +
.../apache/jena/sparql/algebra/TransformCopy.java | 2 +
.../jena/sparql/algebra/TransformSingle.java | 2 +
.../jena/sparql/algebra/TransformWrapper.java | 2 +
.../apache/jena/sparql/algebra/op/OpUnfold.java | 102 +
.../algebra/optimize/VariableUsageVisitor.java | 12 +
.../algebra/walker/ApplyTransformVisitor.java | 9 +
.../sparql/algebra/walker/OpVisitorByType.java | 5 +
.../algebra/walker/OpVisitorByTypeAndExpr.java | 6 +
.../jena/sparql/algebra/walker/WalkerVisitor.java | 9 +
.../sparql/engine/iterator/QueryIterUnfold.java | 346 ++
.../jena/sparql/engine/main/ExecutionDispatch.java | 7 +
.../apache/jena/sparql/engine/main/OpExecutor.java | 6 +
.../apache/jena/sparql/engine/main/VarFinder.java | 14 +-
.../apache/jena/sparql/engine/ref/Evaluator.java | 2 +
.../jena/sparql/engine/ref/EvaluatorDispatch.java | 7 +
.../jena/sparql/engine/ref/EvaluatorSimple.java | 8 +
.../org/apache/jena/sparql/expr/NodeValueCmp.java | 57 +-
.../org/apache/jena/sparql/expr/ValueSpace.java | 11 +
.../sparql/expr/aggregate/AccumulatorExpr.java | 2 +-
.../jena/sparql/expr/aggregate/AggFoldList.java | 279 +
.../jena/sparql/expr/aggregate/AggFoldMap.java | 285 +
.../jena/sparql/expr/aggregate/AggregatorBase.java | 3 +
.../sparql/expr/aggregate/AggregatorFactory.java | 10 +
.../apache/jena/sparql/function/ARQFunctions.java | 2 +
.../library/cdt/CDTLiteralFunctionUtils.java | 153 +
.../function/library/cdt/CDTLiteralFunctions.java | 43 +
.../sparql/function/library/cdt/ConcatFct.java | 61 +
.../sparql/function/library/cdt/ContainsFct.java | 52 +
.../function/library/cdt/ContainsKeyFct.java | 53 +
.../function/library/cdt/ContainsTermFct.java | 52 +
.../cdt/FunctionBase1List.java} | 29 +-
.../jena/sparql/function/library/cdt/GetFct.java | 102 +
.../cdt/HeadFct.java} | 39 +-
.../cdt/KeysFct.java} | 39 +-
.../jena/sparql/function/library/cdt/ListFct.java | 65 +
.../jena/sparql/function/library/cdt/MapFct.java | 102 +
.../cdt/MergeFct.java} | 41 +-
.../jena/sparql/function/library/cdt/PutFct.java | 112 +
.../sparql/function/library/cdt/RemoveFct.java | 58 +
.../cdt/ReverseFct.java} | 38 +-
.../jena/sparql/function/library/cdt/SizeFct.java | 48 +
.../sparql/function/library/cdt/SubSeqFct.java | 101 +
.../cdt/TailFct.java} | 31 +-
.../apache/jena/sparql/lang/SyntaxVarScope.java | 17 +
.../org/apache/jena/sparql/lang/arq/ARQParser.java | 5775 ++++++++++----------
.../apache/jena/sparql/lang/arq/ARQParserBase.java | 52 +
.../jena/sparql/lang/arq/ARQParserConstants.java | 374 +-
.../sparql/lang/arq/ARQParserTokenManager.java | 2514 +++++----
.../jena/sparql/lang/arq/ParseException.java | 48 +-
.../jena/sparql/lang/arq/SimpleCharStream.java | 21 +-
.../org/apache/jena/sparql/lang/arq/Token.java | 7 +-
.../apache/jena/sparql/lang/arq/TokenMgrError.java | 36 +-
.../jena/sparql/lang/sparql_11/JavaCharStream.java | 2 +-
.../jena/sparql/serializer/FormatterElement.java | 12 +
.../main/java/org/apache/jena/sparql/sse/Tags.java | 1 +
.../apache/jena/sparql/sse/writers/WriterOp.java | 19 +
.../apache/jena/sparql/syntax/ElementUnfold.java | 85 +
.../apache/jena/sparql/syntax/ElementVisitor.java | 1 +
.../jena/sparql/syntax/ElementVisitorBase.java | 3 +
.../apache/jena/sparql/syntax/ElementWalker.java | 8 +
.../jena/sparql/syntax/PatternVarsVisitor.java | 7 +
.../ApplyElementTransformVisitor.java | 12 +
.../syntax/syntaxtransform/ElementTransform.java | 1 +
.../ElementTransformCleanGroupsOfOne.java | 1 +
.../syntaxtransform/ElementTransformCopyBase.java | 7 +
.../syntaxtransform/ElementTransformIdentity.java | 2 +
.../apache/jena/external/Scripts_SPARQLCDTs.java} | 29 +-
jena-arq/testing/README.txt | 3 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-01.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-02.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-03.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-04.rq | 13 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-05.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-06.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-07.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-08.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-09.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-11.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-12.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-13.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-14.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-15.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-16.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-17.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-18.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-21.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-22.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-23.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-24.rq | 14 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-25.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-26.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-27.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-sparql-28.rq | 15 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-01.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-01.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-02.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-02.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-03.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-03.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-04.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-04.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-05.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-05.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-06.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-06.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-07.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-07.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-08.rq | 12 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-08.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-09.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-09.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-10.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-10.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-11.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-11.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-12.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-12.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-13.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-13.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-14.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-14.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-15.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-15a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-15b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-16.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-16a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-16b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-17.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-17a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-17b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-18.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-18a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-18b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-19.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-19a.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-19b.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-21.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-21.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-22.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-22.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-23.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-23.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-24.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-24.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-25.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-25.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-26.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-26.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-27.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-27.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-28.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-28.ttl | 7 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-29.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-29.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-30.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-30.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-31.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-31.ttl | 8 +
.../testing/SPARQL-CDTs/bnodes/bnodes-turtle-32.rq | 15 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-32.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-41.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-42.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-43.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-44.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-45.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-46.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-47.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-48.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-49.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-50.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-51.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-52.ttl | 8 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-01.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-01.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-02.rq | 14 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-02.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-03.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-03.ttl | 7 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-04.rq | 13 +
.../SPARQL-CDTs/bnodes/bnodes-turtle-sparql-04.ttl | 7 +
jena-arq/testing/SPARQL-CDTs/bnodes/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/bnodes/manifest.ttl | 749 +++
jena-arq/testing/SPARQL-CDTs/bnodes/true.srx | 5 +
jena-arq/testing/SPARQL-CDTs/fold/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/fold/fold-list-01.rq | 11 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-02.rq | 11 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-03.rq | 15 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-04.rq | 21 +
jena-arq/testing/SPARQL-CDTs/fold/fold-list-05.rq | 24 +
.../SPARQL-CDTs/fold/fold-list-distinct-01.rq | 11 +
.../SPARQL-CDTs/fold/fold-list-distinct-02.rq | 18 +
.../SPARQL-CDTs/fold/fold-list-distinct-03.rq | 18 +
.../SPARQL-CDTs/fold/fold-list-distinct-04.rq | 21 +
.../SPARQL-CDTs/fold/fold-list-distinct-05.rq | 21 +
.../SPARQL-CDTs/fold/fold-list-distinct-06.rq | 21 +
.../SPARQL-CDTs/fold/fold-list-distinct-07.rq | 22 +
.../SPARQL-CDTs/fold/fold-list-distinct-08.rq | 22 +
.../fold/fold-list-distinct-orderby-01.rq | 31 +
.../fold/fold-list-distinct-orderby-02.rq | 22 +
.../fold/fold-list-distinct-orderby-03.rq | 40 +
.../SPARQL-CDTs/fold/fold-list-orderby-01.rq | 11 +
.../SPARQL-CDTs/fold/fold-list-orderby-02.rq | 11 +
.../SPARQL-CDTs/fold/fold-list-orderby-03.rq | 15 +
.../SPARQL-CDTs/fold/fold-list-orderby-04.rq | 18 +
.../SPARQL-CDTs/fold/fold-list-orderby-05.rq | 15 +
.../SPARQL-CDTs/fold/fold-list-orderby-06.rq | 16 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-01.rq | 11 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-02.rq | 15 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-03.rq | 19 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-04.rq | 15 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-05.rq | 19 +
jena-arq/testing/SPARQL-CDTs/fold/fold-map-06.rq | 15 +
.../SPARQL-CDTs/fold/fold-map-orderby-01.rq | 16 +
.../SPARQL-CDTs/fold/fold-map-orderby-02.rq | 16 +
jena-arq/testing/SPARQL-CDTs/fold/manifest.ttl | 354 ++
jena-arq/testing/SPARQL-CDTs/fold/true.srx | 5 +
.../SPARQL-CDTs/list-functions/concat-01.rq | 8 +
.../SPARQL-CDTs/list-functions/concat-02.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-03.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-04.rq | 9 +
.../SPARQL-CDTs/list-functions/concat-05.rq | 9 +
.../SPARQL-CDTs/list-functions/concat-06.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-07.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-08.rq | 8 +
.../SPARQL-CDTs/list-functions/concat-09.rq | 9 +
.../SPARQL-CDTs/list-functions/concat-10.rq | 10 +
.../SPARQL-CDTs/list-functions/concat-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/concat-error-02.rq | 7 +
.../SPARQL-CDTs/list-functions/concat-null-01.rq | 14 +
.../SPARQL-CDTs/list-functions/contains-01.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-02.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-03.rq | 22 +
.../SPARQL-CDTs/list-functions/contains-04.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-05.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-06.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-07.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-08.rq | 11 +
.../SPARQL-CDTs/list-functions/contains-09.rq | 12 +
.../SPARQL-CDTs/list-functions/contains-10.rq | 12 +
.../list-functions/contains-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/contains-null-01.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/empty.ttl | 0
.../testing/SPARQL-CDTs/list-functions/get-01.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/get-02.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/get-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/get-04.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/get-05.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/get-06.rq | 11 +
.../testing/SPARQL-CDTs/list-functions/get-07.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/get-08.rq | 10 +
.../testing/SPARQL-CDTs/list-functions/get-09.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/get-10.rq | 9 +
.../testing/SPARQL-CDTs/list-functions/get-11.rq | 12 +
.../testing/SPARQL-CDTs/list-functions/get-12.rq | 12 +
.../testing/SPARQL-CDTs/list-functions/get-13.rq | 12 +
.../SPARQL-CDTs/list-functions/get-error-01.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-02.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-03.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-04.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-05.rq | 7 +
.../SPARQL-CDTs/list-functions/get-error-06.rq | 7 +
.../SPARQL-CDTs/list-functions/get-null-01.rq | 7 +
.../SPARQL-CDTs/list-functions/get-null-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-01.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-04.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-05.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-06.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-07.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-08.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-09.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/head-10.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-11.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/head-12.rq | 11 +
.../SPARQL-CDTs/list-functions/head-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/head-null-01.rq | 7 +
.../SPARQL-CDTs/list-functions/head-null-02.rq | 7 +
.../list-functions/list-constructor-01.rq | 7 +
.../list-functions/list-constructor-02.rq | 8 +
.../list-functions/list-constructor-03.rq | 8 +
.../list-functions/list-constructor-04.rq | 8 +
.../list-functions/list-constructor-05.rq | 8 +
.../list-functions/list-constructor-06.rq | 8 +
.../list-functions/list-constructor-09.rq | 8 +
.../list-functions/list-constructor-10.rq | 8 +
.../list-functions/list-constructor-11.rq | 8 +
.../list-functions/list-constructor-12.rq | 12 +
.../list-functions/list-constructor-13.rq | 9 +
.../list-functions/list-constructor-14.rq | 8 +
.../list-functions/list-constructor-15.rq | 9 +
.../list-functions/list-constructor-16.rq | 12 +
.../list-functions/list-constructor-null-01.rq | 12 +
.../list-functions/list-constructor-null-02.rq | 12 +
.../SPARQL-CDTs/list-functions/list-equals-01.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-02.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-03.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-04.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-05.rq | 6 +
.../SPARQL-CDTs/list-functions/list-equals-06.rq | 7 +
.../SPARQL-CDTs/list-functions/list-equals-07.rq | 7 +
.../SPARQL-CDTs/list-functions/list-equals-08.rq | 9 +
.../SPARQL-CDTs/list-functions/list-equals-09.rq | 8 +
.../list-functions/list-equals-null-01.rq | 7 +
.../list-functions/list-equals-null-02.rq | 7 +
.../list-functions/list-greater-equal-01.rq | 8 +
.../list-functions/list-greater-equal-02.rq | 8 +
.../list-functions/list-greater-equal-03.rq | 8 +
.../list-functions/list-greater-equal-04.rq | 8 +
.../list-functions/list-greater-equal-05.rq | 8 +
.../list-functions/list-greater-equal-06.rq | 8 +
.../list-functions/list-greater-equal-07.rq | 8 +
.../list-functions/list-greater-equal-08.rq | 8 +
.../list-functions/list-greater-equal-09.rq | 8 +
.../list-functions/list-greater-equal-10.rq | 8 +
.../list-functions/list-greater-equal-11.rq | 8 +
.../list-functions/list-greater-equal-12.rq | 8 +
.../list-functions/list-greater-equal-13.rq | 8 +
.../list-functions/list-greater-equal-14.rq | 8 +
.../list-functions/list-greater-equal-15.rq | 8 +
.../list-functions/list-greater-equal-16.rq | 8 +
.../list-functions/list-greater-equal-19.rq | 8 +
.../list-functions/list-greater-equal-20.rq | 8 +
.../list-functions/list-greater-equal-21.rq | 8 +
.../list-functions/list-greater-equal-22.rq | 8 +
.../list-functions/list-greater-equal-23.rq | 8 +
.../list-functions/list-greater-equal-24.rq | 8 +
.../list-functions/list-greater-equal-25.rq | 8 +
.../list-functions/list-greater-equal-26.rq | 8 +
.../list-functions/list-greater-equal-27.rq | 9 +
.../list-functions/list-greater-equal-28.rq | 7 +
.../list-functions/list-greater-equal-29.rq | 8 +
.../list-functions/list-greater-equal-31.rq | 8 +
.../list-functions/list-greater-equal-error-03.rq | 8 +
.../list-functions/list-greater-equal-error-04.rq | 8 +
.../list-functions/list-greater-equal-null-01.rq | 8 +
.../list-functions/list-greater-equal-null-02.rq | 8 +
.../list-functions/list-greater-equal-null-03.rq | 7 +
.../list-functions/list-greater-equal-null-04.rq | 11 +
.../list-functions/list-greater-equal-null-05.rq | 8 +
.../list-functions/list-greater-equal-null-06.rq | 9 +
.../list-functions/list-greater-than-01.rq | 8 +
.../list-functions/list-greater-than-02.rq | 8 +
.../list-functions/list-greater-than-03.rq | 8 +
.../list-functions/list-greater-than-04.rq | 8 +
.../list-functions/list-greater-than-05.rq | 8 +
.../list-functions/list-greater-than-06.rq | 8 +
.../list-functions/list-greater-than-07.rq | 8 +
.../list-functions/list-greater-than-08.rq | 8 +
.../list-functions/list-greater-than-09.rq | 8 +
.../list-functions/list-greater-than-10.rq | 8 +
.../list-functions/list-greater-than-11.rq | 8 +
.../list-functions/list-greater-than-12.rq | 8 +
.../list-functions/list-greater-than-13.rq | 8 +
.../list-functions/list-greater-than-14.rq | 8 +
.../list-functions/list-greater-than-15.rq | 8 +
.../list-functions/list-greater-than-16.rq | 8 +
.../list-functions/list-greater-than-19.rq | 8 +
.../list-functions/list-greater-than-20.rq | 8 +
.../list-functions/list-greater-than-21.rq | 8 +
.../list-functions/list-greater-than-22.rq | 8 +
.../list-functions/list-greater-than-23.rq | 8 +
.../list-functions/list-greater-than-24.rq | 8 +
.../list-functions/list-greater-than-25.rq | 8 +
.../list-functions/list-greater-than-26.rq | 8 +
.../list-functions/list-greater-than-27.rq | 9 +
.../list-functions/list-greater-than-28.rq | 7 +
.../list-functions/list-greater-than-29.rq | 8 +
.../list-functions/list-greater-than-31.rq | 8 +
.../list-functions/list-greater-than-error-03.rq | 8 +
.../list-functions/list-greater-than-error-04.rq | 8 +
.../list-functions/list-greater-than-null-01.rq | 8 +
.../list-functions/list-greater-than-null-02.rq | 8 +
.../list-functions/list-greater-than-null-03.rq | 9 +
.../list-functions/list-greater-than-null-04.rq | 11 +
.../list-functions/list-greater-than-null-05.rq | 8 +
.../list-functions/list-greater-than-null-06.rq | 9 +
.../list-functions/list-less-equal-01.rq | 8 +
.../list-functions/list-less-equal-02.rq | 8 +
.../list-functions/list-less-equal-03.rq | 8 +
.../list-functions/list-less-equal-04.rq | 8 +
.../list-functions/list-less-equal-05.rq | 8 +
.../list-functions/list-less-equal-06.rq | 8 +
.../list-functions/list-less-equal-07.rq | 8 +
.../list-functions/list-less-equal-08.rq | 8 +
.../list-functions/list-less-equal-09.rq | 8 +
.../list-functions/list-less-equal-10.rq | 8 +
.../list-functions/list-less-equal-11.rq | 8 +
.../list-functions/list-less-equal-12.rq | 8 +
.../list-functions/list-less-equal-13.rq | 8 +
.../list-functions/list-less-equal-14.rq | 8 +
.../list-functions/list-less-equal-15.rq | 8 +
.../list-functions/list-less-equal-16.rq | 8 +
.../list-functions/list-less-equal-19.rq | 8 +
.../list-functions/list-less-equal-20.rq | 8 +
.../list-functions/list-less-equal-21.rq | 8 +
.../list-functions/list-less-equal-22.rq | 8 +
.../list-functions/list-less-equal-23.rq | 8 +
.../list-functions/list-less-equal-24.rq | 8 +
.../list-functions/list-less-equal-25.rq | 8 +
.../list-functions/list-less-equal-26.rq | 8 +
.../list-functions/list-less-equal-27.rq | 9 +
.../list-functions/list-less-equal-28.rq | 7 +
.../list-functions/list-less-equal-29.rq | 8 +
.../list-functions/list-less-equal-31.rq | 8 +
.../list-functions/list-less-equal-error-03.rq | 8 +
.../list-functions/list-less-equal-error-04.rq | 8 +
.../list-functions/list-less-equal-null-01.rq | 8 +
.../list-functions/list-less-equal-null-02.rq | 8 +
.../list-functions/list-less-equal-null-03.rq | 9 +
.../list-functions/list-less-equal-null-04.rq | 11 +
.../list-functions/list-less-equal-null-05.rq | 8 +
.../list-functions/list-less-equal-null-06.rq | 9 +
.../list-functions/list-less-than-01.rq | 8 +
.../list-functions/list-less-than-02.rq | 8 +
.../list-functions/list-less-than-03.rq | 8 +
.../list-functions/list-less-than-04.rq | 8 +
.../list-functions/list-less-than-05.rq | 8 +
.../list-functions/list-less-than-06.rq | 8 +
.../list-functions/list-less-than-07.rq | 8 +
.../list-functions/list-less-than-08.rq | 8 +
.../list-functions/list-less-than-09.rq | 8 +
.../list-functions/list-less-than-10.rq | 8 +
.../list-functions/list-less-than-11.rq | 8 +
.../list-functions/list-less-than-12.rq | 8 +
.../list-functions/list-less-than-13.rq | 8 +
.../list-functions/list-less-than-14.rq | 8 +
.../list-functions/list-less-than-15.rq | 8 +
.../list-functions/list-less-than-16.rq | 8 +
.../list-functions/list-less-than-19.rq | 8 +
.../list-functions/list-less-than-20.rq | 8 +
.../list-functions/list-less-than-21.rq | 8 +
.../list-functions/list-less-than-22.rq | 8 +
.../list-functions/list-less-than-23.rq | 8 +
.../list-functions/list-less-than-24.rq | 8 +
.../list-functions/list-less-than-25.rq | 8 +
.../list-functions/list-less-than-26.rq | 8 +
.../list-functions/list-less-than-27.rq | 9 +
.../list-functions/list-less-than-28.rq | 7 +
.../list-functions/list-less-than-29.rq | 8 +
.../list-functions/list-less-than-31.rq | 8 +
.../list-functions/list-less-than-error-03.rq | 8 +
.../list-functions/list-less-than-error-04.rq | 8 +
.../list-functions/list-less-than-null-01.rq | 8 +
.../list-functions/list-less-than-null-02.rq | 8 +
.../list-functions/list-less-than-null-03.rq | 9 +
.../list-functions/list-less-than-null-04.rq | 11 +
.../list-functions/list-less-than-null-05.rq | 8 +
.../list-functions/list-less-than-null-06.rq | 9 +
.../SPARQL-CDTs/list-functions/manifest.ttl | 3226 +++++++++++
.../SPARQL-CDTs/list-functions/reverse-01.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-02.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-03.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-04.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-05.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-06.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-07.rq | 9 +
.../SPARQL-CDTs/list-functions/reverse-08.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-09.rq | 7 +
.../SPARQL-CDTs/list-functions/reverse-10.rq | 9 +
.../SPARQL-CDTs/list-functions/reverse-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/sameterm-01.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-02.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-03.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-04.rq | 6 +
.../SPARQL-CDTs/list-functions/sameterm-null-01.rq | 6 +
.../testing/SPARQL-CDTs/list-functions/size-01.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-04.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-05.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-06.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-07.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-08.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-09.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-10.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-11.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/size-12.rq | 7 +
.../SPARQL-CDTs/list-functions/size-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-01.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-02.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-03.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-04.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-05.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-06.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-07.rq | 7 +
.../SPARQL-CDTs/list-functions/subseq-08.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-09.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-10.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-11.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-12.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-13.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-error-01.rq | 8 +
.../SPARQL-CDTs/list-functions/subseq-error-02.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/tail-01.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/tail-02.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-03.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-04.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-05.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-06.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-07.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-08.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-09.rq | 7 +
.../testing/SPARQL-CDTs/list-functions/tail-10.rq | 7 +
.../SPARQL-CDTs/list-functions/tail-error-01.rq | 8 +
.../testing/SPARQL-CDTs/list-functions/true.srx | 5 +
jena-arq/testing/SPARQL-CDTs/manifest-all.ttl | 16 +
.../SPARQL-CDTs/map-functions/containsKey-01.rq | 9 +
.../SPARQL-CDTs/map-functions/containsKey-02.rq | 9 +
.../SPARQL-CDTs/map-functions/containsKey-03.rq | 11 +
.../testing/SPARQL-CDTs/map-functions/empty.ttl | 0
.../testing/SPARQL-CDTs/map-functions/get-01.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/get-02.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/get-03.rq | 12 +
.../testing/SPARQL-CDTs/map-functions/get-04.rq | 12 +
.../SPARQL-CDTs/map-functions/get-error-01.rq | 8 +
.../SPARQL-CDTs/map-functions/get-null-01.rq | 8 +
.../testing/SPARQL-CDTs/map-functions/keys-01.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/keys-02.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/keys-03.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/manifest.ttl | 2081 +++++++
.../map-functions/map-constructor-01.rq | 7 +
.../map-functions/map-constructor-02.rq | 7 +
.../map-functions/map-constructor-03.rq | 7 +
.../map-functions/map-constructor-04.rq | 7 +
.../map-functions/map-constructor-05.rq | 7 +
.../map-functions/map-constructor-06.rq | 7 +
.../map-functions/map-constructor-07.rq | 7 +
.../map-functions/map-constructor-08.rq | 7 +
.../map-functions/map-constructor-09.rq | 7 +
.../map-functions/map-constructor-10.rq | 15 +
.../map-functions/map-constructor-11.rq | 17 +
.../SPARQL-CDTs/map-functions/map-equals-01.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-02.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-03.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-04.rq | 7 +
.../SPARQL-CDTs/map-functions/map-equals-05.rq | 6 +
.../SPARQL-CDTs/map-functions/map-equals-06.rq | 7 +
.../SPARQL-CDTs/map-functions/map-equals-07.rq | 7 +
.../SPARQL-CDTs/map-functions/map-equals-08.rq | 9 +
.../SPARQL-CDTs/map-functions/map-equals-09.rq | 8 +
.../map-functions/map-equals-null-01.rq | 9 +
.../map-functions/map-equals-null-02.rq | 9 +
.../map-functions/map-greater-equal-01.rq | 8 +
.../map-functions/map-greater-equal-02.rq | 8 +
.../map-functions/map-greater-equal-03.rq | 8 +
.../map-functions/map-greater-equal-04.rq | 8 +
.../map-functions/map-greater-equal-05.rq | 8 +
.../map-functions/map-greater-equal-06.rq | 8 +
.../map-functions/map-greater-equal-07.rq | 8 +
.../map-functions/map-greater-equal-08.rq | 8 +
.../map-functions/map-greater-equal-09.rq | 8 +
.../map-functions/map-greater-equal-10.rq | 8 +
.../map-functions/map-greater-equal-11.rq | 8 +
.../map-functions/map-greater-equal-12.rq | 8 +
.../map-functions/map-greater-equal-13.rq | 8 +
.../map-functions/map-greater-equal-14.rq | 8 +
.../map-functions/map-greater-equal-15.rq | 10 +
.../map-functions/map-greater-equal-16.rq | 10 +
.../map-functions/map-greater-equal-17.rq | 10 +
.../map-functions/map-greater-equal-18.rq | 10 +
.../map-functions/map-greater-equal-19.rq | 10 +
.../map-functions/map-greater-equal-20.rq | 10 +
.../map-functions/map-greater-equal-21.rq | 10 +
.../map-functions/map-greater-equal-error-01.rq | 10 +
.../map-functions/map-greater-equal-error-02.rq | 10 +
.../map-functions/map-greater-equal-null-01.rq | 7 +
.../map-functions/map-greater-equal-null-02.rq | 8 +
.../map-functions/map-greater-equal-null-03.rq | 9 +
.../map-functions/map-greater-equal-null-04.rq | 9 +
.../map-functions/map-greater-than-01.rq | 8 +
.../map-functions/map-greater-than-02.rq | 8 +
.../map-functions/map-greater-than-03.rq | 8 +
.../map-functions/map-greater-than-04.rq | 8 +
.../map-functions/map-greater-than-05.rq | 8 +
.../map-functions/map-greater-than-06.rq | 8 +
.../map-functions/map-greater-than-07.rq | 8 +
.../map-functions/map-greater-than-08.rq | 8 +
.../map-functions/map-greater-than-09.rq | 8 +
.../map-functions/map-greater-than-10.rq | 8 +
.../map-functions/map-greater-than-11.rq | 8 +
.../map-functions/map-greater-than-12.rq | 8 +
.../map-functions/map-greater-than-13.rq | 8 +
.../map-functions/map-greater-than-14.rq | 8 +
.../map-functions/map-greater-than-15.rq | 10 +
.../map-functions/map-greater-than-16.rq | 10 +
.../map-functions/map-greater-than-17.rq | 10 +
.../map-functions/map-greater-than-18.rq | 10 +
.../map-functions/map-greater-than-19.rq | 10 +
.../map-functions/map-greater-than-20.rq | 10 +
.../map-functions/map-greater-than-21.rq | 10 +
.../map-functions/map-greater-than-error-01.rq | 10 +
.../map-functions/map-greater-than-error-02.rq | 10 +
.../map-functions/map-greater-than-null-01.rq | 7 +
.../map-functions/map-greater-than-null-02.rq | 8 +
.../map-functions/map-greater-than-null-03.rq | 9 +
.../map-functions/map-greater-than-null-04.rq | 9 +
.../SPARQL-CDTs/map-functions/map-less-equal-01.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-02.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-03.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-04.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-05.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-06.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-07.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-08.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-09.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-10.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-11.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-12.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-13.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-14.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-equal-15.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-16.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-17.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-18.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-19.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-20.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-equal-21.rq | 10 +
.../map-functions/map-less-equal-error-01.rq | 10 +
.../map-functions/map-less-equal-error-02.rq | 10 +
.../map-functions/map-less-equal-null-01.rq | 7 +
.../map-functions/map-less-equal-null-02.rq | 8 +
.../map-functions/map-less-equal-null-03.rq | 9 +
.../map-functions/map-less-equal-null-04.rq | 9 +
.../SPARQL-CDTs/map-functions/map-less-than-01.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-02.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-03.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-04.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-05.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-06.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-07.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-08.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-09.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-10.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-11.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-12.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-13.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-14.rq | 8 +
.../SPARQL-CDTs/map-functions/map-less-than-15.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-16.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-17.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-18.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-19.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-20.rq | 10 +
.../SPARQL-CDTs/map-functions/map-less-than-21.rq | 10 +
.../map-functions/map-less-than-error-01.rq | 10 +
.../map-functions/map-less-than-error-02.rq | 10 +
.../map-functions/map-less-than-null-01.rq | 7 +
.../map-functions/map-less-than-null-02.rq | 8 +
.../map-functions/map-less-than-null-03.rq | 9 +
.../map-functions/map-less-than-null-04.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/merge-01.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-02.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-03.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-04.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-05.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-06.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-07.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/merge-08.rq | 10 +
.../SPARQL-CDTs/map-functions/merge-null-01.rq | 18 +
.../SPARQL-CDTs/map-functions/merge-null-02.rq | 18 +
.../SPARQL-CDTs/map-functions/merge-null-03.rq | 14 +
.../SPARQL-CDTs/map-functions/merge-null-04.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/put-01.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-02.rq | 12 +
.../testing/SPARQL-CDTs/map-functions/put-03.rq | 12 +
.../testing/SPARQL-CDTs/map-functions/put-04.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-05.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-06.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-07.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-08.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-09.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-10.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-11.rq | 15 +
.../testing/SPARQL-CDTs/map-functions/put-12.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/put-13.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-14.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/put-15.rq | 9 +
.../SPARQL-CDTs/map-functions/put-error-01.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-02.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-03.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-04.rq | 8 +
.../SPARQL-CDTs/map-functions/put-error-05.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/remove-01.rq | 11 +
.../testing/SPARQL-CDTs/map-functions/remove-02.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-03.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-04.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-05.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/remove-06.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/remove-07.rq | 10 +
.../testing/SPARQL-CDTs/map-functions/remove-08.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-09.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-10.rq | 9 +
.../testing/SPARQL-CDTs/map-functions/remove-11.rq | 9 +
.../SPARQL-CDTs/map-functions/sameterm-01.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-02.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-03.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-04.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-05.rq | 6 +
.../SPARQL-CDTs/map-functions/sameterm-null-01.rq | 6 +
.../testing/SPARQL-CDTs/map-functions/size-01.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-02.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-03.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-04.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/size-05.rq | 7 +
.../testing/SPARQL-CDTs/map-functions/true.srx | 5 +
jena-arq/testing/SPARQL-CDTs/orderby/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/orderby/manifest.ttl | 291 +
.../testing/SPARQL-CDTs/orderby/order-list-03.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-04.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-05.rq | 18 +
.../testing/SPARQL-CDTs/orderby/order-list-06.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-07.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-08.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-09.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-list-10.rq | 15 +
.../SPARQL-CDTs/orderby/order-list-null-01.rq | 15 +
.../SPARQL-CDTs/orderby/order-list-null-02.rq | 16 +
.../testing/SPARQL-CDTs/orderby/order-map-03.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-04.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-05.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-06.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-07.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-08.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-09.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-10.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-11.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-12.rq | 18 +
.../testing/SPARQL-CDTs/orderby/order-map-13.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-14.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-15.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-16.rq | 15 +
.../testing/SPARQL-CDTs/orderby/order-map-17.rq | 15 +
.../SPARQL-CDTs/orderby/order-map-null-01.rq | 15 +
.../SPARQL-CDTs/orderby/order-map-null-02.rq | 16 +
jena-arq/testing/SPARQL-CDTs/orderby/true.srx | 5 +
jena-arq/testing/SPARQL-CDTs/unfold/empty.ttl | 0
jena-arq/testing/SPARQL-CDTs/unfold/manifest.ttl | 483 ++
jena-arq/testing/SPARQL-CDTs/unfold/true.srx | 5 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-01.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-02.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-03.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-1var-04.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-01.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-02.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-03.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-04.rq | 9 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-05.rq | 7 +
.../SPARQL-CDTs/unfold/unfold-get-list-2vars-06.rq | 10 +
.../SPARQL-CDTs/unfold/unfold-list-1var-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-01.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-02.srj | 17 +
.../SPARQL-CDTs/unfold/unfold-list-1var-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-03.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-04.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-05.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-05.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-06.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-06.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-list-1var-07.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-07.srj | 17 +
.../SPARQL-CDTs/unfold/unfold-list-1var-08.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-08.srj | 17 +
.../SPARQL-CDTs/unfold/unfold-list-1var-09.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-09.srj | 13 +
.../SPARQL-CDTs/unfold/unfold-list-1var-10.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-1var-10.srj | 15 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-01.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-02.srj | 20 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-03.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-04.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-05.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-05.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-06.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-06.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-07.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-07.srj | 20 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-08.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-08.srj | 20 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-09.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-09.srj | 15 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-10.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-list-2vars-10.srj | 18 +
.../SPARQL-CDTs/unfold/unfold-map-1var-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-01.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-1var-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-02.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-1var-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-03.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-1var-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-1var-04.srj | 14 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-01.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-01.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-02.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-02.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-03.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-03.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-04.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-04.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-05.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-05.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-06.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-06.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-07.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-07.srj | 16 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-08.rq | 6 +
.../SPARQL-CDTs/unfold/unfold-map-2vars-08.srj | 15 +
.../org/apache/jena/graph/impl/LiteralLabel.java | 22 +
.../jena/graph/impl/LiteralLabelFactory.java | 15 +
.../rewriters/BuildElementVisitor.java | 8 +-
.../querybuilder/rewriters/ElementRewriter.java | 20 +-
.../arq/querybuilder/rewriters/OpRewriter.java | 8 +-
.../updatebuilder/QuadIteratorBuilder.java | 8 +-
.../jena/arq/querybuilder/WhereValidator.java | 8 +-
.../permissions/query/rewriter/OpRewriter.java | 13 +
853 files changed, 25199 insertions(+), 4780 deletions(-)
diff --git a/jena-arq/Grammar/CDTs/cdt_literals.jj b/jena-arq/Grammar/CDTs/cdt_literals.jj
new file mode 100644
index 0000000000..d2e098b906
--- /dev/null
+++ b/jena-arq/Grammar/CDTs/cdt_literals.jj
@@ -0,0 +1,370 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+options
+{
+ // Use \ u escapes in streams AND use a reader for the query
+ // => get both raw and escaped unicode
+
+ JAVA_UNICODE_ESCAPE = true ;
+ UNICODE_INPUT = false ;
+
+ STATIC = false ;
+// DEBUG_PARSER = true ;
+// DEBUG_TOKEN_MANAGER = true ;
+}
+
+PARSER_BEGIN(CDTLiteralParser)
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.cdt.*;
+import org.apache.jena.graph.Node;
+
+import static org.apache.jena.riot.lang.extra.LangParserLib.*;
+
+public class CDTLiteralParser extends CDTLiteralParserBase
+{
+}
+PARSER_END(CDTLiteralParser)
+
+// --- Entry point for cdt:List literals
+
+List<CDTValue> List() : { List<CDTValue> l = new ArrayList<CDTValue>(); }
+{
+ <LBRACKET>
+
+ ( NonEmptyListContent(l) )?
+
+ <RBRACKET>
+
+ { return l; }
+}
+
+void NonEmptyListContent(List<CDTValue> l) : { }
+{
+ ListElement(l)
+
+ ( <COMMA> ListElement(l) )*
+}
+
+void ListElement(List<CDTValue> l) : { String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m; }
+{
+ iri = IRI_REF() { n = createURI(iri, token.beginLine, token.beginColumn); l.add( CDTFactory.createValue(n) ); }
+|
+ n = BlankNode() { l.add( CDTFactory.createValue(n) ); }
+|
+ n = RDFLiteral() { l.add( CDTFactory.createValue(n) ); }
+|
+ n = NumericLiteral() { l.add( CDTFactory.createValue(n) ); }
+|
+ n = BooleanLiteral() { l.add( CDTFactory.createValue(n) ); }
+|
+ <NULL> { l.add( CDTFactory.getNullValue() ); }
+|
+ subList = List() { l.add( CDTFactory.createValue(subList) ); }
+|
+ m = Map() { l.add( CDTFactory.createValue(m) ); }
+}
+
+// --- Entry point for cdt:Map literals
+
+Map<CDTKey,CDTValue> Map() : { Map<CDTKey,CDTValue> m = new HashMap<CDTKey,CDTValue>(); }
+{
+ <LBRACE>
+
+ ( NonEmptyMapContent(m) )?
+
+ <RBRACE>
+
+ { return m; }
+}
+
+void NonEmptyMapContent(Map<CDTKey,CDTValue> m) : { }
+{
+ MapEntry(m)
+
+ ( <COMMA> MapEntry(m) )*
+}
+
+void MapEntry(Map<CDTKey,CDTValue> m) : { CDTKey key; CDTValue value; }
+{
+ key = MapKey()
+
+ <COLON>
+
+ value = MapValue()
+
+ {
+ final CDTValue oldValue = m.put(key, value);
+ if ( oldValue != null ) throw new ParseException("map with non-unique key (" + key.toString() + ")");
+ }
+}
+
+CDTKey MapKey() : { String iri; Node n; }
+{
+ iri = IRI_REF() { n = createURI(iri, token.beginLine, token.beginColumn); return CDTFactory.createKey(n); }
+|
+ n = RDFLiteral() { return CDTFactory.createKey(n); }
+|
+ n = NumericLiteral() { return CDTFactory.createKey(n); }
+|
+ n = BooleanLiteral() { return CDTFactory.createKey(n); }
+}
+
+CDTValue MapValue() : { String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m; }
+{
+ iri = IRI_REF() { n = createURI(iri, token.beginLine, token.beginColumn); return CDTFactory.createValue(n); }
+|
+ n = BlankNode() { return CDTFactory.createValue(n); }
+|
+ n = RDFLiteral() { return CDTFactory.createValue(n); }
+|
+ n = NumericLiteral() { return CDTFactory.createValue(n); }
+|
+ n = BooleanLiteral() { return CDTFactory.createValue(n); }
+|
+ <NULL> { return CDTFactory.getNullValue(); }
+|
+ subList = List() { return CDTFactory.createValue(subList); }
+|
+ m = Map() { return CDTFactory.createValue(m); }
+}
+
+
+// ---- Basic terms
+
+String IRI_REF() : { Token t ; }
+{
+ t = <IRIref>
+ { return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ; }
+}
+
+Node BlankNode() : { Token t = null ; }
+{
+ t = <BLANK_NODE_LABEL>
+
+ {
+ return createBNode(t.image, t.beginLine, t.beginColumn);
+ }
+}
+
+Node NumericLiteral() : { Token t ; }
+{
+ t = <INTEGER> { return createLiteralInteger(t.image, t.beginLine, t.beginColumn); }
+| t = <DECIMAL> { return createLiteralDecimal(t.image, t.beginLine, t.beginColumn); }
+| t = <DOUBLE> { return createLiteralDouble(t.image, t.beginLine, t.beginColumn); }
+}
+
+Node BooleanLiteral() : {}
+{
+ <TRUE> { return XSD_TRUE; }
+ |
+ <FALSE> { return XSD_FALSE; }
+}
+
+Node RDFLiteral() : { String lex = null ; }
+{
+ lex = String()
+ // Optional lang tag and datatype.
+ { String lang = null ; String dt = null ; }
+ (
+ lang = Langtag()
+ |
+ ( <DATATYPE> dt = IRI_REF() ) // divergence from the Turtle parser here; instead of IRIref(), we only permit IRI_REF()
+ )?
+
+ {
+ return createLiteral(lex, lang, dt, token.beginLine, token.beginColumn);
+ }
+}
+
+String Langtag() : { Token t ; }
+{
+ t = <LANGTAG> // divergence from the Turtle parser here, which also permits AnyDirective() at this point
+ { String lang = stripChars(t.image, 1) ; return lang ; }
+}
+
+String String() : { Token t ; String lex ; }
+{
+ ( t = <STRING_LITERAL1> { lex = stripQuotes(t.image) ; }
+ | t = <STRING_LITERAL2> { lex = stripQuotes(t.image) ; }
+ | t = <STRING_LITERAL_LONG1> { lex = stripQuotes3(t.image) ; }
+ | t = <STRING_LITERAL_LONG2> { lex = stripQuotes3(t.image) ; }
+ )
+ { lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
+ return lex ;
+ }
+}
+
+
+// ------------------------------------------
+// Tokens
+
+// Comments and whitespace
+
+SKIP : { " " | "\t" | "\n" | "\r" | "\f" }
+
+TOKEN: { <#WS: " " | "\t" | "\n" | "\r" | "\f"> }
+
+
+// -------------------------------------------------
+// Keywords
+
+TOKEN [IGNORE_CASE] :
+{
+ < TRUE: "true" >
+| < FALSE: "false" >
+
+// -------------------------------------------------
+
+| < INTEGER: (["-","+"])? <DIGITS> >
+|
+ < DECIMAL: (["-","+"])?
+ ((<DIGITS>)+ "." (<DIGITS>)* | "." (<DIGITS>)+)
+ >
+ // Required exponent.
+| < DOUBLE:
+ (["+","-"])?
+ (
+ (["0"-"9"])+ "." (["0"-"9"])* <EXPONENT>
+ | "." (["0"-"9"])+ (<EXPONENT>)
+ | (["0"-"9"])+ <EXPONENT>
+ )
+ >
+| < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
+| < #QUOTE_3D: "\"\"\"">
+| < #QUOTE_3S: "'''">
+// "u" done by javacc input stream.
+// "U" escapes not supported yet for Java strings
+| <ECHAR: "\\" ("t"|"b"|"n"|"r"|"f"|"\\"|"\""|"'")>
+
+| < STRING_LITERAL1:
+ // Single quoted string
+ "'" ( (~["'","\\","\n","\r"]) | <ECHAR> )* "'" >
+
+| < STRING_LITERAL2:
+ // Double quoted string
+ "\"" ( (~["\"","\\","\n","\r"]) | <ECHAR> )* "\"" >
+
+| < STRING_LITERAL_LONG1:
+ <QUOTE_3S>
+ ( ~["'","\\"] | <ECHAR> | ("'" ~["'"]) | ("''" ~["'"]))*
+ <QUOTE_3S> >
+
+| < STRING_LITERAL_LONG2:
+ <QUOTE_3D>
+ ( ~["\"","\\"] | <ECHAR> | ("\"" ~["\""]) | ("\"\"" ~["\""]))*
+ <QUOTE_3D> >
+| < DIGITS: (["0"-"9"])+>
+// | <HEX: ["0"-"9"] | ["A"-"F"] | ["a"-"f"]>
+}
+
+TOKEN:
+{
+ // Includes # for relative URIs
+ <IRIref: "<" (~[ ">","<", "\"", "{", "}", "^", "\\", "|", "`",
+ "\u0000"-"\u0020"])* ">" >
+| <BLANK_NODE_LABEL: "_:" <PN_LOCAL> >
+| <LANGTAG: <AT> (<A2Z>)+("-" (<A2ZN>)+)* >
+| <#A2Z: ["a"-"z","A"-"Z"]>
+| <#A2ZN: ["a"-"z","A"-"Z","0"-"9"]>
+}
+
+
+TOKEN :
+{
+ < NULL: "null" >
+
+| < LBRACE: "{" >
+| < RBRACE: "}" >
+
+| < LBRACKET: "[" >
+| < RBRACKET: "]" >
+
+| < COMMA: "," >
+| < COLON: ":" >
+}
+
+// Operator
+
+TOKEN :
+{
+ < DATATYPE: "^^">
+| < AT: "@">
+}
+
+TOKEN:
+{
+ <#PN_CHARS_BASE:
+ ["A"-"Z"] | ["a"-"z"] |
+ ["\u00C0"-"\u00D6"] | ["\u00D8"-"\u00F6"] | ["\u00F8"-"\u02FF"] |
+ ["\u0370"-"\u037D"] | ["\u037F"-"\u1FFF"] |
+ ["\u200C"-"\u200D"] | ["\u2070"-"\u218F"] | ["\u2C00"-"\u2FEF"] |
+ ["\u3001"-"\uD7FF"] | ["\uF900"-"\uFFFD"]
+ >
+ // [#x10000-#xEFFFF]
+|
+ <#PN_CHARS_U: <PN_CHARS_BASE> | "_" >
+|
+// No DOT
+ <#PN_CHARS: (<PN_CHARS_U> | "-" | ["0"-"9"] | "\u00B7" |
+ ["\u0300"-"\u036F"] | ["\u203F"-"\u2040"] ) >
+|
+ // With a leading "_", no dot at end of local name.
+ <#PN_LOCAL: (<PN_CHARS_U> | ["0"-"9"]) ((<PN_CHARS>|".")* <PN_CHARS>)? >
+}
+
+// Catch-all tokens. Must be last.
+// Any non-whitespace. Causes a parser exception, rather than a
+// token manager error (with hidden line numbers).
+// Only bad IRIs (e.g. spaces) now give unhelpful parse errors.
+TOKEN:
+{
+ <#UNKNOWN: (~[" ","\t","\n","\r","\f" ])+ >
+}
+
+/*
+# Local Variables:
+# tab-width: 4
+# indent-tabs-mode: nil
+# comment-default-style: "//"
+# End:
+*/
diff --git a/jena-arq/Grammar/CDTs/generate b/jena-arq/Grammar/CDTs/generate
new file mode 100755
index 0000000000..687b81f053
--- /dev/null
+++ b/jena-arq/Grammar/CDTs/generate
@@ -0,0 +1,65 @@
+#!/bin/bash
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+
+# Parser builder
+
+DIR="../../src/main/java/org/apache/jena/cdt/parser"
+FILE=cdt_literals.jj
+CLASS=CDTLiteralParser
+
+(cd "$DIR" ; rm -f *.java )
+
+echo "---- Process grammar ----"
+
+javacc -OUTPUT_DIRECTORY=$DIR -JDK_VERSION=1.8 "$FILE"
+
+RC=$?
+[ "$RC" = 0 ] || return
+
+echo "---- Create text form ----"
+jjdoc -TEXT=true -OUTPUT_FILE=${FILE%%.jj}.txt "${FILE}"
+
+echo "---- Fixing Java warnings in TokenMgrError"
+F="$DIR/TokenMgrError.java"
+if [ -e "$F" ]
+then
+ sed -e 's/public class TokenMgrError/\n@SuppressWarnings("all")\npublic class TokenMgrError/' < $F > F
+ mv F $F
+fi
+
+## JavaCharStream -- SimpleCharStream is OK.
+echo "---- Fixing Java warnings in JavaCharStream..."
+F="$DIR/JavaCharStream.java"
+if [ -e "$F" ]
+then
+ sed -e 's/public/\n@SuppressWarnings("all")\npublic/' < $F > F
+ mv F $F
+fi
+
+echo "---- Fixing Java warnings in ${CLASS} ..."
+F="$DIR/${CLASS}.java"
+sed -e 's/@SuppressWarnings("serial")//' \
+ < $F > F
+mv F $F
+
+echo "---- Create HTML form ----"
+../jj2html ${FILE%%.jj}.txt '../tokens.txt' > ${FILE%%.jj}-1.html
+../grammarExtracts < ${FILE%%.jj}-1.html > ${FILE%%.jj}-2.html
+
+echo "Check X and Y for IRI_REF because \" became '"
+
+echo "---- Done"
diff --git a/jena-arq/Grammar/arq.jj b/jena-arq/Grammar/arq.jj
index 2432ac5085..24f421a5d6 100644
--- a/jena-arq/Grammar/arq.jj
+++ b/jena-arq/Grammar/arq.jj
@@ -300,6 +300,26 @@ void OrderCondition() :
else
getQuery().addOrderBy(v, direction) ; }
}
+SortCondition OrderConditionForAggregationFunction() :
+{ int direction = 0 ; Expr expr = null ; Node v = null ; }
+{
+ { direction = Query.ORDER_DEFAULT ; }
+ (
+ (
+ ( <ASC> { direction = Query.ORDER_ASCENDING ; }
+ | <DESC> { direction = Query.ORDER_DESCENDING ; } )
+ expr = BrackettedExpression()
+ )
+ |
+ ( expr = Constraint()
+ | v = Var()
+ )
+ )
+ { if ( v == null )
+ return new SortCondition(expr, direction) ;
+ else
+ return new SortCondition(v, direction) ; }
+}
void LimitOffsetClauses() : { }
{
(
@@ -634,6 +654,8 @@ Element GraphPatternNotTriples() : { Element el = null ; }
el = ExistsElt()
|
el = NotExistsElt()
+ |
+ el = Unfold()
)
{ return el ; }
}
@@ -758,6 +780,17 @@ Element NotExistsElt() : { Element el ; }
el = GroupGraphPattern()
{ return new ElementNotExists(el) ; }
}
+Element Unfold() : { Var v1 ; Var v2 = null ; Expr expr ; }
+{
+ <UNFOLD>
+ <LPAREN>
+ expr = Expression()
+ <AS>
+ v1 = Var()
+ (<COMMA> v2 = Var() { ; } )?
+ <RPAREN>
+ { return new ElementUnfold(expr, v1, v2) ; }
+}
Element MinusGraphPattern() : { Element el ; }
{
<MINUS_P>
@@ -1611,6 +1644,26 @@ Expr Aggregate() : { Aggregator agg = null ; String sep = null ;
{ agg = AggregatorFactory.createCustom(AggURI.var_samp, distinct, expr) ; }
| t = <VAR_POP> <LPAREN> ( <DISTINCT> { distinct = true ; } )? expr = Expression() <RPAREN>
{ agg = AggregatorFactory.createCustom(AggURI.var_pop, distinct, expr) ; }
+ | t = <FOLD>
+ { java.util.List<SortCondition> scs = null ;
+ SortCondition sc = null ; }
+ <LPAREN>
+ ( <DISTINCT> { distinct = true ; } )?
+ expr = Expression()
+ ( <COMMA> expr2 = Expression() )?
+ (
+ <ORDER> <BY>
+ (
+ sc = OrderConditionForAggregationFunction()
+ {
+ if ( scs == null )
+ scs = new java.util.ArrayList<SortCondition>();
+ scs.add(sc);
+ }
+ )+
+ )?
+ <RPAREN>
+ { agg = AggregatorFactory.createFold(distinct, expr, expr2, scs) ; }
| t = <AGG>
{ String iri ; }
iri = iri()
@@ -1785,11 +1838,13 @@ TOKEN [IGNORE_CASE] :
| < SERVICE: "service" >
| < LET: "LET" >
| < LATERAL: "LATERAL" >
+| < UNFOLD: "unfold" >
| < TRIPLE: "TRIPLE" >
| < IS_TRIPLE: "isTRIPLE" >
| < SUBJECT: "SUBJECT" >
| < PREDICATE: "PREDICATE" >
| < OBJECT: "OBJECT" >
+| < UNFOLD: "unfold" >
| < EXISTS: "exists" >
| < NOT: "not" >
| < AS: "as" >
@@ -1810,6 +1865,7 @@ TOKEN [IGNORE_CASE] :
| < VARIANCE: "variance" >
| < VAR_SAMP: "var_samp" >
| < VAR_POP: "var_pop" >
+| < FOLD: "fold" >
| < SAMPLE: "sample" >
| < GROUP_CONCAT: "group_concat" >
| < FILTER: "filter" >
diff --git a/jena-arq/Grammar/main.jj b/jena-arq/Grammar/main.jj
index 757e0055e5..46ff197b3b 100644
--- a/jena-arq/Grammar/main.jj
+++ b/jena-arq/Grammar/main.jj
@@ -480,6 +480,27 @@ void OrderCondition() :
getQuery().addOrderBy(v, direction) ; }
}
+SortCondition OrderConditionForAggregationFunction() :
+{ int direction = 0 ; Expr expr = null ; Node v = null ; }
+{
+ { direction = Query.ORDER_DEFAULT ; }
+ (
+ ( // These are for clarity in the HTML
+ ( <ASC> { direction = Query.ORDER_ASCENDING ; }
+ | <DESC> { direction = Query.ORDER_DESCENDING ; } )
+ expr = BrackettedExpression()
+ )
+ |
+ ( expr = Constraint()
+ | v = Var() //{ expr = asExpr(v) ; }
+ )
+ )
+ { if ( v == null )
+ return new SortCondition(expr, direction) ;
+ else
+ return new SortCondition(v, direction) ; }
+}
+
void LimitOffsetClauses() : { }
{
// SPARQL does not care about the order here.
@@ -902,10 +923,14 @@ Element GraphPatternNotTriples() : { Element el = null ; }
#ifdef ARQ
|
el = Assignment()
+ |
+ el = Unfold()
|
el = ExistsElt()
|
el = NotExistsElt()
+ |
+ el = Unfold()
#endif
)
{ return el ; }
@@ -1038,6 +1063,18 @@ Element Assignment() : { Var v ; Expr expr ; }
{ return new ElementAssign(v, expr) ; }
}
+Element Unfold() : { Var v1 ; Var v2 = null ; Expr expr ; }
+{
+ <UNFOLD>
+ <LPAREN>
+ expr = Expression()
+ <AS>
+ v1 = Var()
+ (<COMMA> v2 = Var() { ; } )?
+ <RPAREN>
+ { return new ElementUnfold(expr, v1, v2) ; }
+}
+
Element ExistsElt() : { Element el ; }
{
<EXISTS>
@@ -1051,6 +1088,18 @@ Element NotExistsElt() : { Element el ; }
el = GroupGraphPattern()
{ return new ElementNotExists(el) ; }
}
+
+Element Unfold() : { Var v1 ; Var v2 = null ; Expr expr ; }
+{
+ <UNFOLD>
+ <LPAREN>
+ expr = Expression()
+ <AS>
+ v1 = Var()
+ (<COMMA> v2 = Var() { ; } )?
+ <RPAREN>
+ { return new ElementUnfold(expr, v1, v2) ; }
+}
#endif
Element MinusGraphPattern() : { Element el ; }
@@ -2234,6 +2283,27 @@ Expr Aggregate() : { Aggregator agg = null ; String sep = null ;
| t = <VAR_POP> <LPAREN> ( <DISTINCT> { distinct = true ; } )? expr = Expression() <RPAREN>
{ agg = AggregatorFactory.createCustom(AggURI.var_pop, distinct, expr) ; }
+ | t = <FOLD>
+ { java.util.List<SortCondition> scs = null ;
+ SortCondition sc = null ; }
+ <LPAREN>
+ ( <DISTINCT> { distinct = true ; } )?
+ expr = Expression()
+ ( <COMMA> expr2 = Expression() )?
+ (
+ <ORDER> <BY>
+ (
+ sc = OrderConditionForAggregationFunction()
+ {
+ if ( scs == null )
+ scs = new java.util.ArrayList<SortCondition>();
+ scs.add(sc);
+ }
+ )+
+ )?
+ <RPAREN>
+ { agg = AggregatorFactory.createFold(distinct, expr, expr2, scs) ; }
+
/* Explicit syntax (aggregate even if not registered) */
| t = <AGG>
{ String iri ; }
@@ -2499,6 +2569,7 @@ TOKEN [IGNORE_CASE] :
#ifdef ARQ
| < LET: "LET" >
| < LATERAL: "LATERAL" >
+| < UNFOLD: "unfold" >
#endif
| < TRIPLE: "TRIPLE" >
@@ -2529,6 +2600,9 @@ TOKEN [IGNORE_CASE] :
| < VARIANCE: "variance" >
| < VAR_SAMP: "var_samp" >
| < VAR_POP: "var_pop" >
+#ifdef ARQ
+| < FOLD: "fold" >
+#endif
| < SAMPLE: "sample" >
| < GROUP_CONCAT: "group_concat" >
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CDTFactory.java b/jena-arq/src/main/java/org/apache/jena/cdt/CDTFactory.java
new file mode 100644
index 0000000000..9af154467a
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CDTFactory.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+
+public class CDTFactory
+{
+ public static CDTKey createKey( final Node n ) {
+ return new CDTKey() {
+ @Override public Node asNode() { return n; }
+ };
+ }
+
+ public static CDTValue createValue( final Node n ) {
+ return new CDTValue() {
+ @Override public boolean isNode() { return true; }
+ @Override public Node asNode() { return n; }
+ };
+ }
+
+ public static CDTValue createValue( final List<CDTValue> l ) {
+ final Node n = NodeFactory.createLiteralByValue(l, CompositeDatatypeList.type);
+ return createValue(n);
+ }
+
+ public static CDTValue createValue( final Map<CDTKey,CDTValue> m ) {
+ final Node n = NodeFactory.createLiteralByValue(m, CompositeDatatypeMap.type);
+ return createValue(n);
+ }
+
+ public static CDTValue getNullValue() {
+ if ( nullValue == null ) {
+ return new CDTValue() {
+ @Override public boolean isNull() { return true; }
+ };
+ }
+
+ return nullValue;
+ }
+
+ private static CDTValue nullValue = null;
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CDTKey.java b/jena-arq/src/main/java/org/apache/jena/cdt/CDTKey.java
new file mode 100644
index 0000000000..7631565e88
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CDTKey.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.riot.out.NodeFmtLib;
+
+public abstract class CDTKey
+{
+ /**
+ * Returns this object as an RDF term (i.e., an IRI, a literal,
+ * or a blank node), assuming it is one. If it is not, then an
+ * {@link UnsupportedOperationException} is thrown.
+ */
+ public Node asNode() {
+ throw new UnsupportedOperationException( this + " is not an RDF term" );
+ }
+
+ @Override
+ public boolean equals( final Object other ) {
+ if ( other instanceof CDTKey ) {
+ final CDTKey otherKey = (CDTKey) other;
+
+ final Node n1 = asNode();
+ final Node n2 = otherKey.asNode();
+ return n1.equals(n2);
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return asNode().hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return asNode().toString();
+ }
+
+ /**
+ * Returns a string representation of this element
+ * to be included in the lexical form of literals.
+ */
+ public String asLexicalForm() {
+ return NodeFmtLib.strTTL( asNode() );
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParseException.java
similarity index 58%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParseException.java
index a7452a464a..01325265fc 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParseException.java
@@ -16,22 +16,16 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import org.apache.jena.shared.JenaException;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+public class CDTLiteralParseException extends JenaException
+{
+ private static final long serialVersionUID = -6244204787118953600L;
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
+ public CDTLiteralParseException() { super(); }
+ public CDTLiteralParseException(Throwable cause) { super(cause); }
+ public CDTLiteralParseException(String msg) { super(msg); }
+ public CDTLiteralParseException(String msg, Throwable cause) { super(msg, cause); }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParserBase.java b/jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParserBase.java
new file mode 100644
index 0000000000..7e26446c20
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CDTLiteralParserBase.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.riot.lang.extra.LangParserBase;
+
+public class CDTLiteralParserBase extends LangParserBase
+{
+ @Override
+ protected Node createBNode( final String label, final int line, final int column ) {
+ // We need to cut away the leading '_:' of the given blank node label.
+ // This is necessary because the Turtle parser does the same. If we
+ // would not do it here for the blank node labels obtained from the
+ // lexical forms of CDT literals, then the label-to-bnode mapping of
+ // the shared parser state fails to map the same blank node identifiers
+ // inside and outside of CDT literals to the same blank node.
+ final String lbl = label.startsWith("_:") ? label.substring(2) : label;
+ return super.createBNode(lbl, line, column);
+ }
+
+ @Override
+ protected Node createLiteral( final String lex, final String langTag, final String datatypeURI, final int line, final int column ) {
+ if ( CompositeDatatypeList.uri.equals(datatypeURI) ) {
+ return profile.createTypedLiteral(lex, CompositeDatatypeList.type, 0L, 0L);
+ }
+
+ if ( CompositeDatatypeMap.uri.equals(datatypeURI) ) {
+ return profile.createTypedLiteral(lex, CompositeDatatypeMap.type, 0L, 0L);
+ }
+
+ return super.createLiteral(lex, langTag, datatypeURI, line, column);
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CDTValue.java b/jena-arq/src/main/java/org/apache/jena/cdt/CDTValue.java
new file mode 100644
index 0000000000..3baed568f3
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CDTValue.java
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.riot.out.NodeFmtLib;
+import org.apache.jena.sparql.expr.ExprEvalException;
+
+public abstract class CDTValue
+{
+ /**
+ * Returns true if this is a null value (in which
+ * case {@link #isNode()} must return false).
+ */
+ public boolean isNull() {
+ return false;
+ }
+
+ /**
+ * Returns true if this object is an RDF term (i.e., an IRI, a literal,
+ * or a blank node). In that case, {@link #asNode()} can be used to get
+ * a corresponding {@link Node} representation of this RDF term.
+ */
+ public boolean isNode() {
+ return false;
+ }
+
+ /**
+ * Returns this object as an RDF term (i.e., an IRI, a literal,
+ * or a blank node), assuming it is one. If it is not, then an
+ * {@link UnsupportedOperationException} is thrown.
+ */
+ public Node asNode() {
+ throw new UnsupportedOperationException( this + " is not an RDF term" );
+ }
+
+ @Override
+ public String toString() {
+ if ( isNode() )
+ return asNode().toString();
+
+ if ( isNull() )
+ return "null";
+
+ throw new IllegalArgumentException( "not null and not a Node (" + this.getClass().getName() + ")" );
+ }
+
+ @Override
+ public int hashCode() {
+ if ( isNode() )
+ return asNode().hashCode();;
+
+ if ( isNull() )
+ return 1;
+
+ throw new IllegalArgumentException( "not null and not a Node (" + this.getClass().getName() + ")" );
+ }
+
+ @Override
+ public boolean equals( final Object other ) {
+ try {
+ return sameAs(other);
+ }
+ catch ( final ExprEvalException ex ) {
+ return false;
+ }
+ }
+
+ public boolean sameAs( final Object other ) throws ExprEvalException {
+ if ( isNull() ) {
+ throw new ExprEvalException("nulls cannot be compared");
+ }
+
+ if ( other instanceof CDTValue ) {
+ final CDTValue otherValue = (CDTValue) other;
+
+ if ( otherValue.isNull() ) {
+ throw new ExprEvalException("nulls cannot be compared");
+ }
+
+ if ( isNode() ) {
+ return otherValue.isNode() && asNode().sameValueAs( otherValue.asNode() );
+ }
+
+ throw new IllegalStateException( "unexpected type of CDTValue: " + this.getClass().getName() );
+ }
+
+ return false;
+ }
+
+ public final boolean sameAs( final CDTValue otherValue ) throws ExprEvalException {
+ if ( isNull() ) {
+ throw new ExprEvalException("nulls cannot be compared");
+ }
+
+ if ( otherValue.isNull() ) {
+ throw new ExprEvalException("nulls cannot be compared");
+ }
+
+ if ( isNode() ) {
+ return otherValue.isNode() && asNode().sameValueAs( otherValue.asNode() );
+ }
+
+ throw new IllegalStateException( "unexpected type of CDTValue: " + this.getClass().getName() );
+ }
+
+ public String asLexicalForm() {
+ if ( isNull() ) {
+ return "null";
+ }
+
+ if ( isNode() ) {
+ final Node n = asNode();
+ if ( CompositeDatatypeList.isListLiteral(n) ) {
+ return n.getLiteralLexicalForm();
+ }
+ else if ( CompositeDatatypeMap.isMapLiteral(n) ) {
+ return n.getLiteralLexicalForm();
+ }
+ else {
+ return NodeFmtLib.strTTL(n);
+ }
+ }
+
+ throw new IllegalStateException( "unexpected type of CDTValue: " + this.getClass().getName() );
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeBase.java b/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeBase.java
new file mode 100644
index 0000000000..ffeff44314
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeBase.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import org.apache.jena.datatypes.DatatypeFormatException;
+import org.apache.jena.datatypes.RDFDatatype;
+import org.apache.jena.graph.impl.LiteralLabel;
+import org.apache.jena.sparql.expr.Expr;
+
+public abstract class CompositeDatatypeBase<T> implements RDFDatatype
+{
+ @Override
+ public Class<?> getJavaClass() {
+ return null;
+ }
+
+ @Override
+ public Object cannonicalise( final Object value ) {
+ return value;
+ }
+
+ @Override
+ public Object extendedTypeDefinition() {
+ return null;
+ }
+
+ @Override
+ public RDFDatatype normalizeSubType( final Object value, final RDFDatatype dt ) {
+ return this;
+ }
+
+ @Override
+ public abstract T parse( final String lexicalForm ) throws DatatypeFormatException;
+
+ public abstract String unparseValue( final T value );
+
+ // helper for the compare function in each of the subclasses
+ protected static int compareByLexicalForms( final LiteralLabel value1, final LiteralLabel value2 ) {
+ final int lexCmp = value1.getLexicalForm().compareTo( value2.getLexicalForm() );
+ if ( lexCmp < 0 ) return Expr.CMP_LESS;
+ if ( lexCmp > 0 ) return Expr.CMP_GREATER;
+ return Expr.CMP_EQUAL;
+ }
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeList.java b/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeList.java
new file mode 100644
index 0000000000..c377b607d4
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeList.java
@@ -0,0 +1,353 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.jena.datatypes.DatatypeFormatException;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.impl.LiteralLabel;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.ExprNotComparableException;
+import org.apache.jena.sparql.expr.NodeValue;
+
+public class CompositeDatatypeList extends CompositeDatatypeBase<List<CDTValue>>
+{
+ public final static String uri = "http://w3id.org/awslabs/neptune/SPARQL-CDTs/List";
+ public final static CompositeDatatypeList type = new CompositeDatatypeList();
+
+ protected CompositeDatatypeList() {}
+
+ @Override
+ public String getURI() {
+ return uri;
+ }
+
+ @Override
+ public boolean isValidValue( final Object value ) {
+ if ( !(value instanceof List<?>) ) {
+ return false;
+ }
+
+ final List<?> l = (List<?>) value;
+ for ( final Object e : l ) {
+ if ( !(e instanceof CDTValue) ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public boolean isValidLiteral( final LiteralLabel lit ) {
+ final String dtURI = lit.getDatatypeURI();
+ if ( dtURI == null || ! dtURI.equals(uri) ) {
+ return false;
+ }
+
+ final String lang = lit.language();
+ if ( lang != null && ! lang.isEmpty() ) {
+ return false;
+ }
+
+ final String lex = lit.getLexicalForm();
+ return isValid(lex);
+ }
+
+ @Override
+ public boolean isValid( final String lexicalForm ) {
+ try {
+ ParserForCDTLiterals.parseListLiteral(lexicalForm);
+ return true;
+ }
+ catch ( final Exception ex ) {
+ return false;
+ }
+ }
+
+ @Override
+ public List<CDTValue> parse( final String lexicalForm ) throws DatatypeFormatException {
+ try {
+ return ParserForCDTLiterals.parseListLiteral(lexicalForm);
+ }
+ catch ( final Exception ex ) {
+ throw new DatatypeFormatException(lexicalForm, type, ex);
+ }
+ }
+
+ @Override
+ public String unparse( final Object value ) {
+ if ( !(value instanceof List<?>) ) {
+ throw new IllegalArgumentException();
+ }
+
+ @SuppressWarnings("unchecked")
+ final List<CDTValue> list = (List<CDTValue>) value;
+
+ return unparseValue(list);
+ }
+
+ @Override
+ public String unparseValue( final List<CDTValue> list ) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("[");
+ if ( ! list.isEmpty() ) {
+ final Iterator<CDTValue> it = list.iterator();
+ final CDTValue firstElmt = it.next();
+ final String firstElmtAsString = unparseListElement(firstElmt);
+ sb.append(firstElmtAsString);
+ while ( it.hasNext() ) {
+ final CDTValue nextElmt = it.next();
+ final String nextElmtAsString = unparseListElement(nextElmt);
+ sb.append(", ");
+ sb.append(nextElmtAsString);
+ }
+ }
+ sb.append("]");
+ return sb.toString();
+ }
+
+ protected String unparseListElement( final CDTValue elmt ) {
+ return elmt.asLexicalForm();
+ }
+
+ @Override
+ public int getHashCode( final LiteralLabel lit ) {
+ return lit.hashCode();
+ }
+
+ @Override
+ public boolean isEqual( final LiteralLabel value1, final LiteralLabel value2 ) {
+ if ( ! isListLiteral(value1) || ! isListLiteral(value2) ) {
+ return false;
+ }
+
+ final List<CDTValue> list1 = getValue(value1);
+ final List<CDTValue> list2 = getValue(value2);
+
+ if ( list1.size() != list2.size() ) return false;
+ if ( list1.isEmpty() ) return true;
+
+ final Iterator<CDTValue> it1 = list1.iterator();
+ final Iterator<CDTValue> it2 = list2.iterator();
+ while ( it1.hasNext() ) {
+ final CDTValue v1 = it1.next();
+ final CDTValue v2 = it2.next();
+
+ if ( v1.isNull() || v2.isNull() ) {
+ if ( ! v1.isNull() || ! v2.isNull() ) {
+ return false;
+ }
+ }
+ else {
+ final Node n1 = v1.asNode();
+ final Node n2 = v2.asNode();
+
+ if ( n1.isBlank() || n2.isBlank() ) {
+ // If at least one of the two elements is a blank node,
+ // throw an error unless both elements are *the same*
+ // blank node.
+ if ( ! n1.equals(n2) ) {
+ throw new ExprEvalException("blank nodes in lists cannot be compared");
+ }
+ }
+
+ if ( ! n1.sameValueAs(n2) ) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Assumes that the datatype of both of the given literals is cdt:List.
+ * If 'sortOrderingCompare' is true, the two lists are compared as per the
+ * semantics for ORDER BY. If 'sortOrderingCompare' is false, the comparison
+ * applies the list-less-than semantics.
+ */
+ public static int compare( final LiteralLabel value1, final LiteralLabel value2, final boolean sortOrderingCompare ) throws ExprNotComparableException {
+ // Verify first that both literals are well-formed. If at least one of
+ // them is not well-formed, then their relative order is undefined.
+ if ( ! value1.isWellFormed() || ! value2.isWellFormed() )
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+
+ final List<CDTValue> list1;
+ final List<CDTValue> list2;
+ try {
+ list1 = getValue(value1);
+ list2 = getValue(value2);
+ }
+ catch ( final Exception e ) {
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+
+ // If at least one of the two lists is empty, then we can decide their
+ // relative order without a pair-wise comparison of the list elements.
+ if ( list1.isEmpty() || list2.isEmpty() ) {
+ // The literal with the non-empty list is greater
+ // than the literal with the empty list.
+ if ( ! list1.isEmpty() ) return Expr.CMP_GREATER;
+ if ( ! list2.isEmpty() ) return Expr.CMP_LESS;
+
+ // If both lists are empty, under the ORDER BY semantics we then
+ // decide the order based on the lexical forms, and under the
+ // list-less-than semantics, both literals are considered equal.
+ if ( sortOrderingCompare )
+ return compareByLexicalForms(value1, value2);
+ else
+ return Expr.CMP_EQUAL;
+ }
+
+ // Now we go into the pair-wise comparison of the list elements.
+ final int n = Math.min( list1.size(), list2.size() );
+ for ( int i = 0; i < n; i++ ) {
+ final CDTValue elmt1 = list1.get(i);
+ final CDTValue elmt2 = list2.get(i);
+
+ if ( ! elmt1.isNull() && ! elmt2.isNull() ) {
+ final NodeValue nv1 = NodeValue.makeNode( elmt1.asNode() );
+ final NodeValue nv2 = NodeValue.makeNode( elmt2.asNode() );
+
+ if ( ! sortOrderingCompare && nv1.isBlank() && nv2.isBlank() ) {
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+
+ // Compare the values represented by the two list elements
+ // in terms of which of them is greater than the other one.
+ try {
+ final int c;
+ if ( sortOrderingCompare )
+ c = NodeValue.compareAlways(nv1, nv2);
+ else
+ c = NodeValue.compare(nv1, nv2);
+
+ // If one of the two values is greater than the other one,
+ // return this result as the result for comparing the two
+ // lists.
+ if ( c < 0 ) return Expr.CMP_LESS;
+ if ( c > 0 ) return Expr.CMP_GREATER;
+ }
+ catch ( final Exception e ) {
+ // If the comparison failed, simply move on to the
+ // next code block (i.e., nothing to do here).
+ }
+
+ // If the comparison of nv1 and nv2 failed with an exception
+ // or none of them is greater than the other, we test whether
+ // they are the same value (i.e., comparing them using =
+ // results in true).
+ boolean sameValueTestResult = false;
+ boolean sameValueTestFailed = false;
+ try {
+ sameValueTestResult = NodeValue.sameValueAs(nv1, nv2);
+ }
+ catch ( final Exception e ) {
+ sameValueTestFailed = true;
+ }
+
+ // If nv1 and nv2 are not the same value or testing whether
+ // they are the same value failed, we can terminate the whole
+ // comparison (as being done in the following if block).
+ // If, however, nv1 and nv2 are indeed the same value (in which
+ // case the following if condition is not true), we continue to
+ // the next pair of list elements.
+ if ( sameValueTestFailed == true || sameValueTestResult == false ) {
+ if ( sortOrderingCompare )
+ return Expr.CMP_INDETERMINATE;
+ else
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+ }
+ else {
+ // This else-branch covers cases in which at least one of the
+ // two list elements is null.
+ if ( ! sortOrderingCompare ) {
+ // When comparing as per the list-less-than semantics,
+ // null cannot be compared to anything other than null.
+ if ( ! elmt1.isNull() || ! elmt2.isNull() )
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+ else {
+ // When comparing as per the ORDER BY semantics, nulls are
+ // ordered the same. Hence, if both elements are null, we
+ // don't do anything here and simply advance to the next
+ // pair of elements.
+ // However, if only one of the two elements is null, then
+ // the literal with this element is ordered lower than the
+ // other literal.
+ if ( elmt1.isNull() && ! elmt2.isNull() )
+ return Expr.CMP_LESS;
+
+ if ( elmt2.isNull() && ! elmt1.isNull() )
+ return Expr.CMP_GREATER;
+ }
+ }
+ }
+
+ // At this point, the pair-wise comparison of list elements has not
+ // led to any decision. Now, we decide based on the size of the lists.
+ final int sizeDiff = list1.size() - list2.size();
+ if ( sizeDiff < 0 ) return Expr.CMP_LESS;
+ if ( sizeDiff > 0 ) return Expr.CMP_GREATER;
+
+ if ( sortOrderingCompare )
+ return compareByLexicalForms(value1, value2);
+ else
+ return Expr.CMP_EQUAL;
+ }
+
+ /**
+ * Returns true if the given node is a literal with {@link #uri}
+ * as its datatype URI. Notice that this does not mean that this
+ * literal is actually valid; for checking validity, use
+ * {@link #isValidLiteral(LiteralLabel)}.
+ */
+ public static boolean isListLiteral( final Node n ) {
+ return n.isLiteral() && n.getLiteralDatatypeURI().equals(uri);
+ }
+
+ /**
+ * Returns true if the datatype URI of the given literal is {@link #uri}.
+ * Notice that this does not mean that this literal is actually valid;
+ * for checking validity, use {@link #isValidLiteral(LiteralLabel)}.
+ */
+ public static boolean isListLiteral( final LiteralLabel lit ) {
+ return lit.getDatatypeURI().equals(uri);
+ }
+
+ /**
+ * Assumes that the datatype of the given literal is cdt:List.
+ */
+ public static List<CDTValue> getValue( final LiteralLabel lit ) throws DatatypeFormatException {
+ final Object value = lit.getValue();
+ if ( value == null || ! (value instanceof List<?>) ) {
+ throw new IllegalArgumentException( lit.toString() + " - " + value );
+ }
+
+ @SuppressWarnings("unchecked")
+ final List<CDTValue> list = (List<CDTValue>) value;
+ return list;
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeMap.java b/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeMap.java
new file mode 100644
index 0000000000..d3070127f9
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/CompositeDatatypeMap.java
@@ -0,0 +1,413 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeSet;
+
+import org.apache.jena.datatypes.DatatypeFormatException;
+import org.apache.jena.datatypes.xsd.impl.RDFLangString;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.impl.LiteralLabel;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.ExprNotComparableException;
+import org.apache.jena.sparql.expr.NodeValue;
+
+public class CompositeDatatypeMap extends CompositeDatatypeBase<Map<CDTKey,CDTValue>>
+{
+ public final static String uri = "http://w3id.org/awslabs/neptune/SPARQL-CDTs/Map";
+ public final static CompositeDatatypeMap type = new CompositeDatatypeMap();
+
+ protected CompositeDatatypeMap() {}
+
+ @Override
+ public String getURI() {
+ return uri;
+ }
+
+ @Override
+ public boolean isValidValue( final Object value ) {
+ if ( !(value instanceof Map<?,?>) ) {
+ return false;
+ }
+
+ final Map<?,?> m = (Map<?,?>) value;
+ for ( final Map.Entry<?,?> e : m.entrySet() ) {
+ if ( !(e.getKey() instanceof CDTKey) ) {
+ return false;
+ }
+ if ( !(e.getValue() instanceof CDTValue) ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public boolean isValidLiteral( final LiteralLabel lit ) {
+ final String dtURI = lit.getDatatypeURI();
+ if ( dtURI == null || ! dtURI.equals(uri) ) {
+ return false;
+ }
+
+ final String lang = lit.language();
+ if ( lang != null && ! lang.isEmpty() ) {
+ return false;
+ }
+
+ final String lex = lit.getLexicalForm();
+ return isValid(lex);
+ }
+
+ @Override
+ public boolean isValid( final String lexicalForm ) {
+ try {
+ ParserForCDTLiterals.parseMapLiteral(lexicalForm);
+ return true;
+ }
+ catch ( final Exception ex ) {
+ return false;
+ }
+ }
+
+ @Override
+ public Map<CDTKey,CDTValue> parse( final String lexicalForm ) throws DatatypeFormatException {
+ try {
+ return ParserForCDTLiterals.parseMapLiteral(lexicalForm);
+ }
+ catch ( final Exception ex ) {
+ throw new DatatypeFormatException(lexicalForm, type, ex);
+ }
+ }
+
+ @Override
+ public String unparse( final Object value ) {
+ if ( !(value instanceof Map<?,?>) ) {
+ throw new IllegalArgumentException();
+ }
+
+ @SuppressWarnings("unchecked")
+ final Map<CDTKey,CDTValue> map = (Map<CDTKey,CDTValue>) value;
+
+ return unparseValue(map);
+ }
+
+ @Override
+ public String unparseValue( final Map<CDTKey,CDTValue> map ) {
+ final StringBuilder sb = new StringBuilder();
+ sb.append("{");
+ if ( ! map.isEmpty() ) {
+ final Iterator<Map.Entry<CDTKey,CDTValue>> it = map.entrySet().iterator();
+
+ final Map.Entry<CDTKey,CDTValue> firstEntry = it.next();
+ unparseMapEntry(firstEntry, sb);
+
+ while ( it.hasNext() ) {
+ sb.append(", ");
+
+ final Map.Entry<CDTKey,CDTValue> nextEntry = it.next();
+ unparseMapEntry(nextEntry, sb);
+ }
+ }
+
+ sb.append("}");
+ return sb.toString();
+ }
+
+ protected void unparseMapEntry( final Map.Entry<CDTKey,CDTValue> entry, final StringBuilder sb ) {
+ sb.append( entry.getKey().asLexicalForm() );
+ sb.append(" : ");
+ sb.append( entry.getValue().asLexicalForm() );
+ }
+
+ @Override
+ public int getHashCode( final LiteralLabel lit ) {
+ return lit.hashCode();
+ }
+
+ @Override
+ public boolean isEqual( final LiteralLabel lit1, final LiteralLabel lit2 ) {
+ if ( ! isMapLiteral(lit1) || ! isMapLiteral(lit2) ) {
+ return false;
+ }
+
+ final Map<CDTKey,CDTValue> map1 = getValue(lit1);
+ final Map<CDTKey,CDTValue> map2 = getValue(lit2);
+
+ if ( map1.size() != map2.size() ) return false;
+
+ for ( final Map.Entry<CDTKey,CDTValue> entry1 : map1.entrySet() ) {
+ final CDTValue v1 = entry1.getValue();
+ final CDTValue v2 = map2.get( entry1.getKey() );
+ if ( v2 == null ) return false;
+
+ if ( v1.isNull() || v2.isNull() ) {
+ if ( ! v1.isNull() || ! v2.isNull() ) {
+ return false;
+ }
+ }
+ else {
+ final Node n1 = v1.asNode();
+ final Node n2 = v2.asNode();
+
+ if ( n1.isBlank() || n2.isBlank() ) {
+ // If at least one of the two elements is a blank node,
+ // throw an error unless both elements are *the same*
+ // blank node.
+ if ( ! n1.equals(n2) ) {
+ throw new ExprEvalException("blank nodes in maps cannot be compared");
+ }
+ }
+
+ if ( ! n1.sameValueAs(n2) ) return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Assumes that the datatype of both of the given literals is cdt:Map.
+ *
+ * If 'sortOrderingCompare' is true, the two maps are compared as per the
+ * semantics for ORDER BY. If 'sortOrderingCompare' is false, the comparison
+ * applies the map-less-than semantics.
+ */
+ public static int compare( final LiteralLabel value1, final LiteralLabel value2, final boolean sortOrderingCompare ) throws ExprNotComparableException {
+ // Verify first that both literals are well-formed. If at least one of
+ // them is not well-formed, then their relative order is undefined.
+ if ( ! value1.isWellFormed() || ! value2.isWellFormed() )
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+
+ final Map<CDTKey,CDTValue> map1;
+ final Map<CDTKey,CDTValue> map2;
+ try {
+ map1 = getValue(value1);
+ map2 = getValue(value2);
+ }
+ catch ( final Exception e ) {
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+
+ // If at least one of the two maps is empty, then we can decide their
+ // relative order without a pair-wise comparison of the map entries.
+ if ( map1.isEmpty() || map2.isEmpty() ) {
+ // The literal with the non-empty map is greater
+ // than the literal with the empty map.
+ if ( ! map1.isEmpty() ) return Expr.CMP_GREATER;
+ if ( ! map2.isEmpty() ) return Expr.CMP_LESS;
+
+ // If both maps are empty, under the ORDER BY semantics we then
+ // decide the order based on the lexical forms, and under the
+ // map-less-than semantics, both literals are considered equal.
+ if ( sortOrderingCompare )
+ return compareByLexicalForms(value1, value2);
+ else
+ return Expr.CMP_EQUAL;
+ }
+
+ // Now we go into the pair-wise comparison of the map entries.
+ // To this end, we first need to sort the map entries.
+ final CDTKeySorter keySorter = new CDTKeySorter();
+ final TreeSet<CDTKey> sortedKeys1 = new TreeSet<>(keySorter);
+ final TreeSet<CDTKey> sortedKeys2 = new TreeSet<>(keySorter);
+ sortedKeys1.addAll( map1.keySet() );
+ sortedKeys2.addAll( map2.keySet() );
+
+ // Now we can perform the pair-wise comparison of the map entries.
+ final Iterator<CDTKey> it1 = sortedKeys1.iterator();
+ final Iterator<CDTKey> it2 = sortedKeys2.iterator();
+ final int n = Math.min( sortedKeys1.size(), sortedKeys2.size() );
+ for ( int i = 0; i < n; i++ ) {
+ final CDTKey k1 = it1.next();
+ final CDTKey k2 = it2.next();
+
+ final int kCmp = keySorter.compare(k1, k2);
+ if ( kCmp < 0 ) return Expr.CMP_LESS;
+ if ( kCmp > 0 ) return Expr.CMP_GREATER;
+
+ final CDTValue v1 = map1.get(k1);
+ final CDTValue v2 = map2.get(k2);
+ if ( ! v1.isNull() && ! v2.isNull() ) {
+ final NodeValue nv1 = NodeValue.makeNode( v1.asNode() );
+ final NodeValue nv2 = NodeValue.makeNode( v2.asNode() );
+
+ // Compare the actual values represented by the two map values
+ // in terms of which of them is greater than the other one.
+ try {
+ final int c;
+ if ( sortOrderingCompare )
+ c = NodeValue.compareAlways(nv1, nv2);
+ else
+ c = NodeValue.compare(nv1, nv2);
+
+ // If one of the two values is greater than the other one,
+ // return this result as the result for comparing the two
+ // maps.
+ if ( c < 0 ) return Expr.CMP_LESS;
+ if ( c > 0 ) return Expr.CMP_GREATER;
+ }
+ catch ( final Exception e ) {
+ // If the comparison failed, simply move on to the
+ // next code block (i.e., nothing to do here).
+ }
+
+ // If the comparison of nv1 and nv2 failed with an exception
+ // or none of them is greater than the other, we test whether
+ // they are the same value (i.e., comparing them using =
+ // results in true).
+ boolean sameValueTestResult = false;
+ boolean sameValueTestFailed = false;
+ try {
+ sameValueTestResult = NodeValue.sameValueAs(nv1, nv2);
+ }
+ catch ( final Exception e ) {
+ sameValueTestFailed = true;
+ }
+
+ // If nv1 and nv2 are not the same value or testing whether
+ // they are the same value failed, we can terminate the whole
+ // comparison (as being done in the following if block).
+ // If, however, nv1 and nv2 are indeed the same value (in which
+ // case the following if condition is not true), we continue to
+ // the next pair of map entries.
+ if ( sameValueTestFailed == true || sameValueTestResult == false ) {
+ if ( sortOrderingCompare )
+ return Expr.CMP_INDETERMINATE;
+ else
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+ }
+ else {
+ // This else-branch covers cases in which at least one of the
+ // two map entries has null as its value.
+ if ( ! sortOrderingCompare ) {
+ // When comparing as per the map-less-than semantics,
+ // null cannot be compared to anything other than null.
+ if ( ! v1.isNull() || ! v2.isNull() )
+ throw new ExprNotComparableException("Can't compare "+value1+" and "+value2);
+ }
+ else {
+ // When comparing as per the ORDER BY semantics, nulls are
+ // ordered the same. Hence, if both map entries have null
+ // as their value, we don't do anything here and simply
+ // advance to the next pair of map entries.
+ // However, if the map value of only one of the two map
+ // entries is null, then the literal with this map entry
+ // is ordered lower than the other literal.
+ if ( v1.isNull() && ! v2.isNull() )
+ return Expr.CMP_LESS;
+
+ if ( v2.isNull() && ! v1.isNull() )
+ return Expr.CMP_GREATER;
+ }
+ }
+ }
+
+ // At this point, the pair-wise comparison of map entries has not led
+ // to any decision. Now, we decide based on the size of the maps.
+ final int sizeDiff = map1.size() - map2.size();
+ if ( sizeDiff < 0 ) return Expr.CMP_LESS;
+ if ( sizeDiff > 0 ) return Expr.CMP_GREATER;
+
+ if ( sortOrderingCompare )
+ return compareByLexicalForms(value1, value2);
+ else
+ return Expr.CMP_EQUAL;
+ }
+
+ /**
+ * Returns true if the given node is a literal with {@link #uri}
+ * as its datatype URI. Notice that this does not mean that this
+ * literal is actually valid; for checking validity, use
+ * {@link #isValidLiteral(LiteralLabel)}.
+ */
+ public static boolean isMapLiteral( final Node n ) {
+ return n.isLiteral() && n.getLiteralDatatypeURI().equals(uri);
+ }
+
+ /**
+ * Returns true if the datatype URI of the given {@link LiteralLabel} is
+ * {@link #uri}. Notice that this does not mean that this LiteralLabel is
+ * actually valid; for checking validity, use {@link #isValidLiteral(LiteralLabel)}.
+ */
+ public static boolean isMapLiteral( final LiteralLabel lit ) {
+ return lit.getDatatypeURI().equals(uri);
+ }
+
+ /**
+ * Assumes that the datatype of the given literal is cdt:Map.
+ */
+ public static Map<CDTKey,CDTValue> getValue( final LiteralLabel lit ) throws DatatypeFormatException {
+ final Object value = lit.getValue();
+ if ( value == null || ! (value instanceof Map<?,?>) ) {
+ throw new IllegalArgumentException( lit.toString() + " - " + value );
+ }
+
+ @SuppressWarnings("unchecked")
+ final Map<CDTKey,CDTValue> map = (Map<CDTKey,CDTValue>) value;
+ return map;
+ }
+
+ protected static class CDTKeySorter implements Comparator<CDTKey> {
+ @Override
+ public int compare( final CDTKey k1, final CDTKey k2 ) {
+ final Node n1 = k1.asNode();
+ final Node n2 = k2.asNode();
+
+ if ( n1.isURI() ) {
+ if ( ! n2.isURI() ) {
+ return Expr.CMP_LESS;
+ }
+
+ final String uri1 = n1.getURI();
+ final String uri2 = n2.getURI();
+ return uri1.compareTo(uri2);
+ }
+ else if ( n2.isURI() ) {
+ return Expr.CMP_GREATER;
+ }
+
+ // at this point, both RDF terms (n1 and n2) should be literals
+ final String dt1 = n1.getLiteralDatatypeURI();
+ final String dt2 = n2.getLiteralDatatypeURI();
+ final int dtCmp = dt1.compareTo(dt2);
+ if ( dtCmp != 0 ) {
+ return dtCmp;
+ }
+
+ final String lex1 = n1.getLiteralLexicalForm();
+ final String lex2 = n2.getLiteralLexicalForm();
+ final int lexCmp = lex1.compareTo(lex2);
+ if ( lexCmp != 0 || ! RDFLangString.rdfLangString.getURI().equals(dt1) ) {
+ return lexCmp;
+ }
+
+ // at this point, both literals are rdf:LangString literals with the same value
+ final String lang1 = n1.getLiteralLanguage();
+ final String lang2 = n2.getLiteralLanguage();
+ return lang1.compareTo(lang2);
+ }
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java b/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java
new file mode 100644
index 0000000000..28b376f7f4
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.cdt.parser.CDTLiteralParser;
+import org.apache.jena.cdt.parser.ParseException;
+import org.apache.jena.cdt.parser.TokenMgrError;
+import org.apache.jena.riot.system.ParserProfile;
+import org.apache.jena.riot.system.RiotLib;
+
+public class ParserForCDTLiterals
+{
+ public static List<CDTValue> parseListLiteral( final String lex ) {
+ return parseListLiteral( RiotLib.dftProfile(), lex );
+ }
+
+ public static List<CDTValue> parseListLiteral( final ParserProfile pp, final String lex ) {
+ final Reader reader = new StringReader(lex);
+ final List<CDTValue> result = parseListLiteral(pp, reader);
+
+ try { reader.close(); } catch ( final IOException e ) {
+ throw new CDTLiteralParseException("Closing the reader caused an exception.", e);
+ }
+
+ return result;
+ }
+
+ public static List<CDTValue> parseListLiteral( final Reader reader ) {
+ return parseListLiteral( RiotLib.dftProfile(), reader );
+ }
+
+ public static List<CDTValue> parseListLiteral( final ParserProfile pp, final Reader reader ) {
+ final CDTLiteralParser parser = new CDTLiteralParser(reader);
+ parser.setProfile(pp);
+
+ final List<CDTValue> list;
+ try {
+ list = parser.List();
+ }
+ catch ( final ParseException | TokenMgrError ex ) {
+ throw new CDTLiteralParseException( ex.getMessage() );
+ }
+ catch ( final CDTLiteralParseException ex ) {
+ throw ex;
+ }
+ catch ( final Throwable th ) {
+ throw new CDTLiteralParseException( th.getMessage(), th );
+ }
+
+ return list;
+ }
+
+ public static Map<CDTKey,CDTValue> parseMapLiteral( final String lex ) {
+ return parseMapLiteral( RiotLib.dftProfile(), lex );
+ }
+
+ public static Map<CDTKey,CDTValue> parseMapLiteral( final ParserProfile pp, final String lex ) {
+ final Reader reader = new StringReader(lex);
+ final Map<CDTKey,CDTValue> result = parseMapLiteral(pp, reader);
+
+ try { reader.close(); } catch ( final IOException e ) {
+ throw new CDTLiteralParseException("Closing the reader caused an exception.", e);
+ }
+
+ return result;
+ }
+
+ public static Map<CDTKey,CDTValue> parseMapLiteral( final Reader reader ) {
+ return parseMapLiteral( RiotLib.dftProfile(), reader );
+ }
+
+ public static Map<CDTKey,CDTValue> parseMapLiteral( final ParserProfile pp, final Reader reader ) {
+ final CDTLiteralParser parser = new CDTLiteralParser(reader);
+ parser.setProfile(pp);
+
+ final Map<CDTKey,CDTValue> map;
+ try {
+ map = parser.Map();
+ }
+ catch ( final ParseException | TokenMgrError ex ) {
+ throw new CDTLiteralParseException( ex.getMessage() );
+ }
+ catch ( final CDTLiteralParseException ex ) {
+ throw ex;
+ }
+ catch ( final Throwable th ) {
+ throw new CDTLiteralParseException( th.getMessage(), th );
+ }
+
+ return map;
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java
new file mode 100644
index 0000000000..febae9906b
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java
@@ -0,0 +1,560 @@
+/* Generated By:JavaCC: Do not edit this line. CDTLiteralParser.java */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.cdt.*;
+import org.apache.jena.graph.Node;
+
+import static org.apache.jena.riot.lang.extra.LangParserLib.*;
+
+public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteralParserConstants {
+
+// --- Entry point for cdt:List literals
+ final public List<CDTValue> List() throws ParseException {
+ List<CDTValue> l = new ArrayList<CDTValue>();
+ jj_consume_token(LBRACKET);
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case TRUE:
+ case FALSE:
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ case IRIref:
+ case BLANK_NODE_LABEL:
+ case NULL:
+ case LBRACE:
+ case LBRACKET:
+ NonEmptyListContent(l);
+ break;
+ default:
+ jj_la1[0] = jj_gen;
+ ;
+ }
+ jj_consume_token(RBRACKET);
+ {if (true) return l;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public void NonEmptyListContent(List<CDTValue> l) throws ParseException {
+ ListElement(l);
+ label_1:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case COMMA:
+ ;
+ break;
+ default:
+ jj_la1[1] = jj_gen;
+ break label_1;
+ }
+ jj_consume_token(COMMA);
+ ListElement(l);
+ }
+ }
+
+ final public void ListElement(List<CDTValue> l) throws ParseException {
+ String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IRIref:
+ iri = IRI_REF();
+ n = createURI(iri, token.beginLine, token.beginColumn); l.add( CDTFactory.createValue(n) );
+ break;
+ case BLANK_NODE_LABEL:
+ n = BlankNode();
+ l.add( CDTFactory.createValue(n) );
+ break;
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ n = RDFLiteral();
+ l.add( CDTFactory.createValue(n) );
+ break;
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:
+ n = NumericLiteral();
+ l.add( CDTFactory.createValue(n) );
+ break;
+ case TRUE:
+ case FALSE:
+ n = BooleanLiteral();
+ l.add( CDTFactory.createValue(n) );
+ break;
+ case NULL:
+ jj_consume_token(NULL);
+ l.add( CDTFactory.getNullValue() );
+ break;
+ case LBRACKET:
+ subList = List();
+ l.add( CDTFactory.createValue(subList) );
+ break;
+ case LBRACE:
+ m = Map();
+ l.add( CDTFactory.createValue(m) );
+ break;
+ default:
+ jj_la1[2] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ }
+
+// --- Entry point for cdt:Map literals
+ final public Map<CDTKey,CDTValue> Map() throws ParseException {
+ Map<CDTKey,CDTValue> m = new HashMap<CDTKey,CDTValue>();
+ jj_consume_token(LBRACE);
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case TRUE:
+ case FALSE:
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ case IRIref:
+ NonEmptyMapContent(m);
+ break;
+ default:
+ jj_la1[3] = jj_gen;
+ ;
+ }
+ jj_consume_token(RBRACE);
+ {if (true) return m;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public void NonEmptyMapContent(Map<CDTKey,CDTValue> m) throws ParseException {
+ MapEntry(m);
+ label_2:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case COMMA:
+ ;
+ break;
+ default:
+ jj_la1[4] = jj_gen;
+ break label_2;
+ }
+ jj_consume_token(COMMA);
+ MapEntry(m);
+ }
+ }
+
+ final public void MapEntry(Map<CDTKey,CDTValue> m) throws ParseException {
+ CDTKey key; CDTValue value;
+ key = MapKey();
+ jj_consume_token(COLON);
+ value = MapValue();
+ final CDTValue oldValue = m.put(key, value);
+ if ( oldValue != null ) {if (true) throw new ParseException("map with non-unique key (" + key.toString() + ")");}
+ }
+
+ final public CDTKey MapKey() throws ParseException {
+ String iri; Node n;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IRIref:
+ iri = IRI_REF();
+ n = createURI(iri, token.beginLine, token.beginColumn); {if (true) return CDTFactory.createKey(n);}
+ break;
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ n = RDFLiteral();
+ {if (true) return CDTFactory.createKey(n);}
+ break;
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:
+ n = NumericLiteral();
+ {if (true) return CDTFactory.createKey(n);}
+ break;
+ case TRUE:
+ case FALSE:
+ n = BooleanLiteral();
+ {if (true) return CDTFactory.createKey(n);}
+ break;
+ default:
+ jj_la1[5] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public CDTValue MapValue() throws ParseException {
+ String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IRIref:
+ iri = IRI_REF();
+ n = createURI(iri, token.beginLine, token.beginColumn); {if (true) return CDTFactory.createValue(n);}
+ break;
+ case BLANK_NODE_LABEL:
+ n = BlankNode();
+ {if (true) return CDTFactory.createValue(n);}
+ break;
+ case STRING_LITERAL1:
+ case STRING_LITERAL2:
+ case STRING_LITERAL_LONG1:
+ case STRING_LITERAL_LONG2:
+ n = RDFLiteral();
+ {if (true) return CDTFactory.createValue(n);}
+ break;
+ case INTEGER:
+ case DECIMAL:
+ case DOUBLE:
+ n = NumericLiteral();
+ {if (true) return CDTFactory.createValue(n);}
+ break;
+ case TRUE:
+ case FALSE:
+ n = BooleanLiteral();
+ {if (true) return CDTFactory.createValue(n);}
+ break;
+ case NULL:
+ jj_consume_token(NULL);
+ {if (true) return CDTFactory.getNullValue();}
+ break;
+ case LBRACKET:
+ subList = List();
+ {if (true) return CDTFactory.createValue(subList);}
+ break;
+ case LBRACE:
+ m = Map();
+ {if (true) return CDTFactory.createValue(m);}
+ break;
+ default:
+ jj_la1[6] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+// ---- Basic terms
+ final public String IRI_REF() throws ParseException {
+ Token t ;
+ t = jj_consume_token(IRIref);
+ {if (true) return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node BlankNode() throws ParseException {
+ Token t = null ;
+ t = jj_consume_token(BLANK_NODE_LABEL);
+ {if (true) return createBNode(t.image, t.beginLine, t.beginColumn);}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node NumericLiteral() throws ParseException {
+ Token t ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case INTEGER:
+ t = jj_consume_token(INTEGER);
+ {if (true) return createLiteralInteger(t.image, t.beginLine, t.beginColumn);}
+ break;
+ case DECIMAL:
+ t = jj_consume_token(DECIMAL);
+ {if (true) return createLiteralDecimal(t.image, t.beginLine, t.beginColumn);}
+ break;
+ case DOUBLE:
+ t = jj_consume_token(DOUBLE);
+ {if (true) return createLiteralDouble(t.image, t.beginLine, t.beginColumn);}
+ break;
+ default:
+ jj_la1[7] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node BooleanLiteral() throws ParseException {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case TRUE:
+ jj_consume_token(TRUE);
+ {if (true) return XSD_TRUE;}
+ break;
+ case FALSE:
+ jj_consume_token(FALSE);
+ {if (true) return XSD_FALSE;}
+ break;
+ default:
+ jj_la1[8] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ throw new Error("Missing return statement in function");
+ }
+
+ final public Node RDFLiteral() throws ParseException {
+ String lex = null ;
+ lex = String();
+ String lang = null ; String dt = null ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case LANGTAG:
+ case DATATYPE:
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case LANGTAG:
+ lang = Langtag();
+ break;
+ case DATATYPE:
+ jj_consume_token(DATATYPE);
+ dt = IRI_REF();
+ break;
+ default:
+ jj_la1[9] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ break;
+ default:
+ jj_la1[10] = jj_gen;
+ ;
+ }
+ {if (true) return createLiteral(lex, lang, dt, token.beginLine, token.beginColumn);}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String Langtag() throws ParseException {
+ Token t ;
+ t = jj_consume_token(LANGTAG);
+ String lang = stripChars(t.image, 1) ; {if (true) return lang ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ final public String String() throws ParseException {
+ Token t ; String lex ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case STRING_LITERAL1:
+ t = jj_consume_token(STRING_LITERAL1);
+ lex = stripQuotes(t.image) ;
+ break;
+ case STRING_LITERAL2:
+ t = jj_consume_token(STRING_LITERAL2);
+ lex = stripQuotes(t.image) ;
+ break;
+ case STRING_LITERAL_LONG1:
+ t = jj_consume_token(STRING_LITERAL_LONG1);
+ lex = stripQuotes3(t.image) ;
+ break;
+ case STRING_LITERAL_LONG2:
+ t = jj_consume_token(STRING_LITERAL_LONG2);
+ lex = stripQuotes3(t.image) ;
+ break;
+ default:
+ jj_la1[11] = jj_gen;
+ jj_consume_token(-1);
+ throw new ParseException();
+ }
+ lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
+ {if (true) return lex ;}
+ throw new Error("Missing return statement in function");
+ }
+
+ /** Generated Token Manager. */
+ public CDTLiteralParserTokenManager token_source;
+ JavaCharStream jj_input_stream;
+ /** Current token. */
+ public Token token;
+ /** Next token. */
+ public Token jj_nt;
+ private int jj_ntk;
+ private int jj_gen;
+ final private int[] jj_la1 = new int[12];
+ static private int[] jj_la1_0;
+ static private int[] jj_la1_1;
+ static {
+ jj_la1_init_0();
+ jj_la1_init_1();
+ }
+ private static void jj_la1_init_0() {
+ jj_la1_0 = new int[] {0x2c6f0f80,0x80000000,0x2c6f0f80,0x2f0f80,0x80000000,0x2f0f80,0x2c6f0f80,0xe00,0x180,0x800000,0x800000,0xf0000,};
+ }
+ private static void jj_la1_init_1() {
+ jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x2,0x0,};
+ }
+
+ /** Constructor with InputStream. */
+ public CDTLiteralParser(java.io.InputStream stream) {
+ this(stream, null);
+ }
+ /** Constructor with InputStream and supplied encoding */
+ public CDTLiteralParser(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new CDTLiteralParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ }
+
+ /** Constructor. */
+ public CDTLiteralParser(java.io.Reader stream) {
+ jj_input_stream = new JavaCharStream(stream, 1, 1);
+ token_source = new CDTLiteralParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader stream) {
+ jj_input_stream.ReInit(stream, 1, 1);
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ }
+
+ /** Constructor with generated Token Manager. */
+ public CDTLiteralParser(CDTLiteralParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ }
+
+ /** Reinitialise. */
+ public void ReInit(CDTLiteralParserTokenManager tm) {
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ }
+
+ private Token jj_consume_token(int kind) throws ParseException {
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
+ }
+
+
+/** Get the next Token. */
+ final public Token getNextToken() {
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
+ }
+
+/** Get the specific Token. */
+ final public Token getToken(int index) {
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
+ }
+
+ private int jj_ntk() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
+ }
+
+ private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
+ private int[] jj_expentry;
+ private int jj_kind = -1;
+
+ /** Generate ParseException. */
+ public ParseException generateParseException() {
+ jj_expentries.clear();
+ boolean[] la1tokens = new boolean[40];
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 12; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ if ((jj_la1_1[i] & (1<<j)) != 0) {
+ la1tokens[32+j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 40; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.add(jj_expentry);
+ }
+ }
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = jj_expentries.get(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ /** Enable tracing. */
+ final public void enable_tracing() {
+ }
+
+ /** Disable tracing. */
+ final public void disable_tracing() {
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserConstants.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserConstants.java
new file mode 100644
index 0000000000..804c8a99a5
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserConstants.java
@@ -0,0 +1,147 @@
+/* Generated By:JavaCC: Do not edit this line. CDTLiteralParserConstants.java */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
+
+
+/**
+ * Token literal values and constants.
+ * Generated by org.javacc.parser.OtherFilesGen#start()
+ */
+public interface CDTLiteralParserConstants {
+
+ /** End of File. */
+ int EOF = 0;
+ /** RegularExpression Id. */
+ int WS = 6;
+ /** RegularExpression Id. */
+ int TRUE = 7;
+ /** RegularExpression Id. */
+ int FALSE = 8;
+ /** RegularExpression Id. */
+ int INTEGER = 9;
+ /** RegularExpression Id. */
+ int DECIMAL = 10;
+ /** RegularExpression Id. */
+ int DOUBLE = 11;
+ /** RegularExpression Id. */
+ int EXPONENT = 12;
+ /** RegularExpression Id. */
+ int QUOTE_3D = 13;
+ /** RegularExpression Id. */
+ int QUOTE_3S = 14;
+ /** RegularExpression Id. */
+ int ECHAR = 15;
+ /** RegularExpression Id. */
+ int STRING_LITERAL1 = 16;
+ /** RegularExpression Id. */
+ int STRING_LITERAL2 = 17;
+ /** RegularExpression Id. */
+ int STRING_LITERAL_LONG1 = 18;
+ /** RegularExpression Id. */
+ int STRING_LITERAL_LONG2 = 19;
+ /** RegularExpression Id. */
+ int DIGITS = 20;
+ /** RegularExpression Id. */
+ int IRIref = 21;
+ /** RegularExpression Id. */
+ int BLANK_NODE_LABEL = 22;
+ /** RegularExpression Id. */
+ int LANGTAG = 23;
+ /** RegularExpression Id. */
+ int A2Z = 24;
+ /** RegularExpression Id. */
+ int A2ZN = 25;
+ /** RegularExpression Id. */
+ int NULL = 26;
+ /** RegularExpression Id. */
+ int LBRACE = 27;
+ /** RegularExpression Id. */
+ int RBRACE = 28;
+ /** RegularExpression Id. */
+ int LBRACKET = 29;
+ /** RegularExpression Id. */
+ int RBRACKET = 30;
+ /** RegularExpression Id. */
+ int COMMA = 31;
+ /** RegularExpression Id. */
+ int COLON = 32;
+ /** RegularExpression Id. */
+ int DATATYPE = 33;
+ /** RegularExpression Id. */
+ int AT = 34;
+ /** RegularExpression Id. */
+ int PN_CHARS_BASE = 35;
+ /** RegularExpression Id. */
+ int PN_CHARS_U = 36;
+ /** RegularExpression Id. */
+ int PN_CHARS = 37;
+ /** RegularExpression Id. */
+ int PN_LOCAL = 38;
+ /** RegularExpression Id. */
+ int UNKNOWN = 39;
+
+ /** Lexical state. */
+ int DEFAULT = 0;
+
+ /** Literal token values. */
+ String[] tokenImage = {
+ "<EOF>",
+ "\" \"",
+ "\"\\t\"",
+ "\"\\n\"",
+ "\"\\r\"",
+ "\"\\f\"",
+ "<WS>",
+ "\"true\"",
+ "\"false\"",
+ "<INTEGER>",
+ "<DECIMAL>",
+ "<DOUBLE>",
+ "<EXPONENT>",
+ "\"\\\"\\\"\\\"\"",
+ "\"\\\'\\\'\\\'\"",
+ "<ECHAR>",
+ "<STRING_LITERAL1>",
+ "<STRING_LITERAL2>",
+ "<STRING_LITERAL_LONG1>",
+ "<STRING_LITERAL_LONG2>",
+ "<DIGITS>",
+ "<IRIref>",
+ "<BLANK_NODE_LABEL>",
+ "<LANGTAG>",
+ "<A2Z>",
+ "<A2ZN>",
+ "\"null\"",
+ "\"{\"",
+ "\"}\"",
+ "\"[\"",
+ "\"]\"",
+ "\",\"",
+ "\":\"",
+ "\"^^\"",
+ "\"@\"",
+ "<PN_CHARS_BASE>",
+ "<PN_CHARS_U>",
+ "<PN_CHARS>",
+ "<PN_LOCAL>",
+ "<UNKNOWN>",
+ };
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java
new file mode 100644
index 0000000000..9f7b775c89
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java
@@ -0,0 +1,1045 @@
+/* Generated By:JavaCC: Do not edit this line. CDTLiteralParserTokenManager.java */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.jena.cdt.*;
+import org.apache.jena.graph.Node;
+import static org.apache.jena.riot.lang.extra.LangParserLib.*;
+
+/** Token Manager. */
+public class CDTLiteralParserTokenManager implements CDTLiteralParserConstants
+{
+
+ /** Debug output. */
+ public java.io.PrintStream debugStream = System.out;
+ /** Set debug output. */
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
+private int jjStopAtPos(int pos, int kind)
+{
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ return pos + 1;
+}
+private int jjMoveStringLiteralDfa0_0()
+{
+ switch(curChar)
+ {
+ case 9:
+ jjmatchedKind = 2;
+ return jjMoveNfa_0(0, 0);
+ case 10:
+ jjmatchedKind = 3;
+ return jjMoveNfa_0(0, 0);
+ case 12:
+ jjmatchedKind = 5;
+ return jjMoveNfa_0(0, 0);
+ case 13:
+ jjmatchedKind = 4;
+ return jjMoveNfa_0(0, 0);
+ case 32:
+ jjmatchedKind = 1;
+ return jjMoveNfa_0(0, 0);
+ case 44:
+ jjmatchedKind = 31;
+ return jjMoveNfa_0(0, 0);
+ case 58:
+ jjmatchedKind = 32;
+ return jjMoveNfa_0(0, 0);
+ case 64:
+ jjmatchedKind = 34;
+ return jjMoveNfa_0(0, 0);
+ case 70:
+ return jjMoveStringLiteralDfa1_0(0x100L);
+ case 84:
+ return jjMoveStringLiteralDfa1_0(0x80L);
+ case 91:
+ jjmatchedKind = 29;
+ return jjMoveNfa_0(0, 0);
+ case 93:
+ jjmatchedKind = 30;
+ return jjMoveNfa_0(0, 0);
+ case 94:
+ return jjMoveStringLiteralDfa1_0(0x200000000L);
+ case 102:
+ return jjMoveStringLiteralDfa1_0(0x100L);
+ case 110:
+ return jjMoveStringLiteralDfa1_0(0x4000000L);
+ case 116:
+ return jjMoveStringLiteralDfa1_0(0x80L);
+ case 123:
+ jjmatchedKind = 27;
+ return jjMoveNfa_0(0, 0);
+ case 125:
+ jjmatchedKind = 28;
+ return jjMoveNfa_0(0, 0);
+ default :
+ return jjMoveNfa_0(0, 0);
+ }
+}
+private int jjMoveStringLiteralDfa1_0(long active0)
+{
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 0);
+ }
+ switch(curChar)
+ {
+ case 65:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 82:
+ return jjMoveStringLiteralDfa2_0(active0, 0x80L);
+ case 94:
+ if ((active0 & 0x200000000L) != 0L)
+ {
+ jjmatchedKind = 33;
+ jjmatchedPos = 1;
+ }
+ break;
+ case 97:
+ return jjMoveStringLiteralDfa2_0(active0, 0x100L);
+ case 114:
+ return jjMoveStringLiteralDfa2_0(active0, 0x80L);
+ case 117:
+ return jjMoveStringLiteralDfa2_0(active0, 0x4000000L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 1);
+}
+private int jjMoveStringLiteralDfa2_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 1);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 1);
+ }
+ switch(curChar)
+ {
+ case 76:
+ return jjMoveStringLiteralDfa3_0(active0, 0x100L);
+ case 85:
+ return jjMoveStringLiteralDfa3_0(active0, 0x80L);
+ case 108:
+ return jjMoveStringLiteralDfa3_0(active0, 0x4000100L);
+ case 117:
+ return jjMoveStringLiteralDfa3_0(active0, 0x80L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 2);
+}
+private int jjMoveStringLiteralDfa3_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 2);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 2);
+ }
+ switch(curChar)
+ {
+ case 69:
+ if ((active0 & 0x80L) != 0L)
+ {
+ jjmatchedKind = 7;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 83:
+ return jjMoveStringLiteralDfa4_0(active0, 0x100L);
+ case 101:
+ if ((active0 & 0x80L) != 0L)
+ {
+ jjmatchedKind = 7;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 108:
+ if ((active0 & 0x4000000L) != 0L)
+ {
+ jjmatchedKind = 26;
+ jjmatchedPos = 3;
+ }
+ break;
+ case 115:
+ return jjMoveStringLiteralDfa4_0(active0, 0x100L);
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 3);
+}
+private int jjMoveStringLiteralDfa4_0(long old0, long active0)
+{
+ if (((active0 &= old0)) == 0L)
+ return jjMoveNfa_0(0, 3);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) {
+ return jjMoveNfa_0(0, 3);
+ }
+ switch(curChar)
+ {
+ case 69:
+ if ((active0 & 0x100L) != 0L)
+ {
+ jjmatchedKind = 8;
+ jjmatchedPos = 4;
+ }
+ break;
+ case 101:
+ if ((active0 & 0x100L) != 0L)
+ {
+ jjmatchedKind = 8;
+ jjmatchedPos = 4;
+ }
+ break;
+ default :
+ break;
+ }
+ return jjMoveNfa_0(0, 4);
+}
+static final long[] jjbitVec0 = {
+ 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec2 = {
+ 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec3 = {
+ 0xfffe7000fffffff6L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x7e00000000ffffffL
+};
+static final long[] jjbitVec4 = {
+ 0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec5 = {
+ 0x0L, 0xbfff000000000000L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec6 = {
+ 0x3000L, 0xffff000000000000L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec7 = {
+ 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
+};
+static final long[] jjbitVec8 = {
+ 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffL
+};
+static final long[] jjbitVec9 = {
+ 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffffL
+};
+static final long[] jjbitVec10 = {
+ 0x0L, 0x0L, 0x80000000000000L, 0xff7fffffff7fffffL
+};
+static final long[] jjbitVec11 = {
+ 0xffffffffffffffffL, 0xbfffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+static final long[] jjbitVec12 = {
+ 0x8000000000003000L, 0xffff000000000001L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};
+private int jjMoveNfa_0(int startState, int curPos)
+{
+ int strKind = jjmatchedKind;
+ int strPos = jjmatchedPos;
+ int seenUpto;
+ input_stream.backup(seenUpto = curPos + 1);
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { throw new Error("Internal Error"); }
+ curPos = 0;
+ int startsAt = 0;
+ jjnewStateCnt = 74;
+ int i = 1;
+ jjstateSet[0] = startState;
+ int kind = 0x7fffffff;
+ for (;;)
+ {
+ if (++jjround == 0x7fffffff)
+ ReInitRounds();
+ if (curChar < 64)
+ {
+ long l = 1L << curChar;
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if ((0x3ff000000000000L & l) != 0L)
+ {
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAddStates(0, 7);
+ }
+ else if ((0x280000000000L & l) != 0L)
+ jjCheckNAddStates(8, 12);
+ else if (curChar == 46)
+ jjCheckNAddTwoStates(54, 56);
+ else if (curChar == 60)
+ jjCheckNAddTwoStates(37, 38);
+ else if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 34;
+ else if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 22;
+ if (curChar == 34)
+ jjCheckNAddStates(13, 15);
+ else if (curChar == 39)
+ jjCheckNAddStates(16, 18);
+ break;
+ case 1:
+ if ((0x8400000000L & l) != 0L && kind > 15)
+ kind = 15;
+ break;
+ case 2:
+ if (curChar == 39)
+ jjCheckNAddStates(16, 18);
+ break;
+ case 3:
+ if ((0xffffff7fffffdbffL & l) != 0L)
+ jjCheckNAddStates(16, 18);
+ break;
+ case 5:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(16, 18);
+ break;
+ case 6:
+ if (curChar == 39 && kind > 16)
+ kind = 16;
+ break;
+ case 7:
+ if (curChar == 34)
+ jjCheckNAddStates(13, 15);
+ break;
+ case 8:
+ if ((0xfffffffbffffdbffL & l) != 0L)
+ jjCheckNAddStates(13, 15);
+ break;
+ case 10:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(13, 15);
+ break;
+ case 11:
+ if (curChar == 34 && kind > 17)
+ kind = 17;
+ break;
+ case 12:
+ if (curChar == 39)
+ jjCheckNAddStates(19, 22);
+ break;
+ case 13:
+ case 17:
+ if ((0xffffff7fffffffffL & l) != 0L)
+ jjCheckNAddStates(19, 22);
+ break;
+ case 15:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(19, 22);
+ break;
+ case 16:
+ case 19:
+ if (curChar == 39)
+ jjCheckNAdd(17);
+ break;
+ case 18:
+ if (curChar == 39)
+ jjAddStates(23, 24);
+ break;
+ case 20:
+ if (curChar == 39 && kind > 18)
+ kind = 18;
+ break;
+ case 21:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 20;
+ break;
+ case 22:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 12;
+ break;
+ case 23:
+ if (curChar == 39)
+ jjstateSet[jjnewStateCnt++] = 22;
+ break;
+ case 24:
+ if (curChar == 34)
+ jjCheckNAddStates(25, 28);
+ break;
+ case 25:
+ case 29:
+ if ((0xfffffffbffffffffL & l) != 0L)
+ jjCheckNAddStates(25, 28);
+ break;
+ case 27:
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(25, 28);
+ break;
+ case 28:
+ case 31:
+ if (curChar == 34)
+ jjCheckNAdd(29);
+ break;
+ case 30:
+ if (curChar == 34)
+ jjAddStates(29, 30);
+ break;
+ case 32:
+ if (curChar == 34 && kind > 19)
+ kind = 19;
+ break;
+ case 33:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 32;
+ break;
+ case 34:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 24;
+ break;
+ case 35:
+ if (curChar == 34)
+ jjstateSet[jjnewStateCnt++] = 34;
+ break;
+ case 36:
+ if (curChar == 60)
+ jjCheckNAddTwoStates(37, 38);
+ break;
+ case 37:
+ if ((0xaffffffa00000000L & l) != 0L)
+ jjCheckNAddTwoStates(37, 38);
+ break;
+ case 38:
+ if (curChar == 62 && kind > 21)
+ kind = 21;
+ break;
+ case 39:
+ if (curChar == 58)
+ jjstateSet[jjnewStateCnt++] = 40;
+ break;
+ case 40:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAddTwoStates(41, 42);
+ break;
+ case 41:
+ if ((0x3ff600000000000L & l) != 0L)
+ jjCheckNAddTwoStates(41, 42);
+ break;
+ case 42:
+ if ((0x3ff200000000000L & l) != 0L && kind > 22)
+ kind = 22;
+ break;
+ case 46:
+ if (curChar == 45)
+ jjCheckNAdd(47);
+ break;
+ case 47:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 23)
+ kind = 23;
+ jjCheckNAddTwoStates(46, 47);
+ break;
+ case 48:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAddStates(8, 12);
+ break;
+ case 49:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(49);
+ break;
+ case 50:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(50, 51);
+ break;
+ case 51:
+ if (curChar != 46)
+ break;
+ if (kind > 10)
+ kind = 10;
+ jjCheckNAdd(52);
+ break;
+ case 52:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 10)
+ kind = 10;
+ jjCheckNAdd(52);
+ break;
+ case 53:
+ if (curChar == 46)
+ jjCheckNAdd(54);
+ break;
+ case 54:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 10)
+ kind = 10;
+ jjCheckNAdd(54);
+ break;
+ case 55:
+ if (curChar == 46)
+ jjCheckNAdd(56);
+ break;
+ case 56:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(56, 57);
+ break;
+ case 58:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(59);
+ break;
+ case 59:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 11)
+ kind = 11;
+ jjCheckNAdd(59);
+ break;
+ case 60:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(31, 34);
+ break;
+ case 61:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(61, 62);
+ break;
+ case 62:
+ if (curChar == 46)
+ jjCheckNAddTwoStates(63, 64);
+ break;
+ case 63:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(63, 64);
+ break;
+ case 65:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(66);
+ break;
+ case 66:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 11)
+ kind = 11;
+ jjCheckNAdd(66);
+ break;
+ case 67:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(67, 68);
+ break;
+ case 69:
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(70);
+ break;
+ case 70:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 11)
+ kind = 11;
+ jjCheckNAdd(70);
+ break;
+ case 71:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAddStates(0, 7);
+ break;
+ case 72:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 20)
+ kind = 20;
+ jjCheckNAdd(72);
+ break;
+ case 73:
+ if (curChar == 46)
+ jjCheckNAddTwoStates(54, 56);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else if (curChar < 128)
+ {
+ long l = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 0:
+ if (curChar == 64)
+ jjCheckNAdd(45);
+ else if (curChar == 95)
+ jjstateSet[jjnewStateCnt++] = 39;
+ else if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 1;
+ break;
+ case 1:
+ if ((0x14404410144044L & l) != 0L && kind > 15)
+ kind = 15;
+ break;
+ case 3:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(16, 18);
+ break;
+ case 4:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 5;
+ break;
+ case 5:
+ if ((0x14404410144044L & l) != 0L)
+ jjCheckNAddStates(16, 18);
+ break;
+ case 8:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(13, 15);
+ break;
+ case 9:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 10;
+ break;
+ case 10:
+ if ((0x14404410144044L & l) != 0L)
+ jjCheckNAddStates(13, 15);
+ break;
+ case 13:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(19, 22);
+ break;
+ case 14:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 15;
+ break;
+ case 15:
+ if ((0x14404410144044L & l) != 0L)
+ jjCheckNAddStates(19, 22);
+ break;
+ case 17:
+ jjCheckNAddStates(19, 22);
+ break;
+ case 25:
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(25, 28);
+ break;
+ case 26:
+ if (curChar == 92)
+ jjstateSet[jjnewStateCnt++] = 27;
+ break;
+ case 27:
+ if ((0x14404410144044L & l) != 0L)
+ jjCheckNAddStates(25, 28);
+ break;
+ case 29:
+ jjCheckNAddStates(25, 28);
+ break;
+ case 37:
+ if ((0xc7fffffeafffffffL & l) != 0L)
+ jjAddStates(35, 36);
+ break;
+ case 40:
+ if ((0x7fffffe87fffffeL & l) == 0L)
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAddTwoStates(41, 42);
+ break;
+ case 41:
+ if ((0x7fffffe87fffffeL & l) != 0L)
+ jjCheckNAddTwoStates(41, 42);
+ break;
+ case 42:
+ if ((0x7fffffe87fffffeL & l) != 0L && kind > 22)
+ kind = 22;
+ break;
+ case 43:
+ if (curChar == 95)
+ jjstateSet[jjnewStateCnt++] = 39;
+ break;
+ case 44:
+ if (curChar == 64)
+ jjCheckNAdd(45);
+ break;
+ case 45:
+ if ((0x7fffffe07fffffeL & l) == 0L)
+ break;
+ if (kind > 23)
+ kind = 23;
+ jjCheckNAddTwoStates(45, 46);
+ break;
+ case 47:
+ if ((0x7fffffe07fffffeL & l) == 0L)
+ break;
+ if (kind > 23)
+ kind = 23;
+ jjCheckNAddTwoStates(46, 47);
+ break;
+ case 57:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(37, 38);
+ break;
+ case 64:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(39, 40);
+ break;
+ case 68:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(41, 42);
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ else
+ {
+ int hiByte = (int)(curChar >> 8);
+ int i1 = hiByte >> 6;
+ long l1 = 1L << (hiByte & 077);
+ int i2 = (curChar & 0xff) >> 6;
+ long l2 = 1L << (curChar & 077);
+ do
+ {
+ switch(jjstateSet[--i])
+ {
+ case 3:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(16, 18);
+ break;
+ case 8:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(13, 15);
+ break;
+ case 13:
+ case 17:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddStates(19, 22);
+ break;
+ case 25:
+ case 29:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddStates(25, 28);
+ break;
+ case 37:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(35, 36);
+ break;
+ case 40:
+ if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
+ break;
+ if (kind > 22)
+ kind = 22;
+ jjCheckNAddTwoStates(41, 42);
+ break;
+ case 41:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+ jjCheckNAddTwoStates(41, 42);
+ break;
+ case 42:
+ if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 22)
+ kind = 22;
+ break;
+ default : break;
+ }
+ } while(i != startsAt);
+ }
+ if (kind != 0x7fffffff)
+ {
+ jjmatchedKind = kind;
+ jjmatchedPos = curPos;
+ kind = 0x7fffffff;
+ }
+ ++curPos;
+ if ((i = jjnewStateCnt) == (startsAt = 74 - (jjnewStateCnt = startsAt)))
+ break;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { break; }
+ }
+ if (jjmatchedPos > strPos)
+ return curPos;
+
+ int toRet = Math.max(curPos, seenUpto);
+
+ if (curPos < toRet)
+ for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; )
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }
+
+ if (jjmatchedPos < strPos)
+ {
+ jjmatchedKind = strKind;
+ jjmatchedPos = strPos;
+ }
+ else if (jjmatchedPos == strPos && jjmatchedKind > strKind)
+ jjmatchedKind = strKind;
+
+ return toRet;
+}
+static final int[] jjnextStates = {
+ 49, 50, 51, 61, 62, 67, 68, 72, 49, 50, 53, 55, 60, 8, 9, 11,
+ 3, 4, 6, 13, 14, 16, 18, 19, 21, 25, 26, 28, 30, 31, 33, 61,
+ 62, 67, 68, 37, 38, 58, 59, 65, 66, 69, 70,
+};
+private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec2[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec0[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec4[i2] & l2) != 0L);
+ case 3:
+ return ((jjbitVec5[i2] & l2) != 0L);
+ case 32:
+ return ((jjbitVec6[i2] & l2) != 0L);
+ case 33:
+ return ((jjbitVec7[i2] & l2) != 0L);
+ case 47:
+ return ((jjbitVec8[i2] & l2) != 0L);
+ case 48:
+ return ((jjbitVec0[i2] & l2) != 0L);
+ case 255:
+ return ((jjbitVec9[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec3[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2)
+{
+ switch(hiByte)
+ {
+ case 0:
+ return ((jjbitVec10[i2] & l2) != 0L);
+ case 3:
+ return ((jjbitVec11[i2] & l2) != 0L);
+ case 32:
+ return ((jjbitVec12[i2] & l2) != 0L);
+ case 33:
+ return ((jjbitVec7[i2] & l2) != 0L);
+ case 47:
+ return ((jjbitVec8[i2] & l2) != 0L);
+ case 48:
+ return ((jjbitVec0[i2] & l2) != 0L);
+ case 255:
+ return ((jjbitVec9[i2] & l2) != 0L);
+ default :
+ if ((jjbitVec3[i1] & l1) != 0L)
+ return true;
+ return false;
+ }
+}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null,
+"\156\165\154\154", "\173", "\175", "\133", "\135", "\54", "\72", "\136\136", "\100", null, null,
+null, null, null, };
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+ "DEFAULT",
+};
+static final long[] jjtoToken = {
+ 0x7fcff8f81L,
+};
+static final long[] jjtoSkip = {
+ 0x3eL,
+};
+protected JavaCharStream input_stream;
+private final int[] jjrounds = new int[74];
+private final int[] jjstateSet = new int[148];
+protected char curChar;
+/** Constructor. */
+public CDTLiteralParserTokenManager(JavaCharStream stream){
+ if (JavaCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ input_stream = stream;
+}
+
+/** Constructor. */
+public CDTLiteralParserTokenManager(JavaCharStream stream, int lexState){
+ this(stream);
+ SwitchTo(lexState);
+}
+
+/** Reinitialise parser. */
+public void ReInit(JavaCharStream stream)
+{
+ jjmatchedPos = jjnewStateCnt = 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+}
+private void ReInitRounds()
+{
+ int i;
+ jjround = 0x80000001;
+ for (i = 74; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+}
+
+/** Reinitialise parser. */
+public void ReInit(JavaCharStream stream, int lexState)
+{
+ ReInit(stream);
+ SwitchTo(lexState);
+}
+
+/** Switch to specified lex state. */
+public void SwitchTo(int lexState)
+{
+ if (lexState >= 1 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+}
+
+protected Token jjFillToken()
+{
+ final Token t;
+ final String curTokenImage;
+ final int beginLine;
+ final int endLine;
+ final int beginColumn;
+ final int endColumn;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;
+ beginLine = input_stream.getBeginLine();
+ beginColumn = input_stream.getBeginColumn();
+ endLine = input_stream.getEndLine();
+ endColumn = input_stream.getEndColumn();
+ t = Token.newToken(jjmatchedKind, curTokenImage);
+
+ t.beginLine = beginLine;
+ t.endLine = endLine;
+ t.beginColumn = beginColumn;
+ t.endColumn = endColumn;
+
+ return t;
+}
+
+int curLexState = 0;
+int defaultLexState = 0;
+int jjnewStateCnt;
+int jjround;
+int jjmatchedPos;
+int jjmatchedKind;
+
+/** Get the next Token. */
+public Token getNextToken()
+{
+ Token matchedToken;
+ int curPos = 0;
+
+ EOFLoop :
+ for (;;)
+ {
+ try
+ {
+ curChar = input_stream.BeginToken();
+ }
+ catch(java.io.IOException e)
+ {
+ jjmatchedKind = 0;
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+
+ jjmatchedKind = 0x7fffffff;
+ jjmatchedPos = 0;
+ curPos = jjMoveStringLiteralDfa0_0();
+ if (jjmatchedKind != 0x7fffffff)
+ {
+ if (jjmatchedPos + 1 < curPos)
+ input_stream.backup(curPos - jjmatchedPos - 1);
+ if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
+ {
+ matchedToken = jjFillToken();
+ return matchedToken;
+ }
+ else
+ {
+ continue EOFLoop;
+ }
+ }
+ int error_line = input_stream.getEndLine();
+ int error_column = input_stream.getEndColumn();
+ String error_after = null;
+ boolean EOFSeen = false;
+ try { input_stream.readChar(); input_stream.backup(1); }
+ catch (java.io.IOException e1) {
+ EOFSeen = true;
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ if (curChar == '\n' || curChar == '\r') {
+ error_line++;
+ error_column = 0;
+ }
+ else
+ error_column++;
+ }
+ if (!EOFSeen) {
+ input_stream.backup(1);
+ error_after = curPos <= 1 ? "" : input_stream.GetImage();
+ }
+ throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
+ }
+}
+
+private void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
+}
+private void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+
+private void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/JavaCharStream.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java
similarity index 75%
copy from jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/JavaCharStream.java
copy to jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java
index 073cf097d1..0db07c051d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/JavaCharStream.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java
@@ -1,6 +1,24 @@
-/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 7.0 */
+/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
-package org.apache.jena.sparql.lang.sparql_11 ;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
/**
* An implementation of interface CharStream, where the stream is assumed to
@@ -13,7 +31,7 @@ public
class JavaCharStream
{
/** Whether parser is static. */
-
+
@SuppressWarnings("all")
public static final boolean staticFlag = false;
@@ -64,8 +82,8 @@ public static final boolean staticFlag = false;
throw new java.io.IOException(); // Should never come here
}
-/* Position in buffer. */
-
+/** Position in buffer. */
+
@SuppressWarnings("all")
public int bufpos = -1;
int bufsize;
@@ -87,15 +105,10 @@ public int bufpos = -1;
protected int maxNextCharInd = 0;
protected int nextCharInd = -1;
protected int inBuf = 0;
- protected int tabSize = 1;
- protected boolean trackLineColumn = true;
+ protected int tabSize = 8;
-
-@SuppressWarnings("all")
-public void setTabSize(int i) { tabSize = i; }
-
-@SuppressWarnings("all")
-public int getTabSize() { return tabSize; }
+ protected void setTabSize(int i) { tabSize = i; }
+ protected int getTabSize(int i) { return tabSize; }
protected void ExpandBuff(boolean wrapAround)
{
@@ -184,8 +197,8 @@ public int getTabSize() { return tabSize; }
return nextCharBuf[nextCharInd];
}
-/* @return starting character for token. */
-
+/** @return starting character for token. */
+
@SuppressWarnings("all")
public char BeginToken() throws java.io.IOException
{
@@ -266,8 +279,8 @@ public char BeginToken() throws java.io.IOException
bufcolumn[bufpos] = column;
}
-/* Read a character. */
-
+/** Read a character. */
+
@SuppressWarnings("all")
public char readChar() throws java.io.IOException
{
@@ -288,7 +301,7 @@ public char readChar() throws java.io.IOException
if ((buffer[bufpos] = c = ReadByte()) == '\\')
{
- if (trackLineColumn) { UpdateLineColumn(c); }
+ UpdateLineColumn(c);
int backSlashCnt = 1;
@@ -301,7 +314,7 @@ public char readChar() throws java.io.IOException
{
if ((buffer[bufpos] = c = ReadByte()) != '\\')
{
- if (trackLineColumn) { UpdateLineColumn(c); }
+ UpdateLineColumn(c);
// found a non-backslash char.
if ((c == 'u') && ((backSlashCnt & 1) == 1))
{
@@ -324,7 +337,7 @@ public char readChar() throws java.io.IOException
return '\\';
}
- if (trackLineColumn) { UpdateLineColumn(c); }
+ UpdateLineColumn(c);
backSlashCnt++;
}
@@ -362,64 +375,58 @@ public char readChar() throws java.io.IOException
}
}
- /*
+ @Deprecated
+ /**
* @deprecated
* @see #getEndColumn
*/
- @Deprecated
-
+
@SuppressWarnings("all")
public int getColumn() {
return bufcolumn[bufpos];
}
- /*
+ @Deprecated
+ /**
* @deprecated
* @see #getEndLine
- * @return the line number.
*/
- @Deprecated
-
+
@SuppressWarnings("all")
public int getLine() {
return bufline[bufpos];
}
-/** Get end column.
- * @return the end column or -1
- */
-
+/** Get end column. */
+
@SuppressWarnings("all")
public int getEndColumn() {
return bufcolumn[bufpos];
}
-/** Get end line.
- * @return the end line number or -1
- */
-
+/** Get end line. */
+
@SuppressWarnings("all")
public int getEndLine() {
return bufline[bufpos];
}
-/** Get the beginning column.
- * @return column of token start */
-
+/** @return column of token start */
+
@SuppressWarnings("all")
public int getBeginColumn() {
return bufcolumn[tokenBegin];
}
/** @return line number of token start */
-
+
@SuppressWarnings("all")
public int getBeginLine() {
return bufline[tokenBegin];
}
/** Retreat. */
-
+
@SuppressWarnings("all")
public void backup(int amount) {
@@ -428,13 +435,8 @@ public void backup(int amount) {
bufpos += bufsize;
}
-/** Constructor.
- * @param dstream the underlying data source.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- * @param buffersize size of the buffer
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
@@ -450,12 +452,8 @@ public JavaCharStream(java.io.Reader dstream,
nextCharBuf = new char[4096];
}
-/** Constructor.
- * @param dstream the underlying data source.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn)
@@ -463,17 +461,15 @@ public JavaCharStream(java.io.Reader dstream,
this(dstream, startline, startcolumn, 4096);
}
-/** Constructor.
- * @param dstream the underlying data source.
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream)
{
this(dstream, 1, 1, 4096);
}
-/* Reinitialise. */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
@@ -495,8 +491,8 @@ public void ReInit(java.io.Reader dstream,
nextCharInd = bufpos = -1;
}
-/* Reinitialise. */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream,
int startline, int startcolumn)
@@ -504,15 +500,15 @@ public void ReInit(java.io.Reader dstream,
ReInit(dstream, startline, startcolumn, 4096);
}
-/* Reinitialise. */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream)
{
ReInit(dstream, 1, 1, 4096);
}
/** Constructor. */
-
+
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
@@ -520,28 +516,17 @@ public JavaCharStream(java.io.InputStream dstream, String encoding, int startlin
this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
-/** Constructor.
- * @param dstream the underlying data source.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- * @param buffersize size of the buffer
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
}
-/** Constructor.
- * @param dstream the underlying data source.
- * @param encoding the character encoding of the data stream.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported.
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
@@ -549,12 +534,8 @@ public JavaCharStream(java.io.InputStream dstream, String encoding, int startlin
this(dstream, encoding, startline, startcolumn, 4096);
}
-/** Constructor.
- * @param dstream the underlying data source.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn)
@@ -562,36 +543,24 @@ public JavaCharStream(java.io.InputStream dstream, int startline,
this(dstream, startline, startcolumn, 4096);
}
-/** Constructor.
- * @param dstream the underlying data source.
- * @param encoding the character encoding of the data stream.
- * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported.
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
this(dstream, encoding, 1, 1, 4096);
}
- /** Constructor.
- * @param dstream the underlying data source.
- */
-
+/** Constructor. */
+
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream)
{
this(dstream, 1, 1, 4096);
}
-/** Reinitialise.
- * @param dstream the underlying data source.
- * @param encoding the character encoding of the data stream.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- * @param buffersize size of the buffer
- */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
@@ -599,70 +568,48 @@ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
-/** Reinitialise.
- * @param dstream the underlying data source.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- * @param buffersize size of the buffer
- */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
-/** Reinitialise.
- * @param dstream the underlying data source.
- * @param encoding the character encoding of the data stream.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported.
- */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
ReInit(dstream, encoding, startline, startcolumn, 4096);
}
-/** Reinitialise.
- * @param dstream the underlying data source.
- * @param startline line number of the first character of the stream, mostly for error messages.
- * @param startcolumn column number of the first character of the stream.
- */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn)
{
ReInit(dstream, startline, startcolumn, 4096);
}
-/** Reinitialise.
- * @param dstream the underlying data source.
- * @param encoding the character encoding of the data stream.
- * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported.
- */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
ReInit(dstream, encoding, 1, 1, 4096);
}
-/** Reinitialise.
- * @param dstream the underlying data source.
- */
-
+/** Reinitialise. */
+
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream)
{
ReInit(dstream, 1, 1, 4096);
}
- /** Get the token timage.
- * @return token image as String */
-
+ /** @return token image as String */
+
@SuppressWarnings("all")
public String GetImage()
{
@@ -673,10 +620,8 @@ public String GetImage()
new String(buffer, 0, bufpos + 1);
}
- /** Get the suffix as an array of characters.
- * @param len the length of the array to return.
- * @return suffix */
-
+ /** @return suffix */
+
@SuppressWarnings("all")
public char[] GetSuffix(int len)
{
@@ -695,7 +640,7 @@ public char[] GetSuffix(int len)
}
/** Set buffers back to null when finished. */
-
+
@SuppressWarnings("all")
public void Done()
{
@@ -707,11 +652,8 @@ public void Done()
/**
* Method to adjust line and column numbers for the start of a token.
- *
- * @param newLine the new line number.
- * @param newCol the new column number.
*/
-
+
@SuppressWarnings("all")
public void adjustBeginLineColumn(int newLine, int newCol)
{
@@ -756,8 +698,6 @@ public void adjustBeginLineColumn(int newLine, int newCol)
line = bufline[j];
column = bufcolumn[j];
}
- boolean getTrackLineColumn() { return trackLineColumn; }
- void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
}
-/* JavaCC - OriginalChecksum=9698f3eb5988f4ff314d1b8207763eb1 (do not edit this line) */
+/* JavaCC - OriginalChecksum=2ebc561fdb294979325bb97dfcdf1b61 (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ParseException.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
similarity index 76%
copy from jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ParseException.java
copy to jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
index cb1919325b..9fff7e2c63 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ParseException.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
@@ -1,6 +1,24 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */
-/* JavaCCOptions:KEEP_LINE_COLUMN=true */
-package org.apache.jena.sparql.lang.arq ;
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
+/* JavaCCOptions:KEEP_LINE_COL=null */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
/**
* This exception is thrown when parse errors are encountered.
@@ -20,11 +38,6 @@ public class ParseException extends Exception {
*/
private static final long serialVersionUID = 1L;
- /**
- * The end of line string for this machine.
- */
- protected static String EOL = System.getProperty("line.separator", "\n");
-
/**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
@@ -65,7 +78,7 @@ public class ParseException extends Exception {
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error, the token
- * following this token will (therefore) be the first error token.
+ * followng this token will (therefore) be the first error token.
*/
public Token currentToken;
@@ -93,8 +106,8 @@ public class ParseException extends Exception {
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
-
- StringBuilder expected = new StringBuilder();
+ String eol = System.getProperty("line.separator", "\n");
+ StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
@@ -106,7 +119,7 @@ public class ParseException extends Exception {
if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
expected.append("...");
}
- expected.append(EOL).append(" ");
+ expected.append(eol).append(" ");
}
String retval = "Encountered \"";
Token tok = currentToken.next;
@@ -122,26 +135,21 @@ public class ParseException extends Exception {
retval += " \"";
tok = tok.next;
}
- if (currentToken.next != null) {
- retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
- }
- retval += "." + EOL;
-
-
- if (expectedTokenSequences.length == 0) {
- // Nothing to add here
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ retval += "." + eol;
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + eol + " ";
} else {
- if (expectedTokenSequences.length == 1) {
- retval += "Was expecting:" + EOL + " ";
- } else {
- retval += "Was expecting one of:" + EOL + " ";
- }
- retval += expected.toString();
+ retval += "Was expecting one of:" + eol + " ";
}
-
+ retval += expected.toString();
return retval;
}
+ /**
+ * The end of line string for this machine.
+ */
+ protected String eol = System.getProperty("line.separator", "\n");
/**
* Used to convert raw characters to their escaped version
@@ -149,11 +157,13 @@ public class ParseException extends Exception {
* string literal.
*/
static String add_escapes(String str) {
- StringBuilder retval = new StringBuilder();
+ StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
+ case 0 :
+ continue;
case '\b':
retval.append("\\b");
continue;
@@ -192,4 +202,4 @@ public class ParseException extends Exception {
}
}
-/* JavaCC - OriginalChecksum=7f03520468cc43d4f83f09bbb6a97299 (do not edit this line) */
+/* JavaCC - OriginalChecksum=0bd53902852438cd5670da2f50328753 (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/Token.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
similarity index 79%
copy from jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/Token.java
copy to jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
index b4da352e69..3e7793689f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/Token.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
@@ -1,6 +1,24 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */
-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
-package org.apache.jena.sparql.lang.arq ;
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
/**
* Describes the input token stream.
@@ -97,7 +115,6 @@ public class Token implements java.io.Serializable {
/**
* Returns the image.
*/
- @Override
public String toString()
{
return image;
@@ -129,4 +146,4 @@ public class Token implements java.io.Serializable {
}
}
-/* JavaCC - OriginalChecksum=0ea2e0bf17ab3b36b824cbe5bb2a103c (do not edit this line) */
+/* JavaCC - OriginalChecksum=0bb1e7330fe557a4194caa87be20ae38 (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/TokenMgrError.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
similarity index 65%
copy from jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/TokenMgrError.java
copy to jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
index 7260bb1d48..307f2e7efd 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/TokenMgrError.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
@@ -1,6 +1,24 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
/* JavaCCOptions: */
-package org.apache.jena.sparql.lang.arq ;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.cdt.parser;
/** Token Manager Error. */
@@ -22,22 +40,22 @@ public class TokenMgrError extends Error
/**
* Lexical error occurred.
*/
- public static final int LEXICAL_ERROR = 0;
+ static final int LEXICAL_ERROR = 0;
/**
* An attempt was made to create a second instance of a static token manager.
*/
- public static final int STATIC_LEXER_ERROR = 1;
+ static final int STATIC_LEXER_ERROR = 1;
/**
* Tried to change to an invalid lexical state.
*/
- public static final int INVALID_LEXICAL_STATE = 2;
+ static final int INVALID_LEXICAL_STATE = 2;
/**
* Detected (and bailed out of) an infinite loop in the token manager.
*/
- public static final int LOOP_DETECTED = 3;
+ static final int LOOP_DETECTED = 3;
/**
* Indicates the reason why the exception is thrown. It will have
@@ -50,11 +68,13 @@ public class TokenMgrError extends Error
* equivalents in the given string
*/
protected static final String addEscapes(String str) {
- StringBuilder retval = new StringBuilder();
+ StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
+ case 0 :
+ continue;
case '\b':
retval.append("\\b");
continue;
@@ -97,20 +117,19 @@ public class TokenMgrError extends Error
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexical error
- * lexState : lexical state in which this error occurred
+ * curLexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
- protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) {
- return("Lexical error at line " + //
- errorLine + ", column " + //
- errorColumn + ". Encountered: " + //
- (EOFSeen ? "<EOF>" : ("'" + addEscapes(String.valueOf(curChar)) + "' (" + curChar + "),")) + //
- (errorAfter == null || errorAfter.length() == 0 ? "" : " after prefix \"" + addEscapes(errorAfter) + "\"")) + //
- (lexState == 0 ? "" : " (in lexical state " + lexState + ")");
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
}
/**
@@ -122,7 +141,6 @@ public class TokenMgrError extends Error
*
* from this method for such cases in the release version of your parser.
*/
- @Override
public String getMessage() {
return super.getMessage();
}
@@ -142,8 +160,8 @@ public class TokenMgrError extends Error
}
/** Full Constructor. */
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) {
- this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
}
}
-/* JavaCC - OriginalChecksum=26900e63a554da1bde0d1d6ebd69f6c3 (do not edit this line) */
+/* JavaCC - OriginalChecksum=8d2f5d5473ff1b03e240576a846cb262 (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/query/ARQ.java b/jena-arq/src/main/java/org/apache/jena/query/ARQ.java
index a104dcf8ca..941f90f6c8 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/ARQ.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/ARQ.java
@@ -22,6 +22,9 @@ import java.net.http.HttpClient;
import java.util.concurrent.TimeUnit;
import org.apache.jena.atlas.lib.Version;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
+import org.apache.jena.datatypes.TypeMapper;
import org.apache.jena.http.sys.HttpRequestModifier;
import org.apache.jena.http.sys.RegistryRequestModifier;
import org.apache.jena.riot.RIOT;
@@ -664,6 +667,10 @@ public class ARQ
AggregateRegistry.init();
PropertyFunctionRegistry.init();
+ // Register the datatypes for the CDT literals
+ TypeMapper.getInstance().registerDatatype(CompositeDatatypeList.type) ;
+ TypeMapper.getInstance().registerDatatype(CompositeDatatypeMap.type) ;
+
JenaSystem.logLifecycle("ARQ.init - finish");
}
}
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java b/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
index 35c451d004..f9e04c747c 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/RDFParser.java
@@ -553,7 +553,7 @@ public class RDFParser {
? resolver
: IRIxResolver.create().base(baseStr).resolve(resolve).allowRelative(allowRelative).build();
PrefixMap pmap = ( this.prefixMap != null ) ? this.prefixMap : PrefixMapFactory.create();
- ParserProfileStd parserFactory = new ParserProfileStd(factory, errorHandler,
+ ParserProfileStd parserFactory = new CDTAwareParserProfile(factory, errorHandler,
parserResolver, pmap,
context, checking$, strict);
return parserFactory;
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java b/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java
new file mode 100644
index 0000000000..660b0c2580
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.riot.system;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
+import org.apache.jena.cdt.ParserForCDTLiterals;
+import org.apache.jena.datatypes.DatatypeFormatException;
+import org.apache.jena.datatypes.RDFDatatype;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.impl.LiteralLabel;
+import org.apache.jena.graph.impl.LiteralLabelFactory;
+import org.apache.jena.irix.IRIxResolver;
+import org.apache.jena.sparql.util.Context;
+
+/**
+ * This is a {@link ParserProfile} that supports parsing of CDT literals
+ * that occur within the parsed file. The main point is to share the
+ * {@link FactoryRDF} object of this parser profile with the parser of
+ * these literals in order to get the same blank nodes for the same
+ * blank node identifiers both within and outside of the literals, as
+ * well as across multiple CDT literals that occur in the parsed file.
+ */
+public class CDTAwareParserProfile extends ParserProfileStd {
+
+ public CDTAwareParserProfile( final FactoryRDF factory,
+ final ErrorHandler errorHandler,
+ final IRIxResolver resolver,
+ final PrefixMap prefixMap,
+ final Context context,
+ final boolean checking,
+ final boolean strictMode ) {
+ super(factory, errorHandler, resolver, prefixMap, context, checking, strictMode);
+ }
+
+ @Override
+ public Node createTypedLiteral( final String lex, final RDFDatatype datatype, final long line, final long col ) {
+ // cdt:List and cdt:Map literals need to be treated in a special way
+ // because we need to construct their value by parsing them using this
+ // same parser profile; this is necessary to make sure that blank node
+ // identifiers inside the lexical forms of multiple of these literals
+ // within the same file are all mapped to the same blank node, and so
+ // are all blank node identifers that occur directly in the file (i.e.,
+ // ourside of CDT literals).
+
+ if ( datatype.equals(CompositeDatatypeList.type) ) {
+ return createListLiteral(lex);
+ }
+
+ if ( datatype.equals(CompositeDatatypeMap.type) ) {
+ return createMapLiteral(lex);
+ }
+
+ return super.createTypedLiteral(lex, datatype, line, col);
+ }
+
+ protected Node createListLiteral( final String lex ) {
+ // Attention: In contrast to the overridden createTypedLiteral function
+ // in the superclass, for literals of the CDT datatypes we do not perform
+ // a checkLiteral check because that would parse the lexical form of the
+ // literal already once before doing the other parse to obtain the value.
+
+ // parse the given lexical form using this same parser profile
+ final List<CDTValue> value;
+ try {
+ value = ParserForCDTLiterals.parseListLiteral(this, lex);
+ }
+ catch ( final Exception ex ) {
+ throw new DatatypeFormatException(lex, CompositeDatatypeList.type, ex);
+ }
+
+ // At this point we have both the lexical form (which, after the
+ // parsing, we now know is well formed) and the corresponding value
+ // of the literal. We create a LiteralLabel with both of them, for
+ // the following reasons.
+ // If we were to create the LiteralLabel with the lexical form only,
+ // then the LiteralLabel implementation would parse that lexical form
+ // again, which gives us an unnecessary performance penalty (in
+ // particular for huge lists).
+ // If we were to create the LiteralLabel with the value only, then the
+ // LiteralLabel implementation would reproduce the lexical form, which
+ // may not be identical to the lexical form with which we have created
+ // the value here. The issue with that is that a SAMETERM comparison
+ // would incorrectly return false.
+ final LiteralLabel ll = LiteralLabelFactory.createIncludingValue(lex, value, CompositeDatatypeList.type);
+ return NodeFactory.createLiteral(ll);
+ }
+
+ protected Node createMapLiteral( final String lex ) {
+ // Attention: In contrast to the overridden createTypedLiteral function
+ // in the superclass, for literals of the CDT datatypes we do not perform
+ // a checkLiteral check because that would parse the lexical form of the
+ // literal already once before doing the other parse to obtain the value.
+
+ // parse the given lexical form using this same parser profile
+ final Map<CDTKey,CDTValue> value;
+ try {
+ value = ParserForCDTLiterals.parseMapLiteral(this, lex);
+ }
+ catch ( final Exception ex ) {
+ throw new DatatypeFormatException(lex, CompositeDatatypeMap.type, ex);
+ }
+
+ // We create a LiteralLabel with both the lexical form and the value,
+ // for the same reasons as described above in createListLiteral().
+ final LiteralLabel ll = LiteralLabelFactory.createIncludingValue(lex, value, CompositeDatatypeMap.type);
+ return NodeFactory.createLiteral(ll);
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java b/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
index b81691b289..11e3568a3e 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/RiotLib.java
@@ -224,7 +224,7 @@ public class RiotLib {
* Create a {@link ParserProfile} with default settings, and a specific error handler.
*/
public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking) {
- return new ParserProfileStd(factory,
+ return new CDTAwareParserProfile(factory,
errorHandler,
IRIxResolver.create(IRIs.getSystemBase()).build(),
PrefixMapFactory.create(),
@@ -238,7 +238,7 @@ public class RiotLib {
*/
public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler,
IRIxResolver resolver, boolean checking) {
- return new ParserProfileStd(factory,
+ return new CDTAwareParserProfile(factory,
errorHandler,
resolver,
PrefixMapFactory.create(),
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java b/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java
index 8f6ac06a24..d18420b3f6 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/ARQConstants.java
@@ -80,6 +80,9 @@ public class ARQConstants
/** URI scheme that triggers the loader to load a java class */
public static final String javaClassURIScheme = "java:" ;
+ /** The ARQ function library URI space */
+ public static final String CDTFunctionLibraryURI = "http://w3id.org/awslabs/neptune/SPARQL-CDTs/" ;
+
/** The ARQ function library URI space */
public static final String ARQFunctionLibraryURI = "http://jena.apache.org/ARQ/function#" ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java
index 5174505d0e..016a0240c9 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/AlgebraGenerator.java
@@ -324,6 +324,10 @@ public class AlgebraGenerator
if ( elt instanceof ElementNotExists elt2 )
return compileElementNotExists(current, elt2);
+ if ( elt instanceof ElementUnfold eltUnfold ) {
+ return new OpUnfold(current, eltUnfold.getExpr(), eltUnfold.getVar1(), eltUnfold.getVar2());
+ }
+
// Filters were collected together by prepareGroup
// This only handles filters left in place by some magic.
if ( elt instanceof ElementFilter ef)
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java
index 1c74499dbd..4b23ab44aa 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpAsQuery.java
@@ -828,6 +828,15 @@ public class OpAsQuery {
}) ;
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ Element e = asElement(opUnfold.getSubOp()) ;
+ // If (unfold ... (table unit)), and first in group, don't add the empty group.
+ insertIntoGroup(currentGroup(), e) ;
+ Element elmtUnfold = new ElementUnfold( opUnfold.getExpr(), opUnfold.getVar1(), opUnfold.getVar2() ) ;
+ currentGroup().addElement(elmtUnfold) ;
+ }
+
@Override
public void visit(OpList opList) {
opList.getSubOp().visit(this) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVars.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVars.java
index dcdde83de9..96c4b287bb 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVars.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVars.java
@@ -311,6 +311,14 @@ public class OpVars
acc.addAll(opExtend.getVarExprList().getVars());
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ acc.add( opUnfold.getVar1() );
+ if ( opUnfold.getVar2() != null ) {
+ acc.add( opUnfold.getVar2() );
+ }
+ }
+
@Override
public void visit(OpPropFunc opPropFunc) {
PropFuncArg.addVars(acc, opPropFunc.getSubjectArgs());
@@ -430,6 +438,14 @@ public class OpVars
unknownAcc.addAll(opExtend.getVarExprList().getVars());
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ unknownAcc.add( opUnfold.getVar1() );
+ if ( opUnfold.getVar2() != null ) {
+ unknownAcc.add( opUnfold.getVar2() );
+ }
+ }
+
@Override
public void visit(OpPropFunc opPropFunc) {
addvars(subjAcc, opPropFunc.getSubjectArgs());
@@ -496,6 +512,11 @@ public class OpVars
visitExtendAssign(opAssign);
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ ExprVars.varsMentioned( acc, opUnfold.getExpr() );
+ }
+
// The expression side of (extend) and (assign)
private void visitExtendAssign(OpExtendAssign op) {
op.getVarExprList().forEachExpr((v, e) -> ExprVars.varsMentioned(acc, e));
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java
index 15a13d5fd4..a7a74c7919 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitor.java
@@ -42,6 +42,7 @@ public interface OpVisitor
public void visit(OpLabel opLabel) ;
public void visit(OpAssign opAssign) ;
public void visit(OpExtend opExtend) ;
+ public void visit(OpUnfold opUnfold) ;
// Op2
public void visit(OpJoin opJoin) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java
index 8eccc40e9d..89cbe7692d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorBase.java
@@ -80,6 +80,8 @@ public class OpVisitorBase implements OpVisitor
@Override public void visit(OpExtend opExtend) {}
+ @Override public void visit(OpUnfold opUnfold) {}
+
@Override public void visit(OpList opList) {}
@Override public void visit(OpOrder opOrder) {}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java
index b331f817a5..fd8f0b4b8b 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/OpVisitorByType.java
@@ -150,6 +150,10 @@ public abstract class OpVisitorByType implements OpVisitor
public void visit(OpExtend opExtend)
{ visit1(opExtend) ; }
+ @Override
+ public void visit(OpUnfold opUnfold)
+ { visit1(opUnfold) ; }
+
@Override
public void visit(OpList opList)
{ visitModifer(opList) ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java
index 98fbc1b872..bdebe52b98 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/Transform.java
@@ -44,6 +44,7 @@ public interface Transform
public Op transform(OpLabel opLabel, Op subOp) ;
public Op transform(OpAssign opAssign, Op subOp) ;
public Op transform(OpExtend opExtend, Op subOp) ;
+ public Op transform(OpUnfold opUnfold, Op subOp) ;
// Op2
public Op transform(OpJoin opJoin, Op left, Op right) ;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java
index 32ecd34b17..6c21d89be8 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformCopy.java
@@ -68,6 +68,8 @@ public class TransformCopy implements Transform
public Op transform(OpAssign opAssign, Op subOp) { return xform(opAssign, subOp) ; }
@Override
public Op transform(OpExtend opExtend, Op subOp) { return xform(opExtend, subOp) ; }
+ @Override
+ public Op transform(OpUnfold opUnfold, Op subOp) { return xform(opUnfold, subOp) ; }
@Override
public Op transform(OpJoin opJoin, Op left, Op right) { return xform(opJoin, left, right) ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformSingle.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformSingle.java
index 5515cb85e7..69a525bd76 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformSingle.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformSingle.java
@@ -64,6 +64,8 @@ public class TransformSingle implements Transform
public Op transform(OpAssign opAssign, Op subOp) { return opAssign ; }
@Override
public Op transform(OpExtend opExtend, Op subOp) { return opExtend ; }
+ @Override
+ public Op transform(OpUnfold opUnfold, Op subOp) { return opUnfold ; }
@Override
public Op transform(OpJoin opJoin, Op left, Op right) { return opJoin ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java
index 30bff50c70..0be481886f 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/TransformWrapper.java
@@ -66,6 +66,8 @@ public class TransformWrapper implements Transform
public Op transform(OpAssign opAssign, Op subOp) { return transform.transform(opAssign, subOp) ; }
@Override
public Op transform(OpExtend opExtend, Op subOp) { return transform.transform(opExtend, subOp) ; }
+ @Override
+ public Op transform(OpUnfold opUnfold, Op subOp) { return transform.transform(opUnfold, subOp) ; }
@Override
public Op transform(OpJoin opJoin, Op left, Op right) { return transform.transform(opJoin, left, right) ; }
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java
new file mode 100644
index 0000000000..55a193e133
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.algebra.op;
+
+import java.util.Objects;
+
+import org.apache.jena.sparql.algebra.Op;
+import org.apache.jena.sparql.algebra.OpVisitor;
+import org.apache.jena.sparql.algebra.Transform;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.sse.Tags;
+import org.apache.jena.sparql.util.NodeIsomorphismMap;
+
+public class OpUnfold extends Op1
+{
+ protected final Expr expr ;
+ protected final Var var1 ;
+ protected final Var var2 ;
+
+ public OpUnfold(Op subOp, Expr expr, Var var1, Var var2) {
+ super(subOp) ;
+ this.expr = expr ;
+ this.var1 = var1 ;
+ this.var2 = var2 ;
+ }
+
+ public Expr getExpr()
+ {
+ return expr ;
+ }
+
+ public Var getVar1()
+ {
+ return var1 ;
+ }
+
+ public Var getVar2()
+ {
+ return var2 ;
+ }
+
+ @Override
+ public String getName() {
+ return Tags.tagUnfold ;
+ }
+
+ @Override
+ public void visit(OpVisitor opVisitor) {
+ opVisitor.visit(this) ;
+ }
+
+ @Override
+ public Op1 copy(Op subOp) {
+ OpUnfold op = new OpUnfold(subOp, expr, var1, var2) ;
+ return op ;
+ }
+
+ @Override
+ public boolean equalTo(Op other, NodeIsomorphismMap labelMap) {
+ if ( !(other instanceof OpUnfold) )
+ return false ;
+ OpUnfold unfold = (OpUnfold)other ;
+
+ if ( !Objects.equals(var1, unfold.var1) )
+ return false ;
+ if ( !Objects.equals(var2, unfold.var2) )
+ return false ;
+ if ( !Objects.equals(expr, unfold.expr) )
+ return false ;
+ return getSubOp().equalTo(unfold.getSubOp(), labelMap) ;
+ }
+
+ @Override
+ public Op apply(Transform transform, Op subOp) {
+ return transform.transform(this, subOp) ;
+ }
+
+ @Override
+ public int hashCode() {
+ if ( var2 == null )
+ return getName().hashCode() ^ expr.hashCode() ^ var1.hashCode() ^ getSubOp().hashCode() ;
+ else
+ return getName().hashCode() ^ expr.hashCode() ^ var1.hashCode() ^ var2.hashCode() ^ getSubOp().hashCode() ;
+ }
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/VariableUsageVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/VariableUsageVisitor.java
index 9cc3bb1413..747ee97bf5 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/VariableUsageVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/optimize/VariableUsageVisitor.java
@@ -41,6 +41,7 @@ import org.apache.jena.sparql.algebra.op.OpQuadBlock;
import org.apache.jena.sparql.algebra.op.OpQuadPattern;
import org.apache.jena.sparql.algebra.op.OpTable;
import org.apache.jena.sparql.algebra.op.OpTopN;
+import org.apache.jena.sparql.algebra.op.OpUnfold;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.core.Var;
import org.apache.jena.sparql.core.Vars;
@@ -169,6 +170,17 @@ public abstract class VariableUsageVisitor extends OpVisitorBase {
action(vars);
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ Collection<Var> vars = new ArrayList<>();
+ ExprVars.varsMentioned(vars, opUnfold.getExpr());
+ vars.add( opUnfold.getVar1() );
+ if ( opUnfold.getVar2() != null ) {
+ vars.add( opUnfold.getVar2() );
+ }
+ action(vars);
+ }
+
@Override
public void visit(OpOrder opOrder) {
Collection<Var> vars = new ArrayList<>();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ApplyTransformVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ApplyTransformVisitor.java
index 1954333480..0e9ae51129 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ApplyTransformVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/ApplyTransformVisitor.java
@@ -147,6 +147,15 @@ public class ApplyTransformVisitor implements OpVisitorByTypeAndExpr, ExprVisito
visit1(opExtend2) ;
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ final Expr e2 = pop(exprStack);
+ if ( ! opUnfold.getExpr().equals(e2) )
+ throw new IllegalArgumentException("Expression on stack differs from expression of UNFOLD.");
+
+ visit1(opUnfold) ;
+ }
+
// Special test cases for collectors.
// Careful about order.
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByType.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByType.java
index 3f373291f0..2ec2fbb802 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByType.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByType.java
@@ -188,6 +188,11 @@ public interface OpVisitorByType extends OpVisitor
visit1(opExtend);
}
+ @Override
+ public default void visit(OpUnfold opUnfold) {
+ visit1(opUnfold);
+ }
+
@Override
public default void visit(OpList opList) {
visitModifer(opList);
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java
index 5387afab57..bf3d358964 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/OpVisitorByTypeAndExpr.java
@@ -215,6 +215,12 @@ public interface OpVisitorByTypeAndExpr extends OpVisitor
visit1(opExtend);
}
+ @Override
+ public default void visit(OpUnfold opUnfold) {
+ visitExpr( new ExprList(opUnfold.getExpr()) ) ;
+ visit1(opUnfold);
+ }
+
@Override
public default void visit(OpList opList) {
visitModifer(opList);
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java
index 6243225afc..d1fa6e7e9e 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/walker/WalkerVisitor.java
@@ -215,6 +215,15 @@ public class WalkerVisitor implements OpVisitorByTypeAndExpr, ExprVisitorFunctio
after(opExtend) ;
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ before(opUnfold) ;
+ ExprList varExpr = new ExprList( opUnfold.getExpr() ) ;
+ visitExpr(varExpr);
+ visit1$(opUnfold) ;
+ after(opUnfold) ;
+ }
+
// Transforming to quads needs the graph node handled before doing the sub-algebra ops
// so it has to be done as before/after by the Walker. By the time visit(OpGraph) is called,
// the sub-tree has already been visited.
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java
new file mode 100644
index 0000000000..6de9f31fc8
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java
@@ -0,0 +1,346 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.engine.iterator;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+import org.apache.jena.atlas.io.IndentedWriter;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
+import org.apache.jena.datatypes.xsd.XSDDatatype;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.impl.LiteralLabel;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.engine.ExecutionContext;
+import org.apache.jena.sparql.engine.QueryIterator;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.engine.binding.BindingFactory;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.serializer.SerializationContext;
+
+public class QueryIterUnfold extends QueryIterRepeatApply
+{
+ protected final Expr expr ;
+ protected final Var var1 ;
+ protected final Var var2 ;
+
+ public QueryIterUnfold(QueryIterator qIter, Expr expr, Var var1, Var var2, ExecutionContext execCxt) {
+ super(qIter, execCxt) ;
+
+ this.expr = expr ;
+ this.var1 = var1 ;
+ this.var2 = var2 ;
+ }
+
+ @Override
+ protected QueryIterator nextStage(Binding inputBinding) {
+ final NodeValue nv;
+ try {
+ nv = expr.eval( inputBinding, getExecContext() );
+ }
+ catch ( final ExprEvalException ex ) {
+ // If the expression failed to evaluate, we create no
+ // no assignment (exactly as in the case of BIND, see
+ // the 'accept' method in 'QueryIterAssign')
+
+ return QueryIterSingleton.create( inputBinding, getExecContext() );
+ }
+
+ Node n = nv.asNode();
+ if ( n.isLiteral() ) {
+ String dtURI = n.getLiteralDatatypeURI();
+ if ( CompositeDatatypeList.uri.equals(dtURI) )
+ return unfoldList( n.getLiteral(), inputBinding );
+ if ( CompositeDatatypeMap.uri.equals(dtURI) )
+ return unfoldMap( n.getLiteral(), inputBinding );
+ }
+
+ return QueryIterSingleton.create( inputBinding, getExecContext() );
+ }
+
+ protected QueryIterator unfoldList( final LiteralLabel lit, final Binding inputBinding ) {
+ final Iterable<CDTValue> itListElmts = CompositeDatatypeList.getValue(lit);
+ return new QueryIterUnfoldWorkerForLists(inputBinding, itListElmts);
+ }
+
+ protected QueryIterator unfoldMap( final LiteralLabel lit, final Binding inputBinding ) {
+ final Iterable<Map.Entry<CDTKey,CDTValue>> itMapEntries = CompositeDatatypeMap.getValue(lit).entrySet();
+ return new QueryIterUnfoldWorkerForMaps(inputBinding, itMapEntries);
+ }
+
+ protected abstract class QueryIterUnfoldWorkerBase<T> extends QueryIteratorBase {
+ protected final Binding inputBinding;
+ protected final Iterator<T> itElmts;
+
+ protected QueryIterUnfoldWorkerBase(Binding inputBinding, Iterator<T> itElmts) {
+ this.inputBinding = inputBinding;
+ this.itElmts = itElmts;
+ }
+
+ protected QueryIterUnfoldWorkerBase(Binding inputBinding, Iterable<T> itElmts) {
+ this( inputBinding, itElmts.iterator() );
+ }
+
+ @Override
+ protected boolean hasNextBinding() { return itElmts.hasNext(); }
+
+ @Override
+ protected void requestCancel() { } // nothing to do really
+
+ @Override
+ protected void closeIterator() { } // nothing to do really
+ }
+
+
+ protected class QueryIterUnfoldWorkerForLists extends QueryIterUnfoldWorkerBase<CDTValue> {
+
+ protected int nextIndex = 0;
+
+ public QueryIterUnfoldWorkerForLists(Binding inputBinding, Iterator<CDTValue> itListElmts) {
+ super(inputBinding, itListElmts);
+ }
+
+ public QueryIterUnfoldWorkerForLists(Binding inputBinding, Iterable<CDTValue> itListElmts) {
+ super(inputBinding, itListElmts);
+ }
+
+ @Override
+ public void output(IndentedWriter out, SerializationContext sCxt) {
+ out.write("QueryIterUnfoldWorkerForLists");
+ }
+
+ @Override
+ protected Binding moveToNextBinding() {
+ final CDTValue nextElmt = itElmts.next();
+ nextIndex++; // index values to be assigned to the second variable start at 1
+
+ final Node indexNode;
+ if ( var2 != null ) {
+ final String indexStr = Integer.toString(nextIndex);
+ indexNode = NodeFactory.createLiteral(indexStr, XSDDatatype.XSDinteger);
+ }
+ else {
+ indexNode = null;
+ }
+
+ if ( nextElmt.isNull() ) {
+ if ( var2 != null )
+ return BindingFactory.binding(inputBinding, var2, indexNode);
+ else
+ return inputBinding;
+ }
+
+ if ( nextElmt.isNode() ) {
+ final Node elmtNode = nextElmt.asNode();
+
+ if ( var2 != null )
+ return BindingFactory.binding(inputBinding, var1, elmtNode, var2, indexNode);
+ else
+ return BindingFactory.binding(inputBinding, var1, elmtNode);
+ }
+
+ throw new UnsupportedOperationException( "unexpected list element: " + nextElmt.getClass().getName() );
+ }
+ }
+
+
+ protected class QueryIterUnfoldWorkerForMaps extends QueryIterUnfoldWorkerBase<Map.Entry<CDTKey,CDTValue>> {
+
+ public QueryIterUnfoldWorkerForMaps(Binding inputBinding, Iterator<Map.Entry<CDTKey,CDTValue>> itMapElmts) {
+ super(inputBinding, itMapElmts);
+ }
+
+ public QueryIterUnfoldWorkerForMaps(Binding inputBinding, Iterable<Map.Entry<CDTKey,CDTValue>> itMapElmts) {
+ super(inputBinding, itMapElmts);
+ }
+
+ @Override
+ public void output(IndentedWriter out, SerializationContext sCxt) {
+ out.write("QueryIterUnfoldWorkerForMaps");
+ }
+
+ @Override
+ protected Binding moveToNextBinding() {
+ final Map.Entry<CDTKey,CDTValue> elmt = itElmts.next();
+ final CDTKey key = elmt.getKey();
+ final CDTValue value = elmt.getValue();
+
+ final Node keyNode = key.asNode();
+
+ if ( value.isNull() || var2 == null ) {
+ return BindingFactory.binding( inputBinding, var1, keyNode );
+ }
+
+ if ( value.isNode() ) {
+ final Node valueNode = value.asNode();
+ return BindingFactory.binding(inputBinding, var1, keyNode, var2, valueNode);
+ }
+
+ throw new UnsupportedOperationException( "unexpected map value: " + value.getClass().getName() );
+ }
+ }
+
+
+ protected static abstract class ElementExtractorBase<T> implements Iterator<T> {
+ protected final String str;
+ protected int cursor = 0;
+ private T nextElmt = null;
+
+ protected ElementExtractorBase( final String str ) {
+ this.str = str.strip();
+ }
+
+ @Override
+ public boolean hasNext() {
+ if ( nextElmt != null )
+ return true;
+
+ nextElmt = produceNext();
+ return ( nextElmt != null );
+ }
+
+ @Override
+ public T next() {
+ if ( ! hasNext() )
+ throw new NoSuchElementException();
+
+ final T r = nextElmt;
+ nextElmt = null;
+ return r;
+ }
+
+ protected abstract T produceNext();
+
+ protected void consumeWhiteSpace() {
+ while ( cursor < str.length() && str.charAt(cursor) == ' ' )
+ cursor++;
+ }
+
+ protected void advanceToEndOfSubList() {
+ while ( cursor < str.length() && str.charAt(cursor) != ']' ) {
+ cursor++;
+ if ( str.charAt(cursor) == '[' ) {
+ advanceToEndOfSubList();
+ cursor++;
+ }
+ else if ( str.charAt(cursor) == '{' ) {
+ advanceToEndOfSubMap();
+ cursor++;
+ }
+ }
+ }
+
+ protected void advanceToEndOfSubMap() {
+ while ( cursor < str.length() && str.charAt(cursor) != '}' ) {
+ cursor++;
+ if ( str.charAt(cursor) == '[' ) {
+ advanceToEndOfSubList();
+ cursor++;
+ }
+ else if ( str.charAt(cursor) == '{' ) {
+ advanceToEndOfSubMap();
+ cursor++;
+ }
+ }
+ }
+
+ protected void advanceToNextCommaOrEnd() {
+ while ( cursor < str.length() && str.charAt(cursor) != ',' )
+ cursor++;
+ }
+ }
+
+
+ protected static class ListElementExtractor extends ElementExtractorBase<String> {
+ public ListElementExtractor( final String listAsString ) {
+ super(listAsString);
+ }
+
+ @Override
+ public String produceNext() {
+ consumeWhiteSpace();
+ if ( cursor >= str.length() ) {
+ return null;
+ }
+
+ final int nextElmtBegin = cursor;
+ if ( str.charAt(cursor) == '[' ) {
+ advanceToEndOfSubList();
+ }
+ else if ( str.charAt(cursor) == '{' ) {
+ advanceToEndOfSubMap();
+ }
+ advanceToNextCommaOrEnd();
+ final String nextElmt = str.substring(nextElmtBegin, cursor).strip();
+ cursor++; // move cursor to after comma
+ return nextElmt;
+ }
+ }
+
+
+ protected static class MapElementExtractor extends ElementExtractorBase<Map.Entry<String,String>> {
+ public MapElementExtractor( final String mapAsString ) {
+ super(mapAsString);
+ }
+
+ @Override
+ public Map.Entry<String,String> produceNext() {
+ consumeWhiteSpace();
+ if ( cursor >= str.length() ) {
+ return null;
+ }
+
+ final int nextKeyBegin = cursor;
+ advanceToNextColon();
+ final String nextKey = str.substring(nextKeyBegin, cursor).strip();
+
+ cursor++; // move cursor to after colon
+ consumeWhiteSpace();
+ final int nextValueBegin = cursor;
+ if ( str.charAt(cursor) == '[' ) {
+ advanceToEndOfSubList();
+ }
+ else if ( str.charAt(cursor) == '{' ) {
+ advanceToEndOfSubMap();
+ }
+ advanceToNextCommaOrEnd();
+ final String nextValue = str.substring(nextValueBegin, cursor).strip();
+ cursor++; // move cursor to after comma
+
+ return new Map.Entry<>() {
+ @Override public String getKey() { return nextKey; }
+ @Override public String getValue() { return nextValue; }
+ @Override public String setValue(String v) { throw new UnsupportedOperationException(); }
+ };
+ }
+
+ protected void advanceToNextColon() {
+ while ( cursor < str.length() && str.charAt(cursor) != ':' )
+ cursor++;
+ }
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java
index 923836a7bc..9697424993 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/ExecutionDispatch.java
@@ -272,6 +272,13 @@ class ExecutionDispatch implements OpVisitor {
push(qIter);
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ QueryIterator input = pop();
+ QueryIterator qIter = opExecutor.execute(opUnfold, input);
+ push(qIter);
+ }
+
@Override
public void visit(OpSlice opSlice) {
QueryIterator input = pop();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java
index 0edb6b263d..8e015e7a9a 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/OpExecutor.java
@@ -450,6 +450,12 @@ public class OpExecutor {
return qIter;
}
+ protected QueryIterator execute(OpUnfold opUnfold, QueryIterator input) {
+ QueryIterator qIter = exec(opUnfold.getSubOp(), input);
+ qIter = new QueryIterUnfold(qIter, opUnfold.getExpr(), opUnfold.getVar1(), opUnfold.getVar2(), execCxt);
+ return qIter;
+ }
+
public static QueryIterator createRootQueryIterator(ExecutionContext execCxt) {
return QueryIterRoot.create(execCxt);
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
index 882fa9b93d..46d0f6dbc8 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/main/VarFinder.java
@@ -122,7 +122,7 @@ public class VarFinder
Set<Var> filterMentions = null ;
// Used in a filter, before defined
Set<Var> filterMentionsOnly = null ;
- // Used in assign or extend expression
+ // Used in assign or extend or unfold expression
Set<Var> assignMentions = null ;
VarUsageVisitor() {
@@ -376,6 +376,18 @@ public class VarFinder
return result;
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ opUnfold.getSubOp().visit(this);
+
+ defines.add( opUnfold.getVar1() );
+
+ if ( opUnfold.getVar2() != null )
+ defines.add( opUnfold.getVar2() );
+
+ ExprVars.nonOpVarsMentioned( assignMentions, opUnfold.getExpr() );
+ }
+
@Override
public void visit(OpProject opProject) {
List<Var> vars = opProject.getVars();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java
index 5299b5c1f7..201ce5a892 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/Evaluator.java
@@ -29,6 +29,7 @@ import org.apache.jena.sparql.core.TriplePath;
import org.apache.jena.sparql.core.Var;
import org.apache.jena.sparql.core.VarExprList;
import org.apache.jena.sparql.engine.ExecutionContext;
+import org.apache.jena.sparql.expr.Expr;
import org.apache.jena.sparql.expr.ExprAggregator;
import org.apache.jena.sparql.expr.ExprList;
import org.apache.jena.sparql.pfunction.PropFuncArg;
@@ -46,6 +47,7 @@ public interface Evaluator
public Table assign(Table table, VarExprList exprs);
public Table extend(Table table, VarExprList exprs);
+ public Table unfold(Table table, Expr expr, Var var1, Var var2);
public Table join(Table tableLeft, Table tableRight);
public Table leftJoin(Table tableLeft, Table tableRight, ExprList expr);
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java
index f1b1de2790..b459ce606b 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorDispatch.java
@@ -309,6 +309,13 @@ public class EvaluatorDispatch implements OpVisitor {
push(table);
}
+ @Override
+ public void visit(OpUnfold opUnfold) {
+ Table table = eval(opUnfold.getSubOp());
+ table = evaluator.unfold(table, opUnfold.getExpr(), opUnfold.getVar1(), opUnfold.getVar2());
+ push(table);
+ }
+
@Override
public void visit(OpGroup opGroup) {
Table table = eval(opGroup.getSubOp());
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java
index 749402c18b..5b1c3fb58b 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/ref/EvaluatorSimple.java
@@ -36,6 +36,7 @@ import org.apache.jena.sparql.engine.binding.Binding;
import org.apache.jena.sparql.engine.binding.BindingBuilder;
import org.apache.jena.sparql.engine.iterator.*;
import org.apache.jena.sparql.engine.main.QC;
+import org.apache.jena.sparql.expr.Expr;
import org.apache.jena.sparql.expr.ExprAggregator;
import org.apache.jena.sparql.expr.ExprList;
import org.apache.jena.sparql.pfunction.PropFuncArg;
@@ -250,6 +251,13 @@ public class EvaluatorSimple implements Evaluator {
return new TableN(qIter);
}
+ @Override
+ public Table unfold(Table table, Expr expr, Var var1, Var var2) {
+ QueryIterator qIter = table.iterator(getExecContext());
+ qIter = new QueryIterUnfold(qIter, expr, var1, var2, getExecContext());
+ return new TableN(qIter);
+ }
+
@Override
public Table unit() {
return TableFactory.createUnit();
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValueCmp.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValueCmp.java
index 23fc679298..280f37506d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValueCmp.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/NodeValueCmp.java
@@ -28,8 +28,11 @@ import java.util.Objects;
import javax.xml.datatype.Duration;
import org.apache.jena.atlas.lib.StrUtils;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.Triple;
+import org.apache.jena.graph.impl.LiteralLabel;
import org.apache.jena.sparql.ARQInternalErrorException;
import org.apache.jena.sparql.SystemARQ;
import org.apache.jena.sparql.expr.nodevalue.NodeFunctions;
@@ -144,6 +147,17 @@ public class NodeValueCmp {
raise(new ExprEvalException("Incompatible: " + nv1 + " and " + nv2));
// Not same node.
return false;
+
+ case VSPACE_CDT_LIST : {
+ final LiteralLabel lit1 = nv1.asNode().getLiteral() ;
+ final LiteralLabel lit2 = nv2.asNode().getLiteral() ;
+ return CompositeDatatypeList.type.isEqual(lit1, lit2) ;
+ }
+ case VSPACE_CDT_MAP : {
+ final LiteralLabel lit1 = nv1.asNode().getLiteral() ;
+ final LiteralLabel lit2 = nv2.asNode().getLiteral() ;
+ return CompositeDatatypeMap.type.isEqual(lit1, lit2) ;
+ }
}
throw new ARQInternalErrorException("sameValueAs failure " + nv1 + " and " + nv2);
@@ -204,14 +218,17 @@ public class NodeValueCmp {
if ( nv2 == null )
return CMP_GREATER;
- if ( nv1.hasNode() && nv2.hasNode() ) {
+ ValueSpace compType = classifyValueOp(nv1, nv2) ;
+
+ if ( nv1.hasNode()
+ && nv2.hasNode()
+ && compType != ValueSpace.VSPACE_CDT_LIST
+ && compType != ValueSpace.VSPACE_CDT_MAP ) {
// Fast path - same RDF term => CMP_EQUAL
if ( nv1.getNode().equals(nv2.getNode()) )
return CMP_EQUAL;
}
- ValueSpace compType = classifyValueOp(nv1, nv2) ;
-
// Special case - date/dateTime comparison is affected by timezones and may be
// indeterminate based on the value of the dateTime/date.
// Do this first, so that indeterminate can drop through to a general ordering.
@@ -349,6 +366,28 @@ public class NodeValueCmp {
raise(new ExprNotComparableException("Can't compare valiables as values "+nv1+" and "+nv2)) ;
}
+ case VSPACE_CDT_LIST : {
+ final LiteralLabel lit1 = nv1.asNode().getLiteral() ;
+ final LiteralLabel lit2 = nv2.asNode().getLiteral() ;
+ try {
+ return CompositeDatatypeList.compare(lit1, lit2, sortOrderingCompare) ;
+ }
+ catch( final ExprNotComparableException e ) {
+ raise(e) ;
+ }
+ }
+
+ case VSPACE_CDT_MAP : {
+ final LiteralLabel lit1 = nv1.asNode().getLiteral() ;
+ final LiteralLabel lit2 = nv2.asNode().getLiteral() ;
+ try {
+ return CompositeDatatypeMap.compare(lit1, lit2, sortOrderingCompare) ;
+ }
+ catch( final ExprNotComparableException e ) {
+ raise(e) ;
+ }
+ }
+
case VSPACE_UNKNOWN : {
// One or two unknown value spaces.
Node node1 = nv1.asNode() ;
@@ -427,6 +466,18 @@ public class NodeValueCmp {
return NodeCmp$compareRDFTerms(nv1, nv2);
}
+ if ( vs1 == ValueSpace.VSPACE_CDT_LIST && vs2 == ValueSpace.VSPACE_CDT_LIST ) {
+ LiteralLabel l1 = nv1.asNode().getLiteral();
+ LiteralLabel l2 = nv2.asNode().getLiteral();
+ return CompositeDatatypeList.compare(l1, l2, true);
+ }
+
+ if ( vs1 == ValueSpace.VSPACE_CDT_MAP && vs2 == ValueSpace.VSPACE_CDT_MAP ) {
+ LiteralLabel l1 = nv1.asNode().getLiteral();
+ LiteralLabel l2 = nv2.asNode().getLiteral();
+ return CompositeDatatypeMap.compare(l1, l2, true);
+ }
+
// XXX G and Date cases.
int vsOrder = ValueSpace.comparisonOrder(vs1, vs2);
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ValueSpace.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ValueSpace.java
index 4ac00d4dab..8440eff14c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/ValueSpace.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/ValueSpace.java
@@ -18,6 +18,8 @@
package org.apache.jena.sparql.expr;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
import org.apache.jena.sparql.SystemARQ;
import org.apache.jena.sparql.util.NodeUtils;
@@ -95,6 +97,9 @@ public enum ValueSpace {
// VSPACE_G_MONTH(230),
// VSPACE_G_DAY(240),
+ VSPACE_CDT_LIST(300),
+ VSPACE_CDT_MAP(301),
+
VSPACE_SORTKEY(900),
VSPACE_QUOTED_TRIPLE(999), // RDF-star : Last recognized value space.
@@ -188,6 +193,12 @@ public enum ValueSpace {
if ( nv.isSortKey() ) return VSPACE_SORTKEY ;
+ if ( nv.isLiteral() ) {
+ final String dtURI = nv.getDatatypeURI() ;
+ if ( CompositeDatatypeList.uri.equals(dtURI) ) return VSPACE_CDT_LIST ;
+ if ( CompositeDatatypeMap.uri.equals(dtURI) ) return VSPACE_CDT_MAP ;
+ }
+
//if ( nv.isLiteral() ) return VSPACE_UNKNOWN ;
if ( nv.isBlank() ) return VSPACE_BLANKNODE;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AccumulatorExpr.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AccumulatorExpr.java
index d8c5de3f35..4d59ad2632 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AccumulatorExpr.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AccumulatorExpr.java
@@ -35,7 +35,7 @@ public abstract class AccumulatorExpr implements Accumulator
private long accCount = 0 ;
protected long errorCount = 0 ;
private final Expr expr ;
- private final boolean makeDistinct;
+ protected final boolean makeDistinct;
protected AccumulatorExpr(Expr expr, boolean makeDistinct) {
this.expr = expr;
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldList.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldList.java
new file mode 100644
index 0000000000..52687ef030
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldList.java
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.expr.aggregate;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+
+import org.apache.jena.atlas.data.BagFactory;
+import org.apache.jena.atlas.data.SerializationFactory;
+import org.apache.jena.atlas.data.SortedDataBag;
+import org.apache.jena.atlas.data.ThresholdPolicy;
+import org.apache.jena.atlas.data.ThresholdPolicyFactory;
+import org.apache.jena.atlas.io.IndentedLineBuffer;
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.query.ARQ;
+import org.apache.jena.query.SortCondition;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.engine.binding.BindingComparator;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionEnv;
+import org.apache.jena.sparql.function.library.cdt.CDTLiteralFunctionUtils;
+import org.apache.jena.sparql.serializer.SerializationContext;
+import org.apache.jena.sparql.sse.writers.WriterExpr;
+import org.apache.jena.sparql.system.SerializationFactoryFinder;
+import org.apache.jena.sparql.util.ExprUtils;
+
+public class AggFoldList extends AggregatorBase
+{
+ protected final List<SortCondition> orderBy;
+ protected final ThresholdPolicy<Binding> policy;
+ protected final Comparator<Binding> comparator;
+
+ public AggFoldList( final boolean isDistinct, final Expr expr1 ) {
+ this(isDistinct, expr1, null);
+ }
+
+ public AggFoldList( final boolean isDistinct, final Expr expr1, final List<SortCondition> orderBy ) {
+ // We need to extract the expressions from the sort conditions
+ // as well in order for them to be considered by the algebra
+ // transformer that renames variables from subqueries (see
+ // {@link TransformScopeRename#RenameByScope}).
+ super( "FOLD", isDistinct, collectExprs(expr1, orderBy) );
+
+ this.orderBy = orderBy;
+
+ if ( orderBy != null && ! orderBy.isEmpty() ) {
+ policy = ThresholdPolicyFactory.policyFromContext( ARQ.getContext() );
+ comparator = new BindingComparator(orderBy);
+ }
+ else {
+ policy = null;
+ comparator = null;
+ }
+ }
+
+ protected static ExprList collectExprs( final Expr expr1, final List<SortCondition> orderBy ) {
+ final ExprList l = new ExprList(expr1);
+
+ if ( orderBy != null ) {
+ for ( final SortCondition c : orderBy ) {
+ l.add( c.getExpression() );
+ }
+ }
+
+ return l;
+ }
+
+ @Override
+ public Aggregator copy( final ExprList exprs ) {
+ final Expr _expr1;
+ final List<SortCondition> _orderBy;
+ if ( orderBy == null ) {
+ if ( exprs.size() != 1 ) throw new IllegalArgumentException();
+
+ _expr1 = exprs.get(0);
+ _orderBy = null;
+ }
+ else {
+ if ( exprs.size() != orderBy.size()+1 ) throw new IllegalArgumentException();
+
+
+ final Iterator<SortCondition> cit = orderBy.iterator();
+ final Iterator<Expr> eit = exprs.iterator();
+
+ _expr1 = eit.next();
+
+ _orderBy = new ArrayList<>( orderBy.size() );
+ while ( eit.hasNext() ) {
+ final SortCondition c = new SortCondition( eit.next(), cit.next().getDirection() );
+ _orderBy.add(c);
+ }
+ }
+
+ return new AggFoldList(isDistinct, _expr1, _orderBy);
+ }
+
+ @Override
+ public boolean equals( final Aggregator other, final boolean bySyntax ) {
+ if ( other == null ) return false;
+ if ( this == other ) return true;
+ if ( ! ( other instanceof AggFoldList ) )
+ return false;
+ final AggFoldList fold = (AggFoldList) other;
+ return (isDistinct == fold.isDistinct)
+ && getExprList().get(0).equals(fold.getExprList().get(0), bySyntax)
+ && Objects.equals(orderBy, fold.orderBy);
+ }
+
+ @Override
+ public Accumulator createAccumulator() {
+ if ( orderBy != null && ! orderBy.isEmpty() )
+ return new SortingListAccumulator();
+ else
+ return new BasicListAccumulator( getExprList().get(0), isDistinct );
+ }
+
+ @Override
+ public Node getValueEmpty() {
+ final List<CDTValue> emptyList = new ArrayList<>();
+ return CDTLiteralFunctionUtils.createNode(emptyList);
+ }
+
+ @Override
+ public int hashCode() {
+ return HC_AggFoldList ^ getExpr().hashCode();
+ }
+
+ @Override
+ public String asSparqlExpr( final SerializationContext sCxt ) {
+ final IndentedLineBuffer out = new IndentedLineBuffer();
+ out.append( getName() );
+ out.append( "(" );
+
+ if ( isDistinct )
+ out.append("DISTINCT ");
+
+ ExprUtils.fmtSPARQL(out, getExprList().get(0), sCxt);
+
+ if ( orderBy != null && ! orderBy.isEmpty() ) {
+ out.append(" ORDER BY ");
+ final Iterator<SortCondition> it = orderBy.iterator();
+ while ( it.hasNext() ) {
+ it.next().output(out, sCxt);
+ if ( it.hasNext() ) out.append(", ");
+ }
+ }
+
+ out.append(")");
+ return out.asString();
+ }
+
+ @Override
+ public String toPrefixString() {
+ final IndentedLineBuffer out = new IndentedLineBuffer();
+ out.append("(");
+ out.append( getName().toLowerCase(Locale.ROOT) );
+ out.incIndent();
+
+ if ( isDistinct )
+ out.append(" distinct");
+
+ WriterExpr.output(out, getExprList().get(0), null);
+
+ if ( orderBy != null && ! orderBy.isEmpty() ) {
+ out.append(" order by ");
+ out.incIndent();
+ for ( final SortCondition c : orderBy ) {
+ c.output(out);
+ }
+ out.decIndent();
+ }
+
+ out.decIndent();
+ out.append(")");
+ return out.asString();
+ }
+
+ protected static class BasicListAccumulator extends AccumulatorExpr {
+ final protected List<CDTValue> list = new ArrayList<>();
+ protected boolean nullValueAdded = false;
+
+ protected BasicListAccumulator( final Expr expr, final boolean makeDistinct ) {
+ super(expr, makeDistinct);
+ }
+
+ @Override
+ protected void accumulate( final NodeValue nv, final Binding binding, final FunctionEnv functionEnv ) {
+ final CDTValue v = CDTFactory.createValue( nv.asNode() );
+ list.add(v);
+ }
+
+ @Override
+ protected void accumulateError( final Binding binding, final FunctionEnv functionEnv ) {
+ // By definition of FOLD, evaluation errors result in null values
+ // for the created list. If FOLD is used with the keyword DISTINCT,
+ // then all errors collapse to a single null value.
+ if ( makeDistinct && nullValueAdded ) {
+ return;
+ }
+
+ nullValueAdded = true;
+
+ final CDTValue v = CDTFactory.getNullValue();
+ list.add(v);
+ }
+
+ @Override
+ protected NodeValue getAccValue() {
+ return CDTLiteralFunctionUtils.createNodeValue(list);
+ }
+
+ // Overriding this function because the base class would otherwise not
+ // call getAccValue() in cases in which there was an error during the
+ // evaluation of the 'expr' for any of the solution mappings. For FOLD,
+ // however, errors do not cause an aggregation error but just produce
+ // null values in the created list.
+ @Override
+ public NodeValue getValue() {
+ return getAccValue();
+ }
+ }
+
+ protected class SortingListAccumulator implements Accumulator {
+ protected final SortedDataBag<Binding> sbag;
+ protected FunctionEnv functionEnv = null;
+
+ public SortingListAccumulator() {
+ final SerializationFactory<Binding> sf = SerializationFactoryFinder.bindingSerializationFactory();
+ sbag = BagFactory.newSortedBag(policy, sf, comparator);
+ }
+
+ @Override
+ public void accumulate( final Binding binding, final FunctionEnv functionEnv ) {
+ sbag.add(binding);
+
+ if ( this.functionEnv == null )
+ this.functionEnv = functionEnv;
+ }
+
+ @Override
+ public NodeValue getValue() {
+ final Iterator<Binding> it = sbag.iterator();
+ final Accumulator acc = new BasicListAccumulator( getExprList().get(0), isDistinct );
+
+ while ( it.hasNext() ) {
+ acc.accumulate( it.next(), functionEnv );
+ }
+
+ sbag.close();
+
+ return acc.getValue();
+ }
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldMap.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldMap.java
new file mode 100644
index 0000000000..923e42934b
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggFoldMap.java
@@ -0,0 +1,285 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.expr.aggregate;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+
+import org.apache.jena.atlas.data.BagFactory;
+import org.apache.jena.atlas.data.SerializationFactory;
+import org.apache.jena.atlas.data.SortedDataBag;
+import org.apache.jena.atlas.data.ThresholdPolicy;
+import org.apache.jena.atlas.data.ThresholdPolicyFactory;
+import org.apache.jena.atlas.io.IndentedLineBuffer;
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.query.ARQ;
+import org.apache.jena.query.SortCondition;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.engine.binding.BindingComparator;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprLib;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionEnv;
+import org.apache.jena.sparql.function.library.cdt.CDTLiteralFunctionUtils;
+import org.apache.jena.sparql.serializer.SerializationContext;
+import org.apache.jena.sparql.sse.writers.WriterExpr;
+import org.apache.jena.sparql.system.SerializationFactoryFinder;
+import org.apache.jena.sparql.util.ExprUtils;
+
+public class AggFoldMap extends AggregatorBase
+{
+ protected final Expr expr1; // While the values of these member variables can also be extracted from the ExprList (see
+ protected final Expr expr2; // createExprList below), keeping these copies here makes it easier to access these values.
+
+ protected final List<SortCondition> orderBy;
+ protected final ThresholdPolicy<Binding> policy;
+ protected final Comparator<Binding> comparator;
+
+ public AggFoldMap( final Expr expr1, final Expr expr2 ) {
+ this(expr1, expr2, null);
+ }
+
+ public AggFoldMap( final Expr expr1, final Expr expr2, final List<SortCondition> orderBy ) {
+ // We need to extract the expressions from the sort conditions
+ // as well in order for them to be considered by the algebra
+ // transformer that renames variables from subqueries (see
+ // {@link TransformScopeRename#RenameByScope}).
+ super( "FOLD", false, collectExprs(expr1, expr2, orderBy) );
+
+ this.expr1 = expr1;
+ this.expr2 = expr2;
+
+ this.orderBy = orderBy;
+
+ if ( orderBy != null && ! orderBy.isEmpty() ) {
+ policy = ThresholdPolicyFactory.policyFromContext( ARQ.getContext() );
+ comparator = new BindingComparator(orderBy);
+ }
+ else {
+ policy = null;
+ comparator = null;
+ }
+ }
+
+ protected static ExprList collectExprs( final Expr expr1, final Expr expr2, final List<SortCondition> orderBy ) {
+ final ExprList l = new ExprList();
+ l.add(expr1);
+ l.add(expr2);
+
+ if ( orderBy != null ) {
+ for ( final SortCondition c : orderBy ) {
+ l.add( c.getExpression() );
+ }
+ }
+
+ return l;
+ }
+
+ @Override
+ public Aggregator copy( final ExprList exprs ) {
+ final Expr _expr1;
+ final Expr _expr2;
+ final List<SortCondition> _orderBy;
+ if ( orderBy == null ) {
+ if ( exprs.size() != 2 ) throw new IllegalArgumentException();
+
+ _expr1 = exprs.get(0);
+ _expr2 = exprs.get(1);
+ _orderBy = null;
+ }
+ else {
+ if ( exprs.size() != orderBy.size()+2 ) throw new IllegalArgumentException();
+
+
+ final Iterator<SortCondition> cit = orderBy.iterator();
+ final Iterator<Expr> eit = exprs.iterator();
+
+ _expr1 = eit.next();
+ _expr2 = eit.next();
+
+ _orderBy = new ArrayList<>( orderBy.size() );
+ while ( eit.hasNext() ) {
+ final SortCondition c = new SortCondition( eit.next(), cit.next().getDirection() );
+ _orderBy.add(c);
+ }
+ }
+
+ return new AggFoldMap(_expr1, _expr2, _orderBy);
+ }
+
+ @Override
+ public boolean equals( final Aggregator other, final boolean bySyntax ) {
+ if ( other == null ) return false;
+ if ( this == other ) return true;
+ if ( ! ( other instanceof AggFoldMap ) )
+ return false;
+ final AggFoldMap fold = (AggFoldMap) other;
+ return exprList.equals(fold.exprList, bySyntax)
+ && Objects.equals(orderBy, fold.orderBy);
+ }
+
+ @Override
+ public Accumulator createAccumulator() {
+ if ( orderBy != null && ! orderBy.isEmpty() )
+ return new SortingMapAccumulator();
+ else
+ return new BasicMapAccumulator();
+ }
+
+ @Override
+ public Node getValueEmpty() {
+ final Map<CDTKey,CDTValue> emptyMap = new HashMap<>();
+ return CDTLiteralFunctionUtils.createNode(emptyMap);
+ }
+
+ @Override
+ public int hashCode() {
+ int hc = HC_AggFoldMap;
+ hc ^= getExprList().get(0).hashCode();
+ hc ^= getExprList().get(1).hashCode();
+
+ return hc;
+ }
+
+ @Override
+ public String asSparqlExpr( final SerializationContext sCxt ) {
+ final IndentedLineBuffer out = new IndentedLineBuffer();
+ out.append( getName() );
+ out.append( "(" );
+
+ ExprUtils.fmtSPARQL(out, expr1, sCxt);
+ out.append(", ");
+ ExprUtils.fmtSPARQL(out, expr2, sCxt);
+
+ if ( orderBy != null && ! orderBy.isEmpty() ) {
+ out.append(" ORDER BY ");
+ final Iterator<SortCondition> it = orderBy.iterator();
+ while ( it.hasNext() ) {
+ it.next().output(out, sCxt);
+ if ( it.hasNext() ) out.append(", ");
+ }
+ }
+
+ out.append(")");
+ return out.asString();
+ }
+
+ @Override
+ public String toPrefixString() {
+ final IndentedLineBuffer out = new IndentedLineBuffer();
+ out.append("(");
+ out.append( getName().toLowerCase(Locale.ROOT) );
+ out.incIndent();
+
+ WriterExpr.output(out, expr1, null);
+ out.append(", ");
+ WriterExpr.output(out, expr2, null);
+
+ if ( orderBy != null && ! orderBy.isEmpty() ) {
+ out.append(" order by ");
+ out.incIndent();
+ for ( final SortCondition c : orderBy ) {
+ c.output(out);
+ }
+ out.decIndent();
+ }
+
+ out.decIndent();
+ out.append(")");
+ return out.asString();
+ }
+
+ protected class BasicMapAccumulator implements Accumulator {
+ final protected Map<CDTKey,CDTValue> map = new HashMap<>();
+
+ @Override
+ public void accumulate( final Binding binding, final FunctionEnv functionEnv ) {
+ final NodeValue nvKey = ExprLib.evalOrNull(expr1, binding, functionEnv);
+ if ( nvKey == null ) {
+ return; // ignore if creating the key using the given binding failed
+ }
+ if ( nvKey.isBlank() ) {
+ return; // ignore if the key would be a blank node
+ }
+
+ final CDTKey key = CDTFactory.createKey( nvKey.asNode() );
+
+ // TODO: what do we do if the map already contains an entry with the same key?
+
+ final CDTValue value;
+ final NodeValue nvValue = ExprLib.evalOrNull(expr2, binding, functionEnv);
+ if ( nvValue == null ) {
+ value = CDTFactory.getNullValue();
+ }
+ else {
+ value = CDTFactory.createValue( nvValue.asNode() );
+ }
+
+ map.put(key, value);
+ }
+
+ @Override
+ public NodeValue getValue() {
+ return CDTLiteralFunctionUtils.createNodeValue(map);
+ }
+ }
+
+ protected class SortingMapAccumulator implements Accumulator {
+ protected final SortedDataBag<Binding> sbag;
+ protected FunctionEnv functionEnv = null;
+
+ public SortingMapAccumulator() {
+ final SerializationFactory<Binding> sf = SerializationFactoryFinder.bindingSerializationFactory();
+ sbag = BagFactory.newSortedBag(policy, sf, comparator);
+ }
+
+ @Override
+ public void accumulate( final Binding binding, final FunctionEnv functionEnv ) {
+ sbag.add(binding);
+
+ if ( this.functionEnv == null )
+ this.functionEnv = functionEnv;
+ }
+
+ @Override
+ public NodeValue getValue() {
+ final Iterator<Binding> it = sbag.iterator();
+ final Accumulator acc = new BasicMapAccumulator();
+
+ while ( it.hasNext() ) {
+ acc.accumulate( it.next(), functionEnv );
+ }
+
+ sbag.close();
+
+ return acc.getValue();
+ }
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
index d60edb1116..4942b842f4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorBase.java
@@ -187,4 +187,7 @@ public abstract class AggregatorBase implements Aggregator
protected static final int HC_AggMode = 0x184 ;
protected static final int HC_AggModeDistinct = 0x185 ;
+ protected static final int HC_AggFoldList = 0x186 ;
+ protected static final int HC_AggFoldMap = 0x187 ;
+
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorFactory.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorFactory.java
index ee99bf43e8..4d99bdeb9a 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorFactory.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggregatorFactory.java
@@ -18,8 +18,11 @@
package org.apache.jena.sparql.expr.aggregate ;
+import java.util.List;
+
import org.apache.jena.atlas.lib.NotImplemented ;
import org.apache.jena.atlas.logging.Log ;
+import org.apache.jena.query.SortCondition;
import org.apache.jena.sparql.expr.Expr ;
import org.apache.jena.sparql.expr.ExprList ;
@@ -71,6 +74,13 @@ public class AggregatorFactory {
return new AggNull() ;
}
+ public static Aggregator createFold(boolean distinct, Expr expr1, Expr expr2, List<SortCondition> orderBy) {
+ if ( expr2 == null )
+ return new AggFoldList(distinct, expr1, orderBy) ;
+ else
+ return new AggFoldMap(expr1, expr2, orderBy) ;
+ }
+
public static Aggregator createCustom(String iri, Args a) {
return createCustom(iri, a.distinct, ExprList.copy(a)) ;
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
index a7452a464a..9c76c03723 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
@@ -19,6 +19,7 @@
package org.apache.jena.sparql.function;
import org.apache.jena.sparql.ARQConstants;
+import org.apache.jena.sparql.function.library.cdt.CDTLiteralFunctions;
import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
/** Load ARQ functions ().
@@ -33,5 +34,6 @@ public class ARQFunctions {
public static void load(FunctionRegistry reg) {
TripleTermFunctions.register(reg);
+ CDTLiteralFunctions.register(reg);
}
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java
new file mode 100644
index 0000000000..d7d5f14674
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
+import org.apache.jena.datatypes.DatatypeFormatException;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.impl.LiteralLabel;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.NodeValue;
+
+public class CDTLiteralFunctionUtils
+{
+ /**
+ * Uses {@link CompositeDatatypeList#isListLiteral(Node)} to check whether
+ * the given node is a cdt:List literal and throws an exception if not.
+ */
+ public static final void ensureListLiteral( final Node n ) throws ExprEvalException {
+ if ( ! CompositeDatatypeList.isListLiteral(n) )
+ throw new ExprEvalException("Not a cdt:List literal: " + n);
+ }
+
+ /**
+ * Uses {@link CompositeDatatypeMap#isMapLiteral(Node)} to check whether
+ * the given node is a cdt:Map literal and throws an exception if not.
+ */
+ public static final void ensureMapLiteral( final Node n ) throws ExprEvalException {
+ if ( ! CompositeDatatypeMap.isMapLiteral(n) )
+ throw new ExprEvalException("Not a cdt:Map literal: " + n);
+ }
+
+ /**
+ * Assumes that the given node is a cdt:List literal and uses
+ * {@link CompositeDatatypeList#getValue(LiteralLabel)} to get
+ * the list.
+ *
+ * Throws an ExprEvalException if a DatatypeFormatException is
+ * thrown by {@link CompositeDatatypeList#getValue(LiteralLabel)}.
+ */
+ public static final List<CDTValue> getList( final Node n ) throws ExprEvalException {
+ if ( ! n.getLiteral().isWellFormed() )
+ throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n);
+
+ try {
+ return CompositeDatatypeList.getValue( n.getLiteral() );
+ }
+ catch ( final DatatypeFormatException ex ) {
+ throw new ExprEvalException("Not a well-formed cdt:List literal: " + n, ex);
+ }
+ }
+
+ /**
+ * Assumes that the given node is a cdt:Map literal and uses
+ * {@link CompositeDatatypeMap#getValue(LiteralLabel)} to get
+ * the map.
+ *
+ * Throws an ExprEvalException if a DatatypeFormatException is
+ * thrown by {@link CompositeDatatypeMap#getValue(LiteralLabel)}.
+ */
+ public static final Map<CDTKey,CDTValue> getMap( final Node n ) throws ExprEvalException {
+ if ( ! n.getLiteral().isWellFormed() )
+ throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n);
+
+ try {
+ return CompositeDatatypeMap.getValue( n.getLiteral() );
+ }
+ catch ( final DatatypeFormatException ex ) {
+ throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n, ex);
+ }
+ }
+
+ /**
+ * Calls {@link #ensureListLiteral(Node)} first, and {@link #getList(Node)}
+ * afterwards.
+ */
+ public static final List<CDTValue> checkAndGetList( final Node n ) throws ExprEvalException {
+ ensureListLiteral(n);
+ return getList(n);
+ }
+
+ /**
+ * Calls {@link #ensureMapLiteral(Node)} first, and {@link #getMap(Node)}
+ * afterwards.
+ */
+ public static final Map<CDTKey,CDTValue> checkAndGetMap( final Node n ) throws ExprEvalException {
+ ensureMapLiteral(n);
+ return getMap(n);
+ }
+
+ public static final List<CDTValue> checkAndGetList( final NodeValue nv ) throws ExprEvalException {
+ return checkAndGetList( nv.asNode() );
+ }
+
+ public static final Map<CDTKey,CDTValue> checkAndGetMap( final NodeValue nv ) throws ExprEvalException {
+ return checkAndGetMap( nv.asNode() );
+ }
+
+ /**
+ * Creates a {@link NodeV} with a cdt:List literal that represents the
+ * given list.
+ */
+ public static final Node createNode( final List<CDTValue> list ) {
+ return NodeFactory.createLiteralByValue(list, CompositeDatatypeList.type);
+ }
+
+ /**
+ * Creates a {@link Node} with a cdt:Map literal that represents the
+ * given map.
+ */
+ public static final Node createNode( final Map<CDTKey,CDTValue> map ) {
+ return NodeFactory.createLiteralByValue(map, CompositeDatatypeMap.type);
+ }
+
+ /**
+ * Creates a {@link NodeValue} with a cdt:List literal that represents the
+ * given list.
+ */
+ public static final NodeValue createNodeValue( final List<CDTValue> list ) {
+ return NodeValue.makeNode( createNode(list) );
+ }
+
+ /**
+ * Creates a {@link NodeValue} with a cdt:Map literal that represents the
+ * given map.
+ */
+ public static final NodeValue createNodeValue( final Map<CDTKey,CDTValue> map ) {
+ return NodeValue.makeNode( createNode(map) );
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java
new file mode 100644
index 0000000000..35b2e78a78
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import org.apache.jena.sparql.ARQConstants;
+import org.apache.jena.sparql.function.FunctionRegistry;
+
+public class CDTLiteralFunctions {
+ public static void register( final FunctionRegistry functionRegistry ) {
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "concat", ConcatFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "contains", ContainsFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "containsKey", ContainsKeyFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "containsTerm", ContainsTermFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "get", GetFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "head", HeadFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "keys", KeysFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "List", ListFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "Map", MapFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "merge", MergeFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "put", PutFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "remove", RemoveFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "reverse", ReverseFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "size", SizeFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "subseq", SubSeqFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "tail", TailFct.class );
+ }
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java
new file mode 100644
index 0000000000..6a0dba2350
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase;
+
+public class ConcatFct extends FunctionBase
+{
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ // nothing to check
+ }
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ if ( args.isEmpty() ) {
+ final List<CDTValue> result = Collections.emptyList();
+ return CDTLiteralFunctionUtils.createNodeValue(result);
+ }
+
+ if ( args.size() == 1 ) {
+ final NodeValue nv = args.get(0);
+ // make sure that the argument is a well-formed cdt:List literal
+ CDTLiteralFunctionUtils.checkAndGetList(nv);
+
+ return nv;
+ }
+
+ final List<CDTValue> result = new ArrayList<>();
+ for ( final NodeValue nv : args ) {
+ final List<CDTValue> l = CDTLiteralFunctionUtils.checkAndGetList(nv);
+ result.addAll(l);
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(result);
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java
new file mode 100644
index 0000000000..90aa9217a8
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.List;
+
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase2;
+
+public class ContainsFct extends FunctionBase2
+{
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv1);
+ final boolean result = containsNode( list, nv2 );
+ return NodeValue.booleanReturn(result);
+ }
+
+ /**
+ * Returns true if the given list contains the given RDF term.
+ */
+ protected boolean containsNode( final List<CDTValue> list, final NodeValue nv ) {
+ for ( final CDTValue v : list ) {
+ if ( v.isNode() ) {
+ final NodeValue vv = NodeValue.makeNode( v.asNode() );
+ if ( NodeValue.sameValueAs(vv, nv) ) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java
new file mode 100644
index 0000000000..88a46fd2d0
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.Map;
+
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase2;
+
+public class ContainsKeyFct extends FunctionBase2
+{
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+
+ final Node n2 = nv2.asNode();
+
+ // If the second argument is not an IRI or a literal, then it cannot be
+ // a map key in the given map and, by definition of cdt:containsKey, we
+ // have to return false.
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ return NodeValue.booleanReturn(false);
+
+ if ( map.isEmpty() )
+ return NodeValue.booleanReturn(false);
+
+ final CDTKey key = CDTFactory.createKey(n2);
+ final CDTValue value = map.get(key);
+
+ return NodeValue.booleanReturn( value != null );
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java
new file mode 100644
index 0000000000..e5fc0421f4
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.List;
+
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.expr.nodevalue.NodeFunctions;
+import org.apache.jena.sparql.function.FunctionBase2;
+
+public class ContainsTermFct extends FunctionBase2
+{
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv1);
+ final boolean result = containsTerm( list, nv2 );
+ return NodeValue.booleanReturn(result);
+ }
+
+ /**
+ * Returns true if the given list contains the given RDF term.
+ */
+ protected boolean containsTerm( final List<CDTValue> list, final NodeValue nv ) {
+ for ( final CDTValue v : list ) {
+ if ( v.isNode() ) {
+ if ( NodeFunctions.sameTerm(v.asNode(), nv.asNode()) ) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java
similarity index 58%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java
index a7452a464a..0b2af54810 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java
@@ -16,22 +16,21 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.sparql.function.library.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import java.util.List;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase1;
+
+public abstract class FunctionBase1List extends FunctionBase1
+{
+ @Override
+ public NodeValue exec( final NodeValue nv ) {
+ final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv);
+ return _exec(list, nv);
+ }
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
+ protected abstract NodeValue _exec( List<CDTValue> list, NodeValue nvList );
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java
new file mode 100644
index 0000000000..24bcbfcfb5
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase2;
+
+public class GetFct extends FunctionBase2
+{
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Node n1 = nv1.asNode();
+
+ if ( CompositeDatatypeList.isListLiteral(n1) )
+ return getFromList(n1, nv2);
+
+ if ( CompositeDatatypeMap.isMapLiteral(n1) )
+ return getFromMap(n1, nv2);
+
+ throw new ExprEvalException("Neither a list nor a map literal: " + nv1);
+ }
+
+ protected NodeValue getFromList( final Node n1, final NodeValue nv2 ) {
+ if ( ! nv2.isInteger() )
+ throw new ExprEvalException("Not an integer literal: " + nv2);
+
+ final int index = nv2.getInteger().intValue();
+
+ if ( index < 1 )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
+
+ final List<CDTValue> list = CDTLiteralFunctionUtils.getList(n1);
+
+ if ( index > list.size() )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
+
+ final CDTValue value = list.get( index-1 );
+ if ( value.isNull() ) {
+ throw new ExprEvalException("accessing null value from list" );
+ }
+ else if ( value.isNode() ) {
+ return NodeValue.makeNode( value.asNode() );
+ }
+ else {
+ throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
+ }
+ }
+
+ protected NodeValue getFromMap( final Node n1, final NodeValue nv2 ) {
+ final Node n2 = nv2.asNode();
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ throw new ExprEvalException("Not a valid map key: " + nv2);
+
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.getMap(n1);
+
+ if ( map.isEmpty() )
+ throw new ExprEvalException("empty map");
+
+ final CDTKey key = CDTFactory.createKey(n2);
+ final CDTValue value = map.get(key);
+
+ if ( value == null ) {
+ throw new ExprEvalException("key is not in the map");
+ }
+ else if ( value.isNull() ) {
+ throw new ExprEvalException("value for key is in null");
+ }
+ else if ( value.isNode() ) {
+ return NodeValue.makeNode( value.asNode() );
+ }
+ else {
+ throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
+ }
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
similarity index 51%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
index a7452a464a..0eb1348f98 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
@@ -16,22 +16,31 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.sparql.function.library.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import java.util.List;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.NodeValue;
+
+public class HeadFct extends FunctionBase1List
+{
+ @Override
+ protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
+ if ( list.size() == 0 )
+ throw new ExprEvalException("Empty list");
+
+ final CDTValue value = list.get(0);
+ if ( value.isNull() ) {
+ throw new ExprEvalException("accessing null value from list" );
+ }
+ else if ( value.isNode() ) {
+ return NodeValue.makeNode( value.asNode() );
+ }
+ else {
+ throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
+ }
+ }
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
similarity index 51%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
index a7452a464a..2c919eb934 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
@@ -16,22 +16,31 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.sparql.function.library.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase1;
+
+public class KeysFct extends FunctionBase1
+{
+ @Override
+ public NodeValue exec( final NodeValue nv ) {
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv);
+
+ final List<CDTValue> list = new ArrayList<>( map.size() );
+ for ( final CDTKey key : map.keySet() ) {
+ final CDTValue value = CDTFactory.createValue( key.asNode() );
+ list.add(value);
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(list);
+ }
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java
new file mode 100644
index 0000000000..dc50559d9f
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprException;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase;
+import org.apache.jena.sparql.function.FunctionEnv;
+
+public class ListFct extends FunctionBase
+{
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ // nothing to do here
+ }
+
+ @Override
+ public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
+ final List<CDTValue> list = new ArrayList<>( args.size() );
+
+ for ( final Expr e : args ) {
+ CDTValue v;
+ try {
+ final NodeValue nv = e.eval(binding, env);
+ v = CDTFactory.createValue( nv.asNode() );
+ } catch ( final ExprException ex ) {
+ v = CDTFactory.getNullValue();
+ }
+
+ list.add(v);
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(list);
+ }
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ throw new IllegalStateException("should never end up here");
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java
new file mode 100644
index 0000000000..fec5c22052
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.atlas.lib.Lib;
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.query.QueryBuildException;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.expr.ExprException;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase;
+import org.apache.jena.sparql.function.FunctionEnv;
+
+public class MapFct extends FunctionBase
+{
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ if ( args.size() % 2 == 1 )
+ throw new QueryBuildException("Function '"+Lib.className(this)+"' takes an even number of arguments");
+ }
+
+ @Override
+ public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
+ if ( args.size() % 2 == 1 )
+ throw new ExprException("Function '"+Lib.className(this)+"' takes an even number of arguments");
+
+ final Map<CDTKey,CDTValue> map = new HashMap<>();
+
+ final Iterator<Expr> it = args.iterator();
+ while ( it.hasNext() ) {
+ final Expr exprKey = it.next();
+ final Expr exprValue = it.next();
+
+ final CDTKey key = getKey(exprKey, binding, env);
+ if ( key != null ) {
+ final CDTValue value = getValue(exprValue, binding, env);
+ map.put(key, value);
+ }
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(map);
+ }
+
+ protected CDTKey getKey( final Expr e, final Binding binding, final FunctionEnv env ) {
+ final NodeValue nv;
+ try {
+ nv = e.eval(binding, env);
+ } catch ( final ExprException ex ) {
+ return null;
+ }
+
+ final Node n = nv.asNode();
+ if ( ! n.isURI() && ! n.isLiteral() )
+ return null;
+
+ return CDTFactory.createKey(n);
+ }
+
+ protected CDTValue getValue( final Expr e, final Binding binding, final FunctionEnv env ) {
+ final NodeValue nv;
+ try {
+ nv = e.eval(binding, env);
+ } catch ( final ExprException ex ) {
+ return CDTFactory.getNullValue();
+ }
+
+ return CDTFactory.createValue( nv.asNode() );
+ }
+
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ throw new IllegalStateException("should never end up here");
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
similarity index 50%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
index a7452a464a..344f3117fa 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
@@ -16,22 +16,33 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.sparql.function.library.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import java.util.HashMap;
+import java.util.Map;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase2;
+
+public class MergeFct extends FunctionBase2
+{
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Map<CDTKey,CDTValue> map1 = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+ final Map<CDTKey,CDTValue> map2 = CDTLiteralFunctionUtils.checkAndGetMap(nv2);
+
+ if ( map1.isEmpty() )
+ return nv2;
+
+ if ( map2.isEmpty() )
+ return nv1;
+
+ final Map<CDTKey,CDTValue> newMap = new HashMap<>(map2);
+ newMap.putAll(map1);
+
+ return CDTLiteralFunctionUtils.createNodeValue(newMap);
+ }
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java
new file mode 100644
index 0000000000..428c000d5b
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.atlas.lib.Lib;
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.query.QueryBuildException;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.ExprException;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase;
+import org.apache.jena.sparql.function.FunctionEnv;
+
+public class PutFct extends FunctionBase
+{
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ if ( args.size() < 2 || args.size() > 3 )
+ throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two or three arguments");
+ }
+
+ @Override
+ public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
+ if ( args.size() < 2 || args.size() > 3 )
+ throw new ExprException("wrong number of arguments (" + args.size() + "), must be 2 or 3");
+
+ // check the second argument first because that's less expensive
+ final NodeValue nv2 = args.get(1).eval(binding, env);
+ final Node n2 = nv2.asNode();
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ throw new ExprEvalException("Not a valid map key: " + nv2);
+
+ // now check the first argument
+ final NodeValue nv1 = args.get(0).eval(binding, env);
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+
+ final CDTKey key = CDTFactory.createKey(n2);
+
+ // produce a map value from the third argument (if any)
+ final CDTValue newValue;
+ if ( args.size() == 2 ) {
+ newValue = CDTFactory.getNullValue();
+ }
+ else { // in this case, we have that args.size() == 3
+ NodeValue nv3 = null;
+ try {
+ nv3 = args.get(2).eval(binding, env);
+ }
+ catch ( final ExprException ex ) {
+ // nothing to do here
+ }
+
+ if ( nv3 != null ) {
+ newValue = CDTFactory.createValue( nv3.asNode() );
+ }
+ else {
+ newValue = CDTFactory.getNullValue();
+ }
+ }
+
+ // check if the given map already contains the exact same map entry
+ // if so, simply return the given cdt:Map literal
+ final CDTValue oldValue = map.get(key);
+ if ( oldValue != null ) {
+ if ( oldValue.isNull() && newValue.isNull() )
+ return nv1;
+
+ if ( ! oldValue.isNull() && ! newValue.isNull() ) {
+ final Node on = oldValue.asNode();
+ final Node nn = newValue.asNode();
+ if ( on.equals(nn) )
+ return nv1;
+ }
+ }
+
+ final Map<CDTKey,CDTValue> newMap = new HashMap<>(map);
+ newMap.put(key, newValue);
+
+ return CDTLiteralFunctionUtils.createNodeValue(newMap);
+ }
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ throw new IllegalStateException("should never end up here");
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java
new file mode 100644
index 0000000000..b5df5a5a29
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jena.cdt.CDTFactory;
+import org.apache.jena.cdt.CDTKey;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase2;
+
+public class RemoveFct extends FunctionBase2
+{
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+
+ if ( map.isEmpty() )
+ return nv1;
+
+ final Node n2 = nv2.asNode();
+
+ // If the second term is not a map key (and the first term is a well-
+ // formed cdt:Map literal), the first term needs to be returned as is.
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ return nv1;
+
+ final CDTKey key = CDTFactory.createKey(n2);
+
+ if ( ! map.containsKey(key) )
+ return nv1;
+
+ final Map<CDTKey,CDTValue> newMap = new HashMap<>(map);
+ newMap.remove(key);
+
+ return CDTLiteralFunctionUtils.createNodeValue(newMap);
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java
similarity index 54%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java
index a7452a464a..9b918036c7 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java
@@ -16,22 +16,30 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.sparql.function.library.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import java.util.Arrays;
+import java.util.List;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.NodeValue;
+
+public class ReverseFct extends FunctionBase1List
+{
+ @Override
+ protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
+ if ( list.size() < 2 )
+ return nvList;
+
+ final CDTValue[] reverseArray = new CDTValue[ list.size() ];
+ int i = list.size() - 1;
+ for ( final CDTValue v : list ) {
+ reverseArray[i] = v;
+ i--;
+ }
+
+ final List<CDTValue> reverseList = Arrays.asList(reverseArray);
+ return CDTLiteralFunctionUtils.createNodeValue(reverseList);
+ }
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java
new file mode 100644
index 0000000000..e0bb791c07
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import org.apache.jena.cdt.CompositeDatatypeList;
+import org.apache.jena.cdt.CompositeDatatypeMap;
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase1;
+
+public class SizeFct extends FunctionBase1
+{
+ @Override
+ public NodeValue exec( final NodeValue nv ) {
+ final Node n = nv.asNode();
+
+ final int size;
+ if ( CompositeDatatypeList.isListLiteral(n) ) {
+ size = CDTLiteralFunctionUtils.getList(n).size();
+ }
+ else if ( CompositeDatatypeMap.isMapLiteral(n) ) {
+ size = CDTLiteralFunctionUtils.getMap(n).size();
+ }
+ else {
+ throw new ExprEvalException("Neither a list nor a map literal: " + nv);
+ }
+
+ return NodeValue.makeInteger(size);
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java
new file mode 100644
index 0000000000..e508185c7d
--- /dev/null
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.function.library.cdt;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.jena.atlas.lib.Lib;
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.graph.Node;
+import org.apache.jena.query.QueryBuildException;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.ExprList;
+import org.apache.jena.sparql.expr.NodeValue;
+import org.apache.jena.sparql.function.FunctionBase;
+
+public class SubSeqFct extends FunctionBase
+{
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ if ( args.size() < 2 || args.size() > 3 )
+ throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two or three arguments");
+ }
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ final NodeValue nv1 = args.get(0);
+ final Node n1 = nv1.asNode();
+
+ CDTLiteralFunctionUtils.ensureListLiteral(n1);
+
+ final NodeValue nv2 = args.get(1);
+
+ if ( ! nv2.isInteger() )
+ throw new ExprEvalException("Not an integer literal: " + nv2);
+
+ final int index = nv2.getInteger().intValue();
+
+ if ( index < 1 )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
+
+ final int length;
+ final List<CDTValue> list;
+ if ( args.size() == 3 ) {
+ final NodeValue nv3 = args.get(2);
+
+ if ( ! nv3.isInteger() )
+ throw new ExprEvalException("Not an integer literal: " + nv3);
+
+ length = nv3.getInteger().intValue();
+
+ if ( length < 0 )
+ throw new ExprEvalException("Illegal length value: " + nv3);
+
+ list = CDTLiteralFunctionUtils.getList(n1);
+ }
+ else {
+ list = CDTLiteralFunctionUtils.getList(n1);
+ length = list.size() - index + 1;
+ }
+
+ if ( index > list.size() + 1 )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
+
+ if ( index + length > list.size() + 1 )
+ throw new ExprEvalException("Beyond list length (index: " + index + ", length: " + length + ")");
+
+ final List<CDTValue> sublist;
+ if ( index == list.size() + 1 ) {
+ if ( length != 0 )
+ throw new ExprEvalException("Illegal arguments (index: " + index + ", length: " + length + ")");
+
+ if ( list.isEmpty() )
+ return nv1;
+
+ sublist = Collections.emptyList();
+ }
+ else {
+ sublist = list.subList( index - 1, index - 1 + length );
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(sublist);
+ }
+
+}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java
similarity index 58%
copy from jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
copy to jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java
index a7452a464a..aee058e658 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/ARQFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java
@@ -16,22 +16,23 @@
* limitations under the License.
*/
-package org.apache.jena.sparql.function;
+package org.apache.jena.sparql.function.library.cdt;
-import org.apache.jena.sparql.ARQConstants;
-import org.apache.jena.sparql.function.library.triple.TripleTermFunctions;
+import java.util.List;
-/** Load ARQ functions ().
- * The one in package {@link org.apache.jena.sparql.function.library}
- * can be invoked by afn:name without registration because afn:->java: is built-in
- * in MappedLoader.
- *
- * @see ARQConstants#ARQFunctionLibraryURI
- * @see ARQConstants#ARQFunctionLibrary
- */
-public class ARQFunctions {
+import org.apache.jena.cdt.CDTValue;
+import org.apache.jena.sparql.expr.ExprEvalException;
+import org.apache.jena.sparql.expr.NodeValue;
+
+public class TailFct extends FunctionBase1List
+{
+ @Override
+ protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
+ if ( list.size() == 0 )
+ throw new ExprEvalException("Empty list");
+
+ final List<CDTValue> sublist = list.subList( 1, list.size() );
+ return CDTLiteralFunctionUtils.createNodeValue(sublist);
+ }
- public static void load(FunctionRegistry reg) {
- TripleTermFunctions.register(reg);
- }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java
index 5e0690ad15..dea4f3b302 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/SyntaxVarScope.java
@@ -223,6 +223,7 @@ public class SyntaxVarScope {
@Override
public void visit(ElementGroup el) {
// BIND scope rules
+ // UNFOLD scope rules
// (and service warning)
for ( int i = 0 ; i < el.size() ; i++ ) {
@@ -232,6 +233,10 @@ public class SyntaxVarScope {
Collection<Var> accScope = calcScopeAll(el.getElements(), i);
checkBIND(accScope, eltBind);
}
+ if ( e instanceof ElementUnfold ) {
+ Collection<Var> accScope = calcScopeAll(el.getElements(), i);
+ checkUNFOLD(accScope, (ElementUnfold)e);
+ }
if ( e instanceof ElementService eltSvc ) {
Collection<Var> accScope = calcScopeAll(el.getElements(), i);
checkSERVICE(accScope, eltSvc);
@@ -264,6 +269,18 @@ public class SyntaxVarScope {
checkExpr(scope, el.getExpr(), var);
}
+ private static void checkUNFOLD(Collection<Var> scope, ElementUnfold el) {
+ Var var1 = el.getVar1();
+ if ( scope.contains(var1) )
+ throw new QueryParseException("UNFOLD: Variable used when already in-scope: " + var1 + " in " + el, -1, -1);
+
+ Var var2 = el.getVar2();
+ if ( var2 != null && scope.contains(var2) )
+ throw new QueryParseException("UNFOLD: Variable used when already in-scope: " + var2 + " in " + el, -1, -1);
+
+ checkExpr(scope, el.getExpr(), var1);
+ }
+
private static void checkSERVICE(Collection<Var> scope, ElementService el) {
if ( ARQ.isStrictMode() && el.getServiceNode().isVariable() ) {
Var var = Var.alloc(el.getServiceNode());
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
index 30e9f835b6..9d1009042c 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
@@ -1,4 +1,3 @@
-/* ARQParser.java */
/* Generated By:JavaCC: Do not edit this line. ARQParser.java */
package org.apache.jena.sparql.lang.arq ;
import org.apache.jena.graph.* ;
@@ -12,122 +11,116 @@ import org.apache.jena.sparql.expr.aggregate.lib.* ;
import org.apache.jena.update.* ;
import org.apache.jena.sparql.modify.request.* ;
import org.apache.jena.sparql.core.Quad ;
+import java.util.List;
+import java.util.ArrayList;
@SuppressWarnings("all")
public class ARQParser extends ARQParserBase implements ARQParserConstants {
final public void QueryUnit() throws ParseException {
ByteOrderMark();
-startQuery() ;
+ startQuery() ;
Query();
jj_consume_token(0);
-finishQuery() ;
-}
+ finishQuery() ;
+ }
final public void Query() throws ParseException {
Prologue();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case SELECT:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case SELECT:
SelectQuery();
break;
- }
- case CONSTRUCT:{
+ case CONSTRUCT:
ConstructQuery();
break;
- }
- case DESCRIBE:{
+ case DESCRIBE:
DescribeQuery();
break;
- }
- case ASK:{
+ case ASK:
AskQuery();
break;
- }
- case JSON:{
+ case JSON:
JsonQuery();
break;
- }
default:
jj_la1[0] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
ValuesClause();
-}
+ }
final public void UpdateUnit() throws ParseException {
ByteOrderMark();
-startUpdateRequest() ;
+ startUpdateRequest() ;
Update();
jj_consume_token(0);
-finishUpdateRequest() ;
-}
+ finishUpdateRequest() ;
+ }
final public void ByteOrderMark() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case BOM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case BOM:
jj_consume_token(BOM);
break;
- }
default:
jj_la1[1] = jj_gen;
;
}
-}
+ }
final public void Prologue() throws ParseException {
label_1:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BASE:
- case PREFIX:{
+ case PREFIX:
;
break;
- }
default:
jj_la1[2] = jj_gen;
break label_1;
}
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case BASE:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case BASE:
BaseDecl();
break;
- }
- case PREFIX:{
+ case PREFIX:
PrefixDecl();
break;
- }
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
-}
+ }
- final public void BaseDecl() throws ParseException {Token t ; String iri ;
+ final public void BaseDecl() throws ParseException {
+ Token t ; String iri ;
t = jj_consume_token(BASE);
iri = IRIREF();
-setBase(iri, t.beginLine, t.beginColumn ) ;
-}
+ setBase(iri, t.beginLine, t.beginColumn ) ;
+ }
- final public void PrefixDecl() throws ParseException {Token t ; String iri ;
+ final public void PrefixDecl() throws ParseException {
+ Token t ; String iri ;
jj_consume_token(PREFIX);
t = jj_consume_token(PNAME_NS);
iri = IRIREF();
-String s = fixupPrefix(t.image, t.beginLine, t.beginColumn);
+ String s = fixupPrefix(t.image, t.beginLine, t.beginColumn);
setPrefix(s, iri, t.beginLine, t.beginColumn) ;
-}
+ }
final public void SelectQuery() throws ParseException {
SelectClause();
label_2:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case FROM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case FROM:
;
break;
- }
default:
jj_la1[4] = jj_gen;
break label_2;
@@ -136,45 +129,43 @@ String s = fixupPrefix(t.image, t.beginLine, t.beginColumn);
}
WhereClause();
SolutionModifier();
-}
+ }
final public void SubSelect() throws ParseException {
SelectClause();
WhereClause();
SolutionModifier();
ValuesClause();
-}
+ }
- final public void SelectClause() throws ParseException {Var v ; Expr expr ; Node n ;
+ final public void SelectClause() throws ParseException {
+ Var v ; Expr expr ; Node n ;
jj_consume_token(SELECT);
-getQuery().setQuerySelectType() ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ getQuery().setQuerySelectType() ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DISTINCT:
- case REDUCED:{
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case DISTINCT:{
+ case REDUCED:
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case DISTINCT:
jj_consume_token(DISTINCT);
-getQuery().setDistinct(true);
+ getQuery().setDistinct(true);
break;
- }
- case REDUCED:{
+ case REDUCED:
jj_consume_token(REDUCED);
-getQuery().setReduced(true);
+ getQuery().setReduced(true);
break;
- }
default:
jj_la1[5] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
- }
default:
jj_la1[6] = jj_gen;
;
}
-setAllowAggregatesInExpressions(true) ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ setAllowAggregatesInExpressions(true) ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -201,6 +192,7 @@ setAllowAggregatesInExpressions(true) ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -275,16 +267,15 @@ setAllowAggregatesInExpressions(true) ;
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case LPAREN:{
+ case LPAREN:
label_3:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VAR1:
- case VAR2:{
+ case VAR2:
v = Var();
-getQuery().addResultVar(v) ;
+ getQuery().addResultVar(v) ;
break;
- }
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -309,6 +300,7 @@ getQuery().addResultVar(v) ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -382,27 +374,25 @@ getQuery().addResultVar(v) ;
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:{
+ case STRING_LITERAL_LONG2:
if (jj_2_1(2)) {
expr = BuiltInCall();
-getQuery().addResultVar((Var)null, expr) ;
+ getQuery().addResultVar((Var)null, expr) ;
} else {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:{
+ case PNAME_LN:
expr = FunctionCall();
-getQuery().addResultVar((Var)null, expr) ;
+ getQuery().addResultVar((Var)null, expr) ;
break;
- }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:{
+ case STRING_LITERAL_LONG2:
n = RDFLiteral();
-getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
+ getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
break;
- }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -411,17 +401,15 @@ getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:{
+ case DOUBLE_NEGATIVE:
n = NumericLiteral();
-getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
+ getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
break;
- }
case TRUE:
- case FALSE:{
+ case FALSE:
n = BooleanLiteral();
-getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
+ getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
break;
- }
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
@@ -429,32 +417,29 @@ getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
}
}
break;
- }
- case LPAREN:{
-v = null ;
+ case LPAREN:
+ v = null ;
jj_consume_token(LPAREN);
expr = Expression();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case AS:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case AS:
jj_consume_token(AS);
v = Var();
break;
- }
default:
jj_la1[8] = jj_gen;
;
}
jj_consume_token(RPAREN);
-getQuery().addResultVar(v, expr) ;
-getQuery().setQueryResultStar(false) ;
+ getQuery().addResultVar(v, expr) ;
+ getQuery().setQueryResultStar(false) ;
break;
- }
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -481,6 +466,7 @@ getQuery().setQueryResultStar(false) ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -555,45 +541,42 @@ getQuery().setQueryResultStar(false) ;
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case LPAREN:{
+ case LPAREN:
;
break;
- }
default:
jj_la1[10] = jj_gen;
break label_3;
}
}
break;
- }
- case STAR:{
+ case STAR:
jj_consume_token(STAR);
-getQuery().setQueryResultStar(true) ;
+ getQuery().setQueryResultStar(true) ;
break;
- }
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
-setAllowAggregatesInExpressions(false) ;
-}
+ setAllowAggregatesInExpressions(false) ;
+ }
- final public void ConstructQuery() throws ParseException {Template t ;
+ final public void ConstructQuery() throws ParseException {
+ Template t ;
QuadAcc acc = new QuadAcc() ;
jj_consume_token(CONSTRUCT);
-getQuery().setQueryConstructType() ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case LBRACE:{
+ getQuery().setQueryConstructType() ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case LBRACE:
t = ConstructTemplate();
-getQuery().setConstructTemplate(t) ;
+ getQuery().setConstructTemplate(t) ;
label_4:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case FROM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case FROM:
;
break;
- }
default:
jj_la1[12] = jj_gen;
break label_4;
@@ -603,16 +586,14 @@ getQuery().setConstructTemplate(t) ;
WhereClause();
SolutionModifier();
break;
- }
case FROM:
- case WHERE:{
+ case WHERE:
label_5:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case FROM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case FROM:
;
break;
- }
default:
jj_la1[13] = jj_gen;
break label_5;
@@ -624,54 +605,51 @@ getQuery().setConstructTemplate(t) ;
ConstructQuads(acc);
jj_consume_token(RBRACE);
SolutionModifier();
-t = new Template(acc) ;
+ t = new Template(acc) ;
getQuery().setConstructTemplate(t) ;
ElementGroup elg = createQueryPattern(t);
getQuery().setQueryPattern(elg) ;
break;
- }
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
-}
+ }
- final public void DescribeQuery() throws ParseException {Node n ;
+ final public void DescribeQuery() throws ParseException {
+ Node n ;
jj_consume_token(DESCRIBE);
-getQuery().setQueryDescribeType() ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ getQuery().setQueryDescribeType() ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
- case VAR2:{
+ case VAR2:
label_6:
while (true) {
n = VarOrIri();
-getQuery().addDescribeNode(n) ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ getQuery().addDescribeNode(n) ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
- case VAR2:{
+ case VAR2:
;
break;
- }
default:
jj_la1[15] = jj_gen;
break label_6;
}
}
-getQuery().setQueryResultStar(false) ;
+ getQuery().setQueryResultStar(false) ;
break;
- }
- case STAR:{
+ case STAR:
jj_consume_token(STAR);
-getQuery().setQueryResultStar(true) ;
+ getQuery().setQueryResultStar(true) ;
break;
- }
default:
jj_la1[16] = jj_gen;
jj_consume_token(-1);
@@ -679,40 +657,37 @@ getQuery().setQueryResultStar(true) ;
}
label_7:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case FROM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case FROM:
;
break;
- }
default:
jj_la1[17] = jj_gen;
break label_7;
}
DatasetClause();
}
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WHERE:
- case LBRACE:{
+ case LBRACE:
WhereClause();
break;
- }
default:
jj_la1[18] = jj_gen;
;
}
SolutionModifier();
-}
+ }
final public void AskQuery() throws ParseException {
jj_consume_token(ASK);
-getQuery().setQueryAskType() ;
+ getQuery().setQueryAskType() ;
label_8:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case FROM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case FROM:
;
break;
- }
default:
jj_la1[19] = jj_gen;
break label_8;
@@ -721,17 +696,16 @@ getQuery().setQueryAskType() ;
}
WhereClause();
SolutionModifier();
-}
+ }
final public void JsonQuery() throws ParseException {
JsonClause();
label_9:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case FROM:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case FROM:
;
break;
- }
default:
jj_la1[20] = jj_gen;
break label_9;
@@ -740,20 +714,19 @@ getQuery().setQueryAskType() ;
}
WhereClause();
SolutionModifier();
-}
+ }
final public void JsonClause() throws ParseException {
jj_consume_token(JSON);
-getQuery().setQueryJsonType() ;
+ getQuery().setQueryJsonType() ;
jj_consume_token(LBRACE);
JsonObjectMember();
label_10:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case COMMA:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case COMMA:
;
break;
- }
default:
jj_la1[21] = jj_gen;
break label_10;
@@ -762,28 +735,27 @@ getQuery().setQueryJsonType() ;
JsonObjectMember();
}
jj_consume_token(RBRACE);
-}
+ }
- final public void JsonObjectMember() throws ParseException {Node o ; String s ; Token t;
+ final public void JsonObjectMember() throws ParseException {
+ Node o ; String s ; Token t;
s = String();
t = jj_consume_token(PNAME_NS);
-if ( ! t.image.equals(":") )
+ if ( ! t.image.equals(":") )
throwParseException("Prefix name expression not legal at this point : "+t.image, t.beginLine, t.beginColumn) ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VAR1:
- case VAR2:{
+ case VAR2:
o = Var();
-getQuery().addResultVar((Var)o) ; getQuery().addJsonMapping(s, o) ;
+ getQuery().addResultVar((Var)o) ; getQuery().addJsonMapping(s, o) ;
break;
- }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:{
+ case STRING_LITERAL_LONG2:
o = RDFLiteral();
-getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
+ getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
break;
- }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -792,116 +764,111 @@ getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s,
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:{
+ case DOUBLE_NEGATIVE:
o = NumericLiteral();
-getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
+ getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
break;
- }
case TRUE:
- case FALSE:{
+ case FALSE:
o = BooleanLiteral();
-getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
+ getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
break;
- }
default:
jj_la1[22] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
-}
+ }
final public void DatasetClause() throws ParseException {
jj_consume_token(FROM);
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:{
+ case PNAME_LN:
DefaultGraphClause();
break;
- }
- case NAMED:{
+ case NAMED:
NamedGraphClause();
break;
- }
default:
jj_la1[23] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
-}
+ }
- final public void DefaultGraphClause() throws ParseException {String iri ;
+ final public void DefaultGraphClause() throws ParseException {
+ String iri ;
iri = SourceSelector();
-getQuery().addGraphURI(iri) ;
-}
+ getQuery().addGraphURI(iri) ;
+ }
- final public void NamedGraphClause() throws ParseException {String iri ;
+ final public void NamedGraphClause() throws ParseException {
+ String iri ;
jj_consume_token(NAMED);
iri = SourceSelector();
-getQuery().addNamedGraphURI(iri) ;
-}
+ getQuery().addNamedGraphURI(iri) ;
+ }
- final public String SourceSelector() throws ParseException {String iri ;
+ final public String SourceSelector() throws ParseException {
+ String iri ;
iri = iri();
-{if ("" != null) return iri ;}
+ {if (true) return iri ;}
throw new Error("Missing return statement in function");
-}
+ }
- final public void WhereClause() throws ParseException {Element el ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case WHERE:{
+ final public void WhereClause() throws ParseException {
+ Element el ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case WHERE:
jj_consume_token(WHERE);
break;
- }
default:
jj_la1[24] = jj_gen;
;
}
-startWherePattern() ;
+ startWherePattern() ;
el = GroupGraphPattern();
-getQuery().setQueryPattern(el) ;
-finishWherePattern() ;
-}
+ getQuery().setQueryPattern(el) ;
+ finishWherePattern() ;
+ }
final public void SolutionModifier() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case GROUP:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case GROUP:
GroupClause();
break;
- }
default:
jj_la1[25] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case HAVING:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case HAVING:
HavingClause();
break;
- }
default:
jj_la1[26] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case ORDER:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ORDER:
OrderClause();
break;
- }
default:
jj_la1[27] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LIMIT:
- case OFFSET:{
+ case OFFSET:
LimitOffsetClauses();
break;
- }
default:
jj_la1[28] = jj_gen;
;
}
-}
+ }
final public void GroupClause() throws ParseException {
jj_consume_token(GROUP);
@@ -909,7 +876,7 @@ finishWherePattern() ;
label_11:
while (true) {
GroupCondition();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -936,6 +903,7 @@ finishWherePattern() ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -995,19 +963,19 @@ finishWherePattern() ;
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:{
+ case LPAREN:
;
break;
- }
default:
jj_la1[29] = jj_gen;
break label_11;
}
}
-}
+ }
- final public void GroupCondition() throws ParseException {Var v = null ; Expr expr = null ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ final public void GroupCondition() throws ParseException {
+ Var v = null ; Expr expr = null ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TRIPLE:
case IS_TRIPLE:
case SUBJECT:
@@ -1029,6 +997,7 @@ finishWherePattern() ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -1087,55 +1056,50 @@ finishWherePattern() ;
case SHA1:
case SHA256:
case SHA384:
- case SHA512:{
+ case SHA512:
expr = BuiltInCall();
-getQuery().addGroupBy((Var)null, expr) ;
+ getQuery().addGroupBy((Var)null, expr) ;
break;
- }
case IRIref:
case PNAME_NS:
- case PNAME_LN:{
+ case PNAME_LN:
expr = FunctionCall();
-getQuery().addGroupBy((Var)null, expr) ;
+ getQuery().addGroupBy((Var)null, expr) ;
break;
- }
- case LPAREN:{
+ case LPAREN:
jj_consume_token(LPAREN);
expr = Expression();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case AS:{
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case AS:
jj_consume_token(AS);
v = Var();
break;
- }
default:
jj_la1[30] = jj_gen;
;
}
jj_consume_token(RPAREN);
-getQuery().addGroupBy(v ,expr) ;
+ getQuery().addGroupBy(v ,expr) ;
break;
- }
case VAR1:
- case VAR2:{
+ case VAR2:
v = Var();
-getQuery().addGroupBy(v) ;
+ getQuery().addGroupBy(v) ;
break;
- }
default:
jj_la1[31] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
-}
+ }
final public void HavingClause() throws ParseException {
-setAllowAggregatesInExpressions(true) ;
+ setAllowAggregatesInExpressions(true) ;
jj_consume_token(HAVING);
label_12:
while (true) {
HavingCondition();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1160,6 +1124,7 @@ setAllowAggregatesInExpressions(true) ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -1219,31 +1184,31 @@ setAllowAggregatesInExpressions(true) ;
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:{
+ case LPAREN:
;
break;
- }
default:
jj_la1[32] = jj_gen;
break label_12;
}
}
-setAllowAggregatesInExpressions(false) ;
-}
+ setAllowAggregatesInExpressions(false) ;
+ }
- final public void HavingCondition() throws ParseException {Expr c ;
+ final public void HavingCondition() throws ParseException {
+ Expr c ;
c = Constraint();
-getQuery().addHavingCondition(c) ;
-}
+ getQuery().addHavingCondition(c) ;
+ }
final public void OrderClause() throws ParseException {
-setAllowAggregatesInExpressions(true) ;
+ setAllowAggregatesInExpressions(true) ;
jj_consume_token(ORDER);
jj_consume_token(BY);
label_13:
while (true) {
OrderCondition();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1272,6 +1237,7 @@ setAllowAggregatesInExpressions(true) ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -1331,34 +1297,32 @@ setAllowAggregatesInExpressions(true) ;
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:{
+ case LPAREN:
;
break;
- }
default:
jj_la1[33] = jj_gen;
break label_13;
}
}
-setAllowAggregatesInExpressions(false) ;
-}
+ setAllowAggregatesInExpressions(false) ;
+ }
- final public void OrderCondition() throws ParseException {int direction = 0 ; Expr expr = null ; Node v = null ;
-direction = Query.ORDER_DEFAULT ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ final public void OrderCondition() throws ParseException {
+ int direction = 0 ; Expr expr = null ; Node v = null ;
+ direction = Query.ORDER_DEFAULT ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ASC:
- case DESC:{
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case ASC:{
+ case DESC:
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ASC:
jj_consume_token(ASC);
-direction = Query.ORDER_ASCENDING ;
+ direction = Query.ORDER_ASCENDING ;
break;
- }
- case DESC:{
+ case DESC:
jj_consume_token(DESC);
-direction = Query.ORDER_DESCENDING ;
+ direction = Query.ORDER_DESCENDING ;
break;
- }
default:
jj_la1[34] = jj_gen;
jj_consume_token(-1);
@@ -1366,7 +1330,6 @@ direction = Query.ORDER_DESCENDING ;
}
expr = BrackettedExpression();
break;
- }
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1393,6 +1356,7 @@ direction = Query.ORDER_DESCENDING ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -1452,8 +1416,8 @@ direction = Query.ORDER_DESCENDING ;
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:{
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1478,6 +1442,7 @@ direction = Query.ORDER_DESCENDING ;
case VARIANCE:
case VAR_SAMP:
case VAR_POP:
+ case FOLD:
case SAMPLE:
case GROUP_CONCAT:
case BOUND:
@@ -1537,546 +1502,743 @@ direction = Query.ORDER_DESCENDING ;
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:{
+ case LPAREN:
expr = Constraint();
break;
- }
case VAR1:
- case VAR2:{
+ case VAR2:
v = Var();
break;
- }
default:
jj_la1[35] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
- }
default:
jj_la1[36] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
-if ( v == null )
+ if ( v == null )
getQuery().addOrderBy(expr, direction) ;
else
getQuery().addOrderBy(v, direction) ;
-}
+ }
- final public void LimitOffsetClauses() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case LIMIT:{
- LimitClause();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case OFFSET:{
- OffsetClause();
- break;
- }
- default:
- jj_la1[37] = jj_gen;
- ;
- }
- break;
- }
- case OFFSET:{
- OffsetClause();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case LIMIT:{
- LimitClause();
+ final public SortCondition OrderConditionForAggregationFunction() throws ParseException {
+ int direction = 0 ; Expr expr = null ; Node v = null ;
+ direction = Query.ORDER_DEFAULT ;
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ASC:
+ case DESC:
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case ASC:
+ jj_consume_token(ASC);
+ direction = Query.ORDER_ASCENDING ;
break;
- }
- default:
- jj_la1[38] = jj_gen;
- ;
- }
- break;
- }
- default:
- jj_la1[39] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
-}
-
- final public void LimitClause() throws ParseException {Token t ;
- jj_consume_token(LIMIT);
- t = jj_consume_token(INTEGER);
-getQuery().setLimit(integerValue(t.image)) ;
-}
-
- final public void OffsetClause() throws ParseException {Token t ;
- jj_consume_token(OFFSET);
- t = jj_consume_token(INTEGER);
-getQuery().setOffset(integerValue(t.image)) ;
-}
-
- final public void ValuesClause() throws ParseException {Token t ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case VALUES:{
- t = jj_consume_token(VALUES);
-startValuesClause(t.beginLine, t.beginColumn) ;
- DataBlock();
-finishValuesClause(t.beginLine, t.beginColumn) ;
- break;
- }
- default:
- jj_la1[40] = jj_gen;
- ;
- }
-}
-
- final public void Update() throws ParseException {
- Prologue();
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case INSERT:
- case DELETE:
- case INSERT_DATA:
- case DELETE_DATA:
- case DELETE_WHERE:
- case LOAD:
- case CLEAR:
- case CREATE:
- case ADD:
- case MOVE:
- case COPY:
- case DROP:
- case WITH:{
- Update1();
- label_14:
- while (true) {
- if (jj_2_2(2147483647)) {
- ;
- } else {
- break label_14;
- }
- jj_consume_token(SEMICOLON);
- Prologue();
- Update1();
- }
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case SEMICOLON:{
- jj_consume_token(SEMICOLON);
- Prologue();
+ case DESC:
+ jj_consume_token(DESC);
+ direction = Query.ORDER_DESCENDING ;
break;
- }
default:
- jj_la1[41] = jj_gen;
- ;
- }
- break;
- }
- default:
- jj_la1[42] = jj_gen;
- ;
- }
-}
-
- final public void Update1() throws ParseException {Update up = null ;
-startUpdateOperation() ;
- switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
- case LOAD:{
- up = Load();
- break;
... 33996 lines suppressed ...
(jena) 02/02: GH-2518: Integrate CDTs into current development
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git
commit 0ad2f7b616098e962acccfbedf5a20d643ea93fe
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed Aug 28 13:52:18 2024 +0100
GH-2518: Integrate CDTs into current development
---
jena-arq/Grammar/CDTs/.gitignore | 3 +
jena-arq/Grammar/CDTs/README | 11 +
jena-arq/Grammar/CDTs/{generate => cdt-literals} | 10 +-
jena-arq/Grammar/arq.jj | 1 -
jena-arq/Grammar/main.jj | 16 +-
.../org/apache/jena/cdt/ParserForCDTLiterals.java | 18 +-
.../apache/jena/cdt/parser/CDTLiteralParser.java | 499 +-
.../cdt/parser/CDTLiteralParserTokenManager.java | 414 +-
.../org/apache/jena/cdt/parser/JavaCharStream.java | 155 +-
.../org/apache/jena/cdt/parser/ParseException.java | 48 +-
.../java/org/apache/jena/cdt/parser/Token.java | 7 +-
.../org/apache/jena/cdt/parser/TokenMgrError.java | 36 +-
.../jena/riot/system/CDTAwareParserProfile.java | 170 +-
.../apache/jena/sparql/algebra/op/OpUnfold.java | 66 +-
.../sparql/engine/iterator/QueryIterUnfold.java | 20 +-
.../library/cdt/CDTLiteralFunctionUtils.java | 230 +-
.../function/library/cdt/CDTLiteralFunctions.java | 36 +-
.../sparql/function/library/cdt/ConcatFct.java | 56 +-
.../sparql/function/library/cdt/ContainsFct.java | 40 +-
.../function/library/cdt/ContainsKeyFct.java | 30 +-
.../function/library/cdt/ContainsTermFct.java | 38 +-
.../function/library/cdt/FunctionBase1List.java | 12 +-
.../jena/sparql/function/library/cdt/GetFct.java | 130 +-
.../jena/sparql/function/library/cdt/HeadFct.java | 30 +-
.../jena/sparql/function/library/cdt/KeysFct.java | 20 +-
.../jena/sparql/function/library/cdt/ListFct.java | 46 +-
.../jena/sparql/function/library/cdt/MapFct.java | 118 +-
.../jena/sparql/function/library/cdt/MergeFct.java | 24 +-
.../jena/sparql/function/library/cdt/PutFct.java | 140 +-
.../sparql/function/library/cdt/RemoveFct.java | 34 +-
.../sparql/function/library/cdt/ReverseFct.java | 26 +-
.../jena/sparql/function/library/cdt/SizeFct.java | 30 +-
.../sparql/function/library/cdt/SubSeqFct.java | 96 +-
.../jena/sparql/function/library/cdt/TailFct.java | 14 +-
.../org/apache/jena/sparql/lang/arq/ARQParser.java | 4750 +++++++++++---------
.../apache/jena/sparql/lang/arq/ARQParserBase.java | 18 +-
.../sparql/lang/arq/ARQParserTokenManager.java | 832 ++--
.../jena/sparql/lang/arq/ParseException.java | 48 +-
.../jena/sparql/lang/arq/SimpleCharStream.java | 21 +-
.../org/apache/jena/sparql/lang/arq/Token.java | 7 +-
.../apache/jena/sparql/lang/arq/TokenMgrError.java | 36 +-
.../jena/sparql/lang/sparql_12/JavaCharStream.java | 81 +-
.../jena/sparql/lang/sparql_12/SPARQLParser12.java | 1 +
.../lang/sparql_12/SPARQLParser12TokenManager.java | 93 +-
.../apache/jena/sparql/sse/builders/BuilderOp.java | 15 +
.../apache/jena/sparql/syntax/ElementUnfold.java | 69 +-
.../apache/jena/external/Scripts_SPARQLCDTs.java | 20 +-
47 files changed, 4696 insertions(+), 3919 deletions(-)
diff --git a/jena-arq/Grammar/CDTs/.gitignore b/jena-arq/Grammar/CDTs/.gitignore
new file mode 100644
index 0000000000..8488d4309d
--- /dev/null
+++ b/jena-arq/Grammar/CDTs/.gitignore
@@ -0,0 +1,3 @@
+cdt_literals-1.html
+cdt_literals-2.html
+cdt_literals.txt
diff --git a/jena-arq/Grammar/CDTs/README b/jena-arq/Grammar/CDTs/README
new file mode 100644
index 0000000000..ea269cd796
--- /dev/null
+++ b/jena-arq/Grammar/CDTs/README
@@ -0,0 +1,11 @@
+== Grammar for CDTs Literals
+
+The script cdt-literals runs JavaCC and generates the java parser.
+
+ cdt-literals cdt_literals.jj
+
+The script also processes the Java files to insert "@SuppressWarnings".
+
+The java files are party of the git repository so that Jena can be compiled and
+built from source without needing javacc setup.
+
diff --git a/jena-arq/Grammar/CDTs/generate b/jena-arq/Grammar/CDTs/cdt-literals
similarity index 88%
rename from jena-arq/Grammar/CDTs/generate
rename to jena-arq/Grammar/CDTs/cdt-literals
index 687b81f053..466b3342e6 100755
--- a/jena-arq/Grammar/CDTs/generate
+++ b/jena-arq/Grammar/CDTs/cdt-literals
@@ -56,10 +56,10 @@ sed -e 's/@SuppressWarnings("serial")//' \
< $F > F
mv F $F
-echo "---- Create HTML form ----"
-../jj2html ${FILE%%.jj}.txt '../tokens.txt' > ${FILE%%.jj}-1.html
-../grammarExtracts < ${FILE%%.jj}-1.html > ${FILE%%.jj}-2.html
-
-echo "Check X and Y for IRI_REF because \" became '"
+## echo "---- Create HTML form ----"
+## ../jj2html ${FILE%%.jj}.txt '../tokens.txt' > ${FILE%%.jj}-1.html
+## ../grammarExtracts < ${FILE%%.jj}-1.html > ${FILE%%.jj}-2.html
+##
+## echo "Check X and Y for IRI_REF because \" became '"
echo "---- Done"
diff --git a/jena-arq/Grammar/arq.jj b/jena-arq/Grammar/arq.jj
index 24f421a5d6..4ffca766a3 100644
--- a/jena-arq/Grammar/arq.jj
+++ b/jena-arq/Grammar/arq.jj
@@ -1844,7 +1844,6 @@ TOKEN [IGNORE_CASE] :
| < SUBJECT: "SUBJECT" >
| < PREDICATE: "PREDICATE" >
| < OBJECT: "OBJECT" >
-| < UNFOLD: "unfold" >
| < EXISTS: "exists" >
| < NOT: "not" >
| < AS: "as" >
diff --git a/jena-arq/Grammar/main.jj b/jena-arq/Grammar/main.jj
index 46ff197b3b..9f14ca6330 100644
--- a/jena-arq/Grammar/main.jj
+++ b/jena-arq/Grammar/main.jj
@@ -480,6 +480,7 @@ void OrderCondition() :
getQuery().addOrderBy(v, direction) ; }
}
+#ifdef ARQ
SortCondition OrderConditionForAggregationFunction() :
{ int direction = 0 ; Expr expr = null ; Node v = null ; }
{
@@ -500,6 +501,7 @@ SortCondition OrderConditionForAggregationFunction() :
else
return new SortCondition(v, direction) ; }
}
+#endif
void LimitOffsetClauses() : { }
{
@@ -923,8 +925,6 @@ Element GraphPatternNotTriples() : { Element el = null ; }
#ifdef ARQ
|
el = Assignment()
- |
- el = Unfold()
|
el = ExistsElt()
|
@@ -1063,18 +1063,6 @@ Element Assignment() : { Var v ; Expr expr ; }
{ return new ElementAssign(v, expr) ; }
}
-Element Unfold() : { Var v1 ; Var v2 = null ; Expr expr ; }
-{
- <UNFOLD>
- <LPAREN>
- expr = Expression()
- <AS>
- v1 = Var()
- (<COMMA> v2 = Var() { ; } )?
- <RPAREN>
- { return new ElementUnfold(expr, v1, v2) ; }
-}
-
Element ExistsElt() : { Element el ; }
{
<EXISTS>
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java b/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java
index 28b376f7f4..748b4656aa 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/ParserForCDTLiterals.java
@@ -37,14 +37,11 @@ public class ParserForCDTLiterals
}
public static List<CDTValue> parseListLiteral( final ParserProfile pp, final String lex ) {
- final Reader reader = new StringReader(lex);
- final List<CDTValue> result = parseListLiteral(pp, reader);
-
- try { reader.close(); } catch ( final IOException e ) {
+ try ( Reader reader = new StringReader(lex) ) {
+ return parseListLiteral(pp, reader);
+ } catch ( final IOException e ) {
throw new CDTLiteralParseException("Closing the reader caused an exception.", e);
}
-
- return result;
}
public static List<CDTValue> parseListLiteral( final Reader reader ) {
@@ -77,14 +74,11 @@ public class ParserForCDTLiterals
}
public static Map<CDTKey,CDTValue> parseMapLiteral( final ParserProfile pp, final String lex ) {
- final Reader reader = new StringReader(lex);
- final Map<CDTKey,CDTValue> result = parseMapLiteral(pp, reader);
-
- try { reader.close(); } catch ( final IOException e ) {
+ try ( Reader reader = new StringReader(lex) ) {
+ return parseMapLiteral(pp, reader);
+ } catch ( final IOException e ) {
throw new CDTLiteralParseException("Closing the reader caused an exception.", e);
}
-
- return result;
}
public static Map<CDTKey,CDTValue> parseMapLiteral( final Reader reader ) {
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java
index febae9906b..e72d78fa05 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParser.java
@@ -1,3 +1,4 @@
+/* CDTLiteralParser.java */
/* Generated By:JavaCC: Do not edit this line. CDTLiteralParser.java */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -32,10 +33,10 @@ import static org.apache.jena.riot.lang.extra.LangParserLib.*;
public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteralParserConstants {
// --- Entry point for cdt:List literals
- final public List<CDTValue> List() throws ParseException {
- List<CDTValue> l = new ArrayList<CDTValue>();
+ final public
+List<CDTValue> List() throws ParseException {List<CDTValue> l = new ArrayList<CDTValue>();
jj_consume_token(LBRACKET);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRUE:
case FALSE:
case INTEGER:
@@ -49,26 +50,28 @@ public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteral
case BLANK_NODE_LABEL:
case NULL:
case LBRACE:
- case LBRACKET:
+ case LBRACKET:{
NonEmptyListContent(l);
break;
+ }
default:
jj_la1[0] = jj_gen;
;
}
jj_consume_token(RBRACKET);
- {if (true) return l;}
+{if ("" != null) return l;}
throw new Error("Missing return statement in function");
- }
+}
final public void NonEmptyListContent(List<CDTValue> l) throws ParseException {
ListElement(l);
label_1:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[1] = jj_gen;
break label_1;
@@ -76,61 +79,68 @@ public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteral
jj_consume_token(COMMA);
ListElement(l);
}
- }
+}
- final public void ListElement(List<CDTValue> l) throws ParseException {
- String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IRIref:
+ final public void ListElement(List<CDTValue> l) throws ParseException {String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:{
iri = IRI_REF();
- n = createURI(iri, token.beginLine, token.beginColumn); l.add( CDTFactory.createValue(n) );
+n = createURI(iri, token.beginLine, token.beginColumn); l.add( CDTFactory.createValue(n) );
break;
- case BLANK_NODE_LABEL:
+ }
+ case BLANK_NODE_LABEL:{
n = BlankNode();
- l.add( CDTFactory.createValue(n) );
+l.add( CDTFactory.createValue(n) );
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- l.add( CDTFactory.createValue(n) );
+l.add( CDTFactory.createValue(n) );
break;
+ }
case INTEGER:
case DECIMAL:
- case DOUBLE:
+ case DOUBLE:{
n = NumericLiteral();
- l.add( CDTFactory.createValue(n) );
+l.add( CDTFactory.createValue(n) );
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- l.add( CDTFactory.createValue(n) );
+l.add( CDTFactory.createValue(n) );
break;
- case NULL:
+ }
+ case NULL:{
jj_consume_token(NULL);
- l.add( CDTFactory.getNullValue() );
+l.add( CDTFactory.getNullValue() );
break;
- case LBRACKET:
+ }
+ case LBRACKET:{
subList = List();
- l.add( CDTFactory.createValue(subList) );
+l.add( CDTFactory.createValue(subList) );
break;
- case LBRACE:
+ }
+ case LBRACE:{
m = Map();
- l.add( CDTFactory.createValue(m) );
+l.add( CDTFactory.createValue(m) );
break;
+ }
default:
jj_la1[2] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
// --- Entry point for cdt:Map literals
- final public Map<CDTKey,CDTValue> Map() throws ParseException {
- Map<CDTKey,CDTValue> m = new HashMap<CDTKey,CDTValue>();
+ final public
+Map<CDTKey,CDTValue> Map() throws ParseException {Map<CDTKey,CDTValue> m = new HashMap<CDTKey,CDTValue>();
jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRUE:
case FALSE:
case INTEGER:
@@ -140,26 +150,28 @@ public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteral
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case IRIref:
+ case IRIref:{
NonEmptyMapContent(m);
break;
+ }
default:
jj_la1[3] = jj_gen;
;
}
jj_consume_token(RBRACE);
- {if (true) return m;}
+{if ("" != null) return m;}
throw new Error("Missing return statement in function");
- }
+}
final public void NonEmptyMapContent(Map<CDTKey,CDTValue> m) throws ParseException {
MapEntry(m);
label_2:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[4] = jj_gen;
break label_2;
@@ -167,219 +179,235 @@ public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteral
jj_consume_token(COMMA);
MapEntry(m);
}
- }
+}
- final public void MapEntry(Map<CDTKey,CDTValue> m) throws ParseException {
- CDTKey key; CDTValue value;
+ final public void MapEntry(Map<CDTKey,CDTValue> m) throws ParseException {CDTKey key; CDTValue value;
key = MapKey();
jj_consume_token(COLON);
value = MapValue();
- final CDTValue oldValue = m.put(key, value);
+final CDTValue oldValue = m.put(key, value);
if ( oldValue != null ) {if (true) throw new ParseException("map with non-unique key (" + key.toString() + ")");}
- }
+}
- final public CDTKey MapKey() throws ParseException {
- String iri; Node n;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IRIref:
+ final public CDTKey MapKey() throws ParseException {String iri; Node n;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:{
iri = IRI_REF();
- n = createURI(iri, token.beginLine, token.beginColumn); {if (true) return CDTFactory.createKey(n);}
+n = createURI(iri, token.beginLine, token.beginColumn); {if ("" != null) return CDTFactory.createKey(n);}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return CDTFactory.createKey(n);}
+{if ("" != null) return CDTFactory.createKey(n);}
break;
+ }
case INTEGER:
case DECIMAL:
- case DOUBLE:
+ case DOUBLE:{
n = NumericLiteral();
- {if (true) return CDTFactory.createKey(n);}
+{if ("" != null) return CDTFactory.createKey(n);}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return CDTFactory.createKey(n);}
+{if ("" != null) return CDTFactory.createKey(n);}
break;
+ }
default:
jj_la1[5] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public CDTValue MapValue() throws ParseException {
- String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IRIref:
+ final public CDTValue MapValue() throws ParseException {String iri; Node n; List<CDTValue> subList; Map<CDTKey,CDTValue> m;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case IRIref:{
iri = IRI_REF();
- n = createURI(iri, token.beginLine, token.beginColumn); {if (true) return CDTFactory.createValue(n);}
+n = createURI(iri, token.beginLine, token.beginColumn); {if ("" != null) return CDTFactory.createValue(n);}
break;
- case BLANK_NODE_LABEL:
+ }
+ case BLANK_NODE_LABEL:{
n = BlankNode();
- {if (true) return CDTFactory.createValue(n);}
+{if ("" != null) return CDTFactory.createValue(n);}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return CDTFactory.createValue(n);}
+{if ("" != null) return CDTFactory.createValue(n);}
break;
+ }
case INTEGER:
case DECIMAL:
- case DOUBLE:
+ case DOUBLE:{
n = NumericLiteral();
- {if (true) return CDTFactory.createValue(n);}
+{if ("" != null) return CDTFactory.createValue(n);}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return CDTFactory.createValue(n);}
+{if ("" != null) return CDTFactory.createValue(n);}
break;
- case NULL:
+ }
+ case NULL:{
jj_consume_token(NULL);
- {if (true) return CDTFactory.getNullValue();}
+{if ("" != null) return CDTFactory.getNullValue();}
break;
- case LBRACKET:
+ }
+ case LBRACKET:{
subList = List();
- {if (true) return CDTFactory.createValue(subList);}
+{if ("" != null) return CDTFactory.createValue(subList);}
break;
- case LBRACE:
+ }
+ case LBRACE:{
m = Map();
- {if (true) return CDTFactory.createValue(m);}
+{if ("" != null) return CDTFactory.createValue(m);}
break;
+ }
default:
jj_la1[6] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
// ---- Basic terms
- final public String IRI_REF() throws ParseException {
- Token t ;
+ final public
+String IRI_REF() throws ParseException {Token t ;
t = jj_consume_token(IRIref);
- {if (true) return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return resolveQuotedIRI(t.image, t.beginLine, t.beginColumn) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node BlankNode() throws ParseException {
- Token t = null ;
+ final public Node BlankNode() throws ParseException {Token t = null ;
t = jj_consume_token(BLANK_NODE_LABEL);
- {if (true) return createBNode(t.image, t.beginLine, t.beginColumn);}
+{if ("" != null) return createBNode(t.image, t.beginLine, t.beginColumn);}
throw new Error("Missing return statement in function");
- }
+}
- final public Node NumericLiteral() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INTEGER:
+ final public Node NumericLiteral() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case INTEGER:{
t = jj_consume_token(INTEGER);
- {if (true) return createLiteralInteger(t.image, t.beginLine, t.beginColumn);}
+{if ("" != null) return createLiteralInteger(t.image, t.beginLine, t.beginColumn);}
break;
- case DECIMAL:
+ }
+ case DECIMAL:{
t = jj_consume_token(DECIMAL);
- {if (true) return createLiteralDecimal(t.image, t.beginLine, t.beginColumn);}
+{if ("" != null) return createLiteralDecimal(t.image, t.beginLine, t.beginColumn);}
break;
- case DOUBLE:
+ }
+ case DOUBLE:{
t = jj_consume_token(DOUBLE);
- {if (true) return createLiteralDouble(t.image, t.beginLine, t.beginColumn);}
+{if ("" != null) return createLiteralDouble(t.image, t.beginLine, t.beginColumn);}
break;
+ }
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
final public Node BooleanLiteral() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TRUE:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case TRUE:{
jj_consume_token(TRUE);
- {if (true) return XSD_TRUE;}
+{if ("" != null) return XSD_TRUE;}
break;
- case FALSE:
+ }
+ case FALSE:{
jj_consume_token(FALSE);
- {if (true) return XSD_FALSE;}
+{if ("" != null) return XSD_FALSE;}
break;
+ }
default:
jj_la1[8] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node RDFLiteral() throws ParseException {
- String lex = null ;
+ final public Node RDFLiteral() throws ParseException {String lex = null ;
lex = String();
- String lang = null ; String dt = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+String lang = null ; String dt = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LANGTAG:
- case DATATYPE:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LANGTAG:
+ case DATATYPE:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LANGTAG:{
lang = Langtag();
break;
- case DATATYPE:
+ }
+ case DATATYPE:{
jj_consume_token(DATATYPE);
dt = IRI_REF();
break;
+ }
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[10] = jj_gen;
;
}
- {if (true) return createLiteral(lex, lang, dt, token.beginLine, token.beginColumn);}
+{if ("" != null) return createLiteral(lex, lang, dt, token.beginLine, token.beginColumn);}
throw new Error("Missing return statement in function");
- }
+}
- final public String Langtag() throws ParseException {
- Token t ;
+ final public String Langtag() throws ParseException {Token t ;
t = jj_consume_token(LANGTAG);
- String lang = stripChars(t.image, 1) ; {if (true) return lang ;}
+String lang = stripChars(t.image, 1) ; {if ("" != null) return lang ;}
throw new Error("Missing return statement in function");
- }
+}
- final public String String() throws ParseException {
- Token t ; String lex ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STRING_LITERAL1:
+ final public String String() throws ParseException {Token t ; String lex ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STRING_LITERAL1:{
t = jj_consume_token(STRING_LITERAL1);
- lex = stripQuotes(t.image) ;
+lex = stripQuotes(t.image) ;
break;
- case STRING_LITERAL2:
+ }
+ case STRING_LITERAL2:{
t = jj_consume_token(STRING_LITERAL2);
- lex = stripQuotes(t.image) ;
+lex = stripQuotes(t.image) ;
break;
- case STRING_LITERAL_LONG1:
+ }
+ case STRING_LITERAL_LONG1:{
t = jj_consume_token(STRING_LITERAL_LONG1);
- lex = stripQuotes3(t.image) ;
+lex = stripQuotes3(t.image) ;
break;
- case STRING_LITERAL_LONG2:
+ }
+ case STRING_LITERAL_LONG2:{
t = jj_consume_token(STRING_LITERAL_LONG2);
- lex = stripQuotes3(t.image) ;
+lex = stripQuotes3(t.image) ;
break;
+ }
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
- {if (true) return lex ;}
+lex = unescapeStr(lex, t.beginLine, t.beginColumn) ;
+ {if ("" != null) return lex ;}
throw new Error("Missing return statement in function");
- }
+}
/** Generated Token Manager. */
public CDTLiteralParserTokenManager token_source;
@@ -394,121 +422,129 @@ public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteral
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static {
- jj_la1_init_0();
- jj_la1_init_1();
- }
- private static void jj_la1_init_0() {
- jj_la1_0 = new int[] {0x2c6f0f80,0x80000000,0x2c6f0f80,0x2f0f80,0x80000000,0x2f0f80,0x2c6f0f80,0xe00,0x180,0x800000,0x800000,0xf0000,};
- }
- private static void jj_la1_init_1() {
- jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x2,0x0,};
- }
+ jj_la1_init_0();
+ jj_la1_init_1();
+ }
+ private static void jj_la1_init_0() {
+ jj_la1_0 = new int[] {0x2c6f0f80,0x80000000,0x2c6f0f80,0x2f0f80,0x80000000,0x2f0f80,0x2c6f0f80,0xe00,0x180,0x800000,0x800000,0xf0000,};
+ }
+ private static void jj_la1_init_1() {
+ jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x2,0x0,};
+ }
/** Constructor with InputStream. */
public CDTLiteralParser(java.io.InputStream stream) {
- this(stream, null);
+ this(stream, null);
}
/** Constructor with InputStream and supplied encoding */
public CDTLiteralParser(java.io.InputStream stream, String encoding) {
- try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source = new CDTLiteralParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source = new CDTLiteralParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream) {
- ReInit(stream, null);
+ ReInit(stream, null);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream stream, String encoding) {
- try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
}
/** Constructor. */
public CDTLiteralParser(java.io.Reader stream) {
- jj_input_stream = new JavaCharStream(stream, 1, 1);
- token_source = new CDTLiteralParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ jj_input_stream = new JavaCharStream(stream, 1, 1);
+ token_source = new CDTLiteralParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
}
/** Reinitialise. */
public void ReInit(java.io.Reader stream) {
- jj_input_stream.ReInit(stream, 1, 1);
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ if (jj_input_stream == null) {
+ jj_input_stream = new JavaCharStream(stream, 1, 1);
+ } else {
+ jj_input_stream.ReInit(stream, 1, 1);
+ }
+ if (token_source == null) {
+ token_source = new CDTLiteralParserTokenManager(jj_input_stream);
+ }
+
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
}
/** Constructor with generated Token Manager. */
public CDTLiteralParser(CDTLiteralParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
}
/** Reinitialise. */
public void ReInit(CDTLiteralParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- jj_gen = 0;
- for (int i = 0; i < 12; i++) jj_la1[i] = -1;
+ token_source = tm;
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 12; i++) jj_la1[i] = -1;
}
private Token jj_consume_token(int kind) throws ParseException {
- Token oldToken;
- if ((oldToken = token).next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- if (token.kind == kind) {
- jj_gen++;
- return token;
- }
- token = oldToken;
- jj_kind = kind;
- throw generateParseException();
+ Token oldToken;
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ if (token.kind == kind) {
+ jj_gen++;
+ return token;
+ }
+ token = oldToken;
+ jj_kind = kind;
+ throw generateParseException();
}
/** Get the next Token. */
final public Token getNextToken() {
- if (token.next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- jj_gen++;
- return token;
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
+ jj_ntk = -1;
+ jj_gen++;
+ return token;
}
/** Get the specific Token. */
final public Token getToken(int index) {
- Token t = token;
- for (int i = 0; i < index; i++) {
- if (t.next != null) t = t.next;
- else t = t.next = token_source.getNextToken();
- }
- return t;
+ Token t = token;
+ for (int i = 0; i < index; i++) {
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
+ }
+ return t;
}
- private int jj_ntk() {
- if ((jj_nt=token.next) == null)
- return (jj_ntk = (token.next=token_source.getNextToken()).kind);
- else
- return (jj_ntk = jj_nt.kind);
+ private int jj_ntk_f() {
+ if ((jj_nt=token.next) == null)
+ return (jj_ntk = (token.next=token_source.getNextToken()).kind);
+ else
+ return (jj_ntk = jj_nt.kind);
}
private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
@@ -517,36 +553,43 @@ public class CDTLiteralParser extends CDTLiteralParserBase implements CDTLiteral
/** Generate ParseException. */
public ParseException generateParseException() {
- jj_expentries.clear();
- boolean[] la1tokens = new boolean[40];
- if (jj_kind >= 0) {
- la1tokens[jj_kind] = true;
- jj_kind = -1;
- }
- for (int i = 0; i < 12; i++) {
- if (jj_la1[i] == jj_gen) {
- for (int j = 0; j < 32; j++) {
- if ((jj_la1_0[i] & (1<<j)) != 0) {
- la1tokens[j] = true;
- }
- if ((jj_la1_1[i] & (1<<j)) != 0) {
- la1tokens[32+j] = true;
- }
- }
- }
- }
- for (int i = 0; i < 40; i++) {
- if (la1tokens[i]) {
- jj_expentry = new int[1];
- jj_expentry[0] = i;
- jj_expentries.add(jj_expentry);
- }
- }
- int[][] exptokseq = new int[jj_expentries.size()][];
- for (int i = 0; i < jj_expentries.size(); i++) {
- exptokseq[i] = jj_expentries.get(i);
- }
- return new ParseException(token, exptokseq, tokenImage);
+ jj_expentries.clear();
+ boolean[] la1tokens = new boolean[40];
+ if (jj_kind >= 0) {
+ la1tokens[jj_kind] = true;
+ jj_kind = -1;
+ }
+ for (int i = 0; i < 12; i++) {
+ if (jj_la1[i] == jj_gen) {
+ for (int j = 0; j < 32; j++) {
+ if ((jj_la1_0[i] & (1<<j)) != 0) {
+ la1tokens[j] = true;
+ }
+ if ((jj_la1_1[i] & (1<<j)) != 0) {
+ la1tokens[32+j] = true;
+ }
+ }
+ }
+ }
+ for (int i = 0; i < 40; i++) {
+ if (la1tokens[i]) {
+ jj_expentry = new int[1];
+ jj_expentry[0] = i;
+ jj_expentries.add(jj_expentry);
+ }
+ }
+ int[][] exptokseq = new int[jj_expentries.size()][];
+ for (int i = 0; i < jj_expentries.size(); i++) {
+ exptokseq[i] = jj_expentries.get(i);
+ }
+ return new ParseException(token, exptokseq, tokenImage);
+ }
+
+ private boolean trace_enabled;
+
+/** Trace enabled. */
+ final public boolean trace_enabled() {
+ return trace_enabled;
}
/** Enable tracing. */
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java
index 9f7b775c89..7541676cee 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/CDTLiteralParserTokenManager.java
@@ -1,3 +1,4 @@
+/* CDTLiteralParserTokenManager.java */
/* Generated By:JavaCC: Do not edit this line. CDTLiteralParserTokenManager.java */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -27,8 +28,8 @@ import org.apache.jena.graph.Node;
import static org.apache.jena.riot.lang.extra.LangParserLib.*;
/** Token Manager. */
-public class CDTLiteralParserTokenManager implements CDTLiteralParserConstants
-{
+@SuppressWarnings ("unused")
+public class CDTLiteralParserTokenManager implements CDTLiteralParserConstants {
/** Debug output. */
public java.io.PrintStream debugStream = System.out;
@@ -40,8 +41,7 @@ private int jjStopAtPos(int pos, int kind)
jjmatchedPos = pos;
return pos + 1;
}
-private int jjMoveStringLiteralDfa0_0()
-{
+private int jjMoveStringLiteralDfa0_0(){
switch(curChar)
{
case 9:
@@ -96,8 +96,7 @@ private int jjMoveStringLiteralDfa0_0()
return jjMoveNfa_0(0, 0);
}
}
-private int jjMoveStringLiteralDfa1_0(long active0)
-{
+private int jjMoveStringLiteralDfa1_0(long active0){
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
return jjMoveNfa_0(0, 0);
@@ -126,8 +125,7 @@ private int jjMoveStringLiteralDfa1_0(long active0)
}
return jjMoveNfa_0(0, 1);
}
-private int jjMoveStringLiteralDfa2_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa2_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 1);
try { curChar = input_stream.readChar(); }
@@ -149,8 +147,7 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0)
}
return jjMoveNfa_0(0, 2);
}
-private int jjMoveStringLiteralDfa3_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa3_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 2);
try { curChar = input_stream.readChar(); }
@@ -189,8 +186,7 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0)
}
return jjMoveNfa_0(0, 3);
}
-private int jjMoveStringLiteralDfa4_0(long old0, long active0)
-{
+private int jjMoveStringLiteralDfa4_0(long old0, long active0){
if (((active0 &= old0)) == 0L)
return jjMoveNfa_0(0, 3);
try { curChar = input_stream.readChar(); }
@@ -284,22 +280,22 @@ private int jjMoveNfa_0(int startState, int curPos)
{
if (kind > 9)
kind = 9;
- jjCheckNAddStates(0, 7);
+ { jjCheckNAddStates(0, 7); }
}
else if ((0x280000000000L & l) != 0L)
- jjCheckNAddStates(8, 12);
+ { jjCheckNAddStates(8, 12); }
else if (curChar == 46)
- jjCheckNAddTwoStates(54, 56);
+ { jjCheckNAddTwoStates(54, 56); }
else if (curChar == 60)
- jjCheckNAddTwoStates(37, 38);
+ { jjCheckNAddTwoStates(37, 38); }
else if (curChar == 34)
jjstateSet[jjnewStateCnt++] = 34;
else if (curChar == 39)
jjstateSet[jjnewStateCnt++] = 22;
if (curChar == 34)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
else if (curChar == 39)
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 1:
if ((0x8400000000L & l) != 0L && kind > 15)
@@ -307,15 +303,15 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 2:
if (curChar == 39)
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 3:
if ((0xffffff7fffffdbffL & l) != 0L)
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 5:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 6:
if (curChar == 39 && kind > 16)
@@ -323,15 +319,15 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 7:
if (curChar == 34)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 8:
if ((0xfffffffbffffdbffL & l) != 0L)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 10:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 11:
if (curChar == 34 && kind > 17)
@@ -339,25 +335,25 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 12:
if (curChar == 39)
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 13:
case 17:
if ((0xffffff7fffffffffL & l) != 0L)
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 15:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 16:
case 19:
if (curChar == 39)
- jjCheckNAdd(17);
+ { jjCheckNAdd(17); }
break;
case 18:
if (curChar == 39)
- jjAddStates(23, 24);
+ { jjAddStates(23, 24); }
break;
case 20:
if (curChar == 39 && kind > 18)
@@ -377,25 +373,25 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 24:
if (curChar == 34)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 25:
case 29:
if ((0xfffffffbffffffffL & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 27:
if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 28:
case 31:
if (curChar == 34)
- jjCheckNAdd(29);
+ { jjCheckNAdd(29); }
break;
case 30:
if (curChar == 34)
- jjAddStates(29, 30);
+ { jjAddStates(29, 30); }
break;
case 32:
if (curChar == 34 && kind > 19)
@@ -415,11 +411,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 36:
if (curChar == 60)
- jjCheckNAddTwoStates(37, 38);
+ { jjCheckNAddTwoStates(37, 38); }
break;
case 37:
if ((0xaffffffa00000000L & l) != 0L)
- jjCheckNAddTwoStates(37, 38);
+ { jjCheckNAddTwoStates(37, 38); }
break;
case 38:
if (curChar == 62 && kind > 21)
@@ -434,11 +430,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
if (kind > 22)
kind = 22;
- jjCheckNAddTwoStates(41, 42);
+ { jjCheckNAddTwoStates(41, 42); }
break;
case 41:
if ((0x3ff600000000000L & l) != 0L)
- jjCheckNAddTwoStates(41, 42);
+ { jjCheckNAddTwoStates(41, 42); }
break;
case 42:
if ((0x3ff200000000000L & l) != 0L && kind > 22)
@@ -446,133 +442,133 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 46:
if (curChar == 45)
- jjCheckNAdd(47);
+ { jjCheckNAdd(47); }
break;
case 47:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 23)
kind = 23;
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 48:
if ((0x280000000000L & l) != 0L)
- jjCheckNAddStates(8, 12);
+ { jjCheckNAddStates(8, 12); }
break;
case 49:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 9)
kind = 9;
- jjCheckNAdd(49);
+ { jjCheckNAdd(49); }
break;
case 50:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(50, 51);
+ { jjCheckNAddTwoStates(50, 51); }
break;
case 51:
if (curChar != 46)
break;
if (kind > 10)
kind = 10;
- jjCheckNAdd(52);
+ { jjCheckNAdd(52); }
break;
case 52:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 10)
kind = 10;
- jjCheckNAdd(52);
+ { jjCheckNAdd(52); }
break;
case 53:
if (curChar == 46)
- jjCheckNAdd(54);
+ { jjCheckNAdd(54); }
break;
case 54:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 10)
kind = 10;
- jjCheckNAdd(54);
+ { jjCheckNAdd(54); }
break;
case 55:
if (curChar == 46)
- jjCheckNAdd(56);
+ { jjCheckNAdd(56); }
break;
case 56:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(56, 57);
+ { jjCheckNAddTwoStates(56, 57); }
break;
case 58:
if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(59);
+ { jjCheckNAdd(59); }
break;
case 59:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 11)
kind = 11;
- jjCheckNAdd(59);
+ { jjCheckNAdd(59); }
break;
case 60:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(31, 34);
+ { jjCheckNAddStates(31, 34); }
break;
case 61:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(61, 62);
+ { jjCheckNAddTwoStates(61, 62); }
break;
case 62:
if (curChar == 46)
- jjCheckNAddTwoStates(63, 64);
+ { jjCheckNAddTwoStates(63, 64); }
break;
case 63:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(63, 64);
+ { jjCheckNAddTwoStates(63, 64); }
break;
case 65:
if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(66);
+ { jjCheckNAdd(66); }
break;
case 66:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 11)
kind = 11;
- jjCheckNAdd(66);
+ { jjCheckNAdd(66); }
break;
case 67:
if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(67, 68);
+ { jjCheckNAddTwoStates(67, 68); }
break;
case 69:
if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(70);
+ { jjCheckNAdd(70); }
break;
case 70:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 11)
kind = 11;
- jjCheckNAdd(70);
+ { jjCheckNAdd(70); }
break;
case 71:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 9)
kind = 9;
- jjCheckNAddStates(0, 7);
+ { jjCheckNAddStates(0, 7); }
break;
case 72:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 20)
kind = 20;
- jjCheckNAdd(72);
+ { jjCheckNAdd(72); }
break;
case 73:
if (curChar == 46)
- jjCheckNAddTwoStates(54, 56);
+ { jjCheckNAddTwoStates(54, 56); }
break;
default : break;
}
@@ -587,7 +583,7 @@ private int jjMoveNfa_0(int startState, int curPos)
{
case 0:
if (curChar == 64)
- jjCheckNAdd(45);
+ { jjCheckNAdd(45); }
else if (curChar == 95)
jjstateSet[jjnewStateCnt++] = 39;
else if (curChar == 92)
@@ -599,7 +595,7 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 3:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 4:
if (curChar == 92)
@@ -607,11 +603,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 5:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(16, 18);
+ { jjCheckNAddStates(16, 18); }
break;
case 8:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 9:
if (curChar == 92)
@@ -619,11 +615,11 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 10:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(13, 15);
+ { jjCheckNAddStates(13, 15); }
break;
case 13:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 14:
if (curChar == 92)
@@ -631,14 +627,14 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 15:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 17:
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 25:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 26:
if (curChar == 92)
@@ -646,25 +642,25 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 27:
if ((0x14404410144044L & l) != 0L)
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 29:
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 37:
if ((0xc7fffffeafffffffL & l) != 0L)
- jjAddStates(35, 36);
+ { jjAddStates(35, 36); }
break;
case 40:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
if (kind > 22)
kind = 22;
- jjCheckNAddTwoStates(41, 42);
+ { jjCheckNAddTwoStates(41, 42); }
break;
case 41:
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(41, 42);
+ { jjCheckNAddTwoStates(41, 42); }
break;
case 42:
if ((0x7fffffe87fffffeL & l) != 0L && kind > 22)
@@ -676,33 +672,33 @@ private int jjMoveNfa_0(int startState, int curPos)
break;
case 44:
if (curChar == 64)
- jjCheckNAdd(45);
+ { jjCheckNAdd(45); }
break;
case 45:
if ((0x7fffffe07fffffeL & l) == 0L)
break;
if (kind > 23)
kind = 23;
- jjCheckNAddTwoStates(45, 46);
+ { jjCheckNAddTwoStates(45, 46); }
break;
case 47:
if ((0x7fffffe07fffffeL & l) == 0L)
break;
if (kind > 23)
kind = 23;
- jjCheckNAddTwoStates(46, 47);
+ { jjCheckNAddTwoStates(46, 47); }
break;
case 57:
if ((0x2000000020L & l) != 0L)
- jjAddStates(37, 38);
+ { jjAddStates(37, 38); }
break;
case 64:
if ((0x2000000020L & l) != 0L)
- jjAddStates(39, 40);
+ { jjAddStates(39, 40); }
break;
case 68:
if ((0x2000000020L & l) != 0L)
- jjAddStates(41, 42);
+ { jjAddStates(41, 42); }
break;
default : break;
}
@@ -710,7 +706,7 @@ private int jjMoveNfa_0(int startState, int curPos)
}
else
{
- int hiByte = (int)(curChar >> 8);
+ int hiByte = (curChar >> 8);
int i1 = hiByte >> 6;
long l1 = 1L << (hiByte & 077);
int i2 = (curChar & 0xff) >> 6;
@@ -721,42 +717,42 @@ private int jjMoveNfa_0(int startState, int curPos)
{
case 3:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(16, 18);
+ { jjAddStates(16, 18); }
break;
case 8:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(13, 15);
+ { jjAddStates(13, 15); }
break;
case 13:
case 17:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(19, 22);
+ { jjCheckNAddStates(19, 22); }
break;
case 25:
case 29:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(25, 28);
+ { jjCheckNAddStates(25, 28); }
break;
case 37:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(35, 36);
+ { jjAddStates(35, 36); }
break;
case 40:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
if (kind > 22)
kind = 22;
- jjCheckNAddTwoStates(41, 42);
+ { jjCheckNAddTwoStates(41, 42); }
break;
case 41:
if (jjCanMove_2(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(41, 42);
+ { jjCheckNAddTwoStates(41, 42); }
break;
case 42:
if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 22)
kind = 22;
break;
- default : break;
+ default : if (i1 == 0 || l1 == 0 || i2 == 0 || l2 == 0) break; else break;
}
} while(i != startsAt);
}
@@ -792,6 +788,36 @@ private int jjMoveNfa_0(int startState, int curPos)
return toRet;
}
+
+/** Token literal values. */
+public static final String[] jjstrLiteralImages = {
+"", null, null, null, null, null, null, null, null, null, null, null, null,
+null, null, null, null, null, null, null, null, null, null, null, null, null,
+"\156\165\154\154", "\173", "\175", "\133", "\135", "\54", "\72", "\136\136", "\100", null, null,
+null, null, null, };
+protected Token jjFillToken()
+{
+ final Token t;
+ final String curTokenImage;
+ final int beginLine;
+ final int endLine;
+ final int beginColumn;
+ final int endColumn;
+ String im = jjstrLiteralImages[jjmatchedKind];
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;
+ beginLine = input_stream.getBeginLine();
+ beginColumn = input_stream.getBeginColumn();
+ endLine = input_stream.getEndLine();
+ endColumn = input_stream.getEndColumn();
+ t = Token.newToken(jjmatchedKind, curTokenImage);
+
+ t.beginLine = beginLine;
+ t.endLine = endLine;
+ t.beginColumn = beginColumn;
+ t.endColumn = endColumn;
+
+ return t;
+}
static final int[] jjnextStates = {
49, 50, 51, 61, 62, 67, 68, 72, 49, 50, 53, 55, 60, 8, 9, 11,
3, 4, 6, 13, 14, 16, 18, 19, 21, 25, 26, 28, 30, 31, 33, 61,
@@ -858,96 +884,6 @@ private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, lo
}
}
-/** Token literal values. */
-public static final String[] jjstrLiteralImages = {
-"", null, null, null, null, null, null, null, null, null, null, null, null,
-null, null, null, null, null, null, null, null, null, null, null, null, null,
-"\156\165\154\154", "\173", "\175", "\133", "\135", "\54", "\72", "\136\136", "\100", null, null,
-null, null, null, };
-
-/** Lexer state names. */
-public static final String[] lexStateNames = {
- "DEFAULT",
-};
-static final long[] jjtoToken = {
- 0x7fcff8f81L,
-};
-static final long[] jjtoSkip = {
- 0x3eL,
-};
-protected JavaCharStream input_stream;
-private final int[] jjrounds = new int[74];
-private final int[] jjstateSet = new int[148];
-protected char curChar;
-/** Constructor. */
-public CDTLiteralParserTokenManager(JavaCharStream stream){
- if (JavaCharStream.staticFlag)
- throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
- input_stream = stream;
-}
-
-/** Constructor. */
-public CDTLiteralParserTokenManager(JavaCharStream stream, int lexState){
- this(stream);
- SwitchTo(lexState);
-}
-
-/** Reinitialise parser. */
-public void ReInit(JavaCharStream stream)
-{
- jjmatchedPos = jjnewStateCnt = 0;
- curLexState = defaultLexState;
- input_stream = stream;
- ReInitRounds();
-}
-private void ReInitRounds()
-{
- int i;
- jjround = 0x80000001;
- for (i = 74; i-- > 0;)
- jjrounds[i] = 0x80000000;
-}
-
-/** Reinitialise parser. */
-public void ReInit(JavaCharStream stream, int lexState)
-{
- ReInit(stream);
- SwitchTo(lexState);
-}
-
-/** Switch to specified lex state. */
-public void SwitchTo(int lexState)
-{
- if (lexState >= 1 || lexState < 0)
- throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
- else
- curLexState = lexState;
-}
-
-protected Token jjFillToken()
-{
- final Token t;
- final String curTokenImage;
- final int beginLine;
- final int endLine;
- final int beginColumn;
- final int endColumn;
- String im = jjstrLiteralImages[jjmatchedKind];
- curTokenImage = (im == null) ? input_stream.GetImage() : im;
- beginLine = input_stream.getBeginLine();
- beginColumn = input_stream.getBeginColumn();
- endLine = input_stream.getEndLine();
- endColumn = input_stream.getEndColumn();
- t = Token.newToken(jjmatchedKind, curTokenImage);
-
- t.beginLine = beginLine;
- t.endLine = endLine;
- t.beginColumn = beginColumn;
- t.endColumn = endColumn;
-
- return t;
-}
-
int curLexState = 0;
int defaultLexState = 0;
int jjnewStateCnt;
@@ -968,9 +904,10 @@ public Token getNextToken()
{
curChar = input_stream.BeginToken();
}
- catch(java.io.IOException e)
+ catch(Exception e)
{
jjmatchedKind = 0;
+ jjmatchedPos = -1;
matchedToken = jjFillToken();
return matchedToken;
}
@@ -1015,6 +952,31 @@ public Token getNextToken()
}
}
+void SkipLexicalActions(Token matchedToken)
+{
+ switch(jjmatchedKind)
+ {
+ default :
+ break;
+ }
+}
+void MoreLexicalActions()
+{
+ jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
+ switch(jjmatchedKind)
+ {
+ default :
+ break;
+ }
+}
+void TokenLexicalActions(Token matchedToken)
+{
+ switch(jjmatchedKind)
+ {
+ default :
+ break;
+ }
+}
private void jjCheckNAdd(int state)
{
if (jjrounds[state] != jjround)
@@ -1042,4 +1004,90 @@ private void jjCheckNAddStates(int start, int end)
} while (start++ != end);
}
+ /** Constructor. */
+ public CDTLiteralParserTokenManager(JavaCharStream stream){
+
+ if (JavaCharStream.staticFlag)
+ throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+
+ input_stream = stream;
+ }
+
+ /** Constructor. */
+ public CDTLiteralParserTokenManager (JavaCharStream stream, int lexState){
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ /** Reinitialise parser. */
+
+ public void ReInit(JavaCharStream stream)
+ {
+
+
+ jjmatchedPos =
+ jjnewStateCnt =
+ 0;
+ curLexState = defaultLexState;
+ input_stream = stream;
+ ReInitRounds();
+ }
+
+ private void ReInitRounds()
+ {
+ int i;
+ jjround = 0x80000001;
+ for (i = 74; i-- > 0;)
+ jjrounds[i] = 0x80000000;
+ }
+
+ /** Reinitialise parser. */
+ public void ReInit(JavaCharStream stream, int lexState)
+
+ {
+ ReInit(stream);
+ SwitchTo(lexState);
+ }
+
+ /** Switch to specified lex state. */
+ public void SwitchTo(int lexState)
+ {
+ if (lexState >= 1 || lexState < 0)
+ throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+ else
+ curLexState = lexState;
+ }
+
+
+/** Lexer state names. */
+public static final String[] lexStateNames = {
+ "DEFAULT",
+};
+
+/** Lex State array. */
+public static final int[] jjnewLexState = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+};
+static final long[] jjtoToken = {
+ 0x7fcff8f81L,
+};
+static final long[] jjtoSkip = {
+ 0x3eL,
+};
+static final long[] jjtoSpecial = {
+ 0x0L,
+};
+static final long[] jjtoMore = {
+ 0x0L,
+};
+ protected JavaCharStream input_stream;
+
+ private final int[] jjrounds = new int[74];
+ private final int[] jjstateSet = new int[2 * 74];
+ private final StringBuilder jjimage = new StringBuilder();
+ private StringBuilder image = jjimage;
+ private int jjimageLen;
+ private int lengthOfMatch;
+ protected int curChar;
}
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java
index 0db07c051d..16e184f3a6 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/JavaCharStream.java
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */
+/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 7.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -82,7 +82,7 @@ public static final boolean staticFlag = false;
throw new java.io.IOException(); // Should never come here
}
-/** Position in buffer. */
+/* Position in buffer. */
@SuppressWarnings("all")
public int bufpos = -1;
@@ -105,10 +105,15 @@ public int bufpos = -1;
protected int maxNextCharInd = 0;
protected int nextCharInd = -1;
protected int inBuf = 0;
- protected int tabSize = 8;
+ protected int tabSize = 1;
+ protected boolean trackLineColumn = true;
- protected void setTabSize(int i) { tabSize = i; }
- protected int getTabSize(int i) { return tabSize; }
+
+@SuppressWarnings("all")
+public void setTabSize(int i) { tabSize = i; }
+
+@SuppressWarnings("all")
+public int getTabSize() { return tabSize; }
protected void ExpandBuff(boolean wrapAround)
{
@@ -197,7 +202,7 @@ public int bufpos = -1;
return nextCharBuf[nextCharInd];
}
-/** @return starting character for token. */
+/* @return starting character for token. */
@SuppressWarnings("all")
public char BeginToken() throws java.io.IOException
@@ -279,7 +284,7 @@ public char BeginToken() throws java.io.IOException
bufcolumn[bufpos] = column;
}
-/** Read a character. */
+/* Read a character. */
@SuppressWarnings("all")
public char readChar() throws java.io.IOException
@@ -301,7 +306,7 @@ public char readChar() throws java.io.IOException
if ((buffer[bufpos] = c = ReadByte()) == '\\')
{
- UpdateLineColumn(c);
+ if (trackLineColumn) { UpdateLineColumn(c); }
int backSlashCnt = 1;
@@ -314,7 +319,7 @@ public char readChar() throws java.io.IOException
{
if ((buffer[bufpos] = c = ReadByte()) != '\\')
{
- UpdateLineColumn(c);
+ if (trackLineColumn) { UpdateLineColumn(c); }
// found a non-backslash char.
if ((c == 'u') && ((backSlashCnt & 1) == 1))
{
@@ -337,7 +342,7 @@ public char readChar() throws java.io.IOException
return '\\';
}
- UpdateLineColumn(c);
+ if (trackLineColumn) { UpdateLineColumn(c); }
backSlashCnt++;
}
@@ -375,43 +380,49 @@ public char readChar() throws java.io.IOException
}
}
- @Deprecated
- /**
+ /*
* @deprecated
* @see #getEndColumn
*/
+ @Deprecated
@SuppressWarnings("all")
public int getColumn() {
return bufcolumn[bufpos];
}
- @Deprecated
- /**
+ /*
* @deprecated
* @see #getEndLine
+ * @return the line number.
*/
+ @Deprecated
@SuppressWarnings("all")
public int getLine() {
return bufline[bufpos];
}
-/** Get end column. */
+/** Get end column.
+ * @return the end column or -1
+ */
@SuppressWarnings("all")
public int getEndColumn() {
return bufcolumn[bufpos];
}
-/** Get end line. */
+/** Get end line.
+ * @return the end line number or -1
+ */
@SuppressWarnings("all")
public int getEndLine() {
return bufline[bufpos];
}
-/** @return column of token start */
+/** Get the beginning column.
+ * @return column of token start */
@SuppressWarnings("all")
public int getBeginColumn() {
@@ -435,7 +446,12 @@ public void backup(int amount) {
bufpos += bufsize;
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream,
@@ -452,7 +468,11 @@ public JavaCharStream(java.io.Reader dstream,
nextCharBuf = new char[4096];
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream,
@@ -461,14 +481,17 @@ public JavaCharStream(java.io.Reader dstream,
this(dstream, startline, startcolumn, 4096);
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.Reader dstream)
{
this(dstream, 1, 1, 4096);
}
-/** Reinitialise. */
+/* Reinitialise. */
@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream,
@@ -491,7 +514,7 @@ public void ReInit(java.io.Reader dstream,
nextCharInd = bufpos = -1;
}
-/** Reinitialise. */
+/* Reinitialise. */
@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream,
@@ -500,7 +523,7 @@ public void ReInit(java.io.Reader dstream,
ReInit(dstream, startline, startcolumn, 4096);
}
-/** Reinitialise. */
+/* Reinitialise. */
@SuppressWarnings("all")
public void ReInit(java.io.Reader dstream)
@@ -516,16 +539,27 @@ public JavaCharStream(java.io.InputStream dstream, String encoding, int startlin
this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
@@ -534,7 +568,11 @@ public JavaCharStream(java.io.InputStream dstream, String encoding, int startlin
this(dstream, encoding, startline, startcolumn, 4096);
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, int startline,
@@ -543,7 +581,11 @@ public JavaCharStream(java.io.InputStream dstream, int startline,
this(dstream, startline, startcolumn, 4096);
}
-/** Constructor. */
+/** Constructor.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
@@ -551,7 +593,9 @@ public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.
this(dstream, encoding, 1, 1, 4096);
}
-/** Constructor. */
+ /** Constructor.
+ * @param dstream the underlying data source.
+ */
@SuppressWarnings("all")
public JavaCharStream(java.io.InputStream dstream)
@@ -559,7 +603,13 @@ public JavaCharStream(java.io.InputStream dstream)
this(dstream, 1, 1, 4096);
}
-/** Reinitialise. */
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
@@ -568,7 +618,12 @@ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
-/** Reinitialise. */
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @param buffersize size of the buffer
+ */
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, int startline,
@@ -576,7 +631,13 @@ public void ReInit(java.io.InputStream dstream, int startline,
{
ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
-/** Reinitialise. */
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
@@ -584,7 +645,11 @@ public void ReInit(java.io.InputStream dstream, String encoding, int startline,
{
ReInit(dstream, encoding, startline, startcolumn, 4096);
}
-/** Reinitialise. */
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param startline line number of the first character of the stream, mostly for error messages.
+ * @param startcolumn column number of the first character of the stream.
+ */
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, int startline,
@@ -592,7 +657,11 @@ public void ReInit(java.io.InputStream dstream, int startline,
{
ReInit(dstream, startline, startcolumn, 4096);
}
-/** Reinitialise. */
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ * @param encoding the character encoding of the data stream.
+ * @throws UnsupportedEncodingException encoding is invalid or unsupported.
+ */
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
@@ -600,7 +669,9 @@ public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.
ReInit(dstream, encoding, 1, 1, 4096);
}
-/** Reinitialise. */
+/** Reinitialise.
+ * @param dstream the underlying data source.
+ */
@SuppressWarnings("all")
public void ReInit(java.io.InputStream dstream)
@@ -608,7 +679,8 @@ public void ReInit(java.io.InputStream dstream)
ReInit(dstream, 1, 1, 4096);
}
- /** @return token image as String */
+ /** Get the token timage.
+ * @return token image as String */
@SuppressWarnings("all")
public String GetImage()
@@ -620,7 +692,9 @@ public String GetImage()
new String(buffer, 0, bufpos + 1);
}
- /** @return suffix */
+ /** Get the suffix as an array of characters.
+ * @param len the length of the array to return.
+ * @return suffix */
@SuppressWarnings("all")
public char[] GetSuffix(int len)
@@ -652,6 +726,9 @@ public void Done()
/**
* Method to adjust line and column numbers for the start of a token.
+ *
+ * @param newLine the new line number.
+ * @param newCol the new column number.
*/
@SuppressWarnings("all")
@@ -698,6 +775,8 @@ public void adjustBeginLineColumn(int newLine, int newCol)
line = bufline[j];
column = bufcolumn[j];
}
+ boolean getTrackLineColumn() { return trackLineColumn; }
+ void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; }
}
-/* JavaCC - OriginalChecksum=2ebc561fdb294979325bb97dfcdf1b61 (do not edit this line) */
+/* JavaCC - OriginalChecksum=daed28e1cd2df650024933c0cf62aeef (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
index 9fff7e2c63..24e3b9daa7 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/ParseException.java
@@ -1,5 +1,5 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
-/* JavaCCOptions:KEEP_LINE_COL=null */
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */
+/* JavaCCOptions:KEEP_LINE_COLUMN=true */
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -38,6 +38,11 @@ public class ParseException extends Exception {
*/
private static final long serialVersionUID = 1L;
+ /**
+ * The end of line string for this machine.
+ */
+ protected static String EOL = System.getProperty("line.separator", "\n");
+
/**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
@@ -78,7 +83,7 @@ public class ParseException extends Exception {
/**
* This is the last token that has been consumed successfully. If
* this object has been created due to a parse error, the token
- * followng this token will (therefore) be the first error token.
+ * following this token will (therefore) be the first error token.
*/
public Token currentToken;
@@ -106,8 +111,8 @@ public class ParseException extends Exception {
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
- String eol = System.getProperty("line.separator", "\n");
- StringBuffer expected = new StringBuffer();
+
+ StringBuilder expected = new StringBuilder();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
@@ -119,7 +124,7 @@ public class ParseException extends Exception {
if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
expected.append("...");
}
- expected.append(eol).append(" ");
+ expected.append(EOL).append(" ");
}
String retval = "Encountered \"";
Token tok = currentToken.next;
@@ -135,21 +140,26 @@ public class ParseException extends Exception {
retval += " \"";
tok = tok.next;
}
- retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
- retval += "." + eol;
- if (expectedTokenSequences.length == 1) {
- retval += "Was expecting:" + eol + " ";
+ if (currentToken.next != null) {
+ retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
+ }
+ retval += "." + EOL;
+
+
+ if (expectedTokenSequences.length == 0) {
+ // Nothing to add here
} else {
- retval += "Was expecting one of:" + eol + " ";
+ if (expectedTokenSequences.length == 1) {
+ retval += "Was expecting:" + EOL + " ";
+ } else {
+ retval += "Was expecting one of:" + EOL + " ";
+ }
+ retval += expected.toString();
}
- retval += expected.toString();
+
return retval;
}
- /**
- * The end of line string for this machine.
- */
- protected String eol = System.getProperty("line.separator", "\n");
/**
* Used to convert raw characters to their escaped version
@@ -157,13 +167,11 @@ public class ParseException extends Exception {
* string literal.
*/
static String add_escapes(String str) {
- StringBuffer retval = new StringBuffer();
+ StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
- case 0 :
- continue;
case '\b':
retval.append("\\b");
continue;
@@ -202,4 +210,4 @@ public class ParseException extends Exception {
}
}
-/* JavaCC - OriginalChecksum=0bd53902852438cd5670da2f50328753 (do not edit this line) */
+/* JavaCC - OriginalChecksum=ae45c177e8251ffb3eb197993240df1d (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
index 3e7793689f..5fab125108 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/Token.java
@@ -1,5 +1,5 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -115,6 +115,7 @@ public class Token implements java.io.Serializable {
/**
* Returns the image.
*/
+ @Override
public String toString()
{
return image;
@@ -146,4 +147,4 @@ public class Token implements java.io.Serializable {
}
}
-/* JavaCC - OriginalChecksum=0bb1e7330fe557a4194caa87be20ae38 (do not edit this line) */
+/* JavaCC - OriginalChecksum=d2beb9f825ecfb19fedd31da408e3820 (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java b/jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
index 307f2e7efd..09317489ca 100644
--- a/jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
+++ b/jena-arq/src/main/java/org/apache/jena/cdt/parser/TokenMgrError.java
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */
/* JavaCCOptions: */
/*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -40,22 +40,22 @@ public class TokenMgrError extends Error
/**
* Lexical error occurred.
*/
- static final int LEXICAL_ERROR = 0;
+ public static final int LEXICAL_ERROR = 0;
/**
* An attempt was made to create a second instance of a static token manager.
*/
- static final int STATIC_LEXER_ERROR = 1;
+ public static final int STATIC_LEXER_ERROR = 1;
/**
* Tried to change to an invalid lexical state.
*/
- static final int INVALID_LEXICAL_STATE = 2;
+ public static final int INVALID_LEXICAL_STATE = 2;
/**
* Detected (and bailed out of) an infinite loop in the token manager.
*/
- static final int LOOP_DETECTED = 3;
+ public static final int LOOP_DETECTED = 3;
/**
* Indicates the reason why the exception is thrown. It will have
@@ -68,13 +68,11 @@ public class TokenMgrError extends Error
* equivalents in the given string
*/
protected static final String addEscapes(String str) {
- StringBuffer retval = new StringBuffer();
+ StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
- case 0 :
- continue;
case '\b':
retval.append("\\b");
continue;
@@ -117,19 +115,20 @@ public class TokenMgrError extends Error
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexical error
- * curLexState : lexical state in which this error occurred
+ * lexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
- return("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
+ protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) {
+ return("Lexical error at line " + //
+ errorLine + ", column " + //
+ errorColumn + ". Encountered: " + //
+ (EOFSeen ? "<EOF>" : ("'" + addEscapes(String.valueOf(curChar)) + "' (" + curChar + "),")) + //
+ (errorAfter == null || errorAfter.length() == 0 ? "" : " after prefix \"" + addEscapes(errorAfter) + "\"")) + //
+ (lexState == 0 ? "" : " (in lexical state " + lexState + ")");
}
/**
@@ -141,6 +140,7 @@ public class TokenMgrError extends Error
*
* from this method for such cases in the release version of your parser.
*/
+ @Override
public String getMessage() {
return super.getMessage();
}
@@ -160,8 +160,8 @@ public class TokenMgrError extends Error
}
/** Full Constructor. */
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar, int reason) {
+ this(LexicalErr(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
}
}
-/* JavaCC - OriginalChecksum=8d2f5d5473ff1b03e240576a846cb262 (do not edit this line) */
+/* JavaCC - OriginalChecksum=2a351950eeffed92fd5e8ec488d61b44 (do not edit this line) */
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java b/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java
index 660b0c2580..1deaa592d9 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/CDTAwareParserProfile.java
@@ -45,88 +45,92 @@ import org.apache.jena.sparql.util.Context;
*/
public class CDTAwareParserProfile extends ParserProfileStd {
- public CDTAwareParserProfile( final FactoryRDF factory,
- final ErrorHandler errorHandler,
- final IRIxResolver resolver,
- final PrefixMap prefixMap,
- final Context context,
- final boolean checking,
- final boolean strictMode ) {
- super(factory, errorHandler, resolver, prefixMap, context, checking, strictMode);
- }
-
- @Override
- public Node createTypedLiteral( final String lex, final RDFDatatype datatype, final long line, final long col ) {
- // cdt:List and cdt:Map literals need to be treated in a special way
- // because we need to construct their value by parsing them using this
- // same parser profile; this is necessary to make sure that blank node
- // identifiers inside the lexical forms of multiple of these literals
- // within the same file are all mapped to the same blank node, and so
- // are all blank node identifers that occur directly in the file (i.e.,
- // ourside of CDT literals).
-
- if ( datatype.equals(CompositeDatatypeList.type) ) {
- return createListLiteral(lex);
- }
-
- if ( datatype.equals(CompositeDatatypeMap.type) ) {
- return createMapLiteral(lex);
- }
-
- return super.createTypedLiteral(lex, datatype, line, col);
- }
-
- protected Node createListLiteral( final String lex ) {
- // Attention: In contrast to the overridden createTypedLiteral function
- // in the superclass, for literals of the CDT datatypes we do not perform
- // a checkLiteral check because that would parse the lexical form of the
- // literal already once before doing the other parse to obtain the value.
-
- // parse the given lexical form using this same parser profile
- final List<CDTValue> value;
- try {
- value = ParserForCDTLiterals.parseListLiteral(this, lex);
- }
- catch ( final Exception ex ) {
- throw new DatatypeFormatException(lex, CompositeDatatypeList.type, ex);
- }
-
- // At this point we have both the lexical form (which, after the
- // parsing, we now know is well formed) and the corresponding value
- // of the literal. We create a LiteralLabel with both of them, for
- // the following reasons.
- // If we were to create the LiteralLabel with the lexical form only,
- // then the LiteralLabel implementation would parse that lexical form
- // again, which gives us an unnecessary performance penalty (in
- // particular for huge lists).
- // If we were to create the LiteralLabel with the value only, then the
- // LiteralLabel implementation would reproduce the lexical form, which
- // may not be identical to the lexical form with which we have created
- // the value here. The issue with that is that a SAMETERM comparison
- // would incorrectly return false.
- final LiteralLabel ll = LiteralLabelFactory.createIncludingValue(lex, value, CompositeDatatypeList.type);
- return NodeFactory.createLiteral(ll);
- }
-
- protected Node createMapLiteral( final String lex ) {
- // Attention: In contrast to the overridden createTypedLiteral function
- // in the superclass, for literals of the CDT datatypes we do not perform
- // a checkLiteral check because that would parse the lexical form of the
- // literal already once before doing the other parse to obtain the value.
-
- // parse the given lexical form using this same parser profile
- final Map<CDTKey,CDTValue> value;
- try {
- value = ParserForCDTLiterals.parseMapLiteral(this, lex);
- }
- catch ( final Exception ex ) {
- throw new DatatypeFormatException(lex, CompositeDatatypeMap.type, ex);
- }
-
- // We create a LiteralLabel with both the lexical form and the value,
- // for the same reasons as described above in createListLiteral().
- final LiteralLabel ll = LiteralLabelFactory.createIncludingValue(lex, value, CompositeDatatypeMap.type);
- return NodeFactory.createLiteral(ll);
- }
+ public CDTAwareParserProfile( final FactoryRDF factory,
+ final ErrorHandler errorHandler,
+ final IRIxResolver resolver,
+ final PrefixMap prefixMap,
+ final Context context,
+ final boolean checking,
+ final boolean strictMode ) {
+ super(factory, errorHandler, resolver, prefixMap, context, checking, strictMode);
+ }
+
+ @Override
+ public Node createTypedLiteral( final String lex, final RDFDatatype datatype, final long line, final long col ) {
+ // cdt:List and cdt:Map literals need to be treated in a special way
+ // because we need to construct their value by parsing them using this
+ // same parser profile; this is necessary to make sure that blank node
+ // identifiers inside the lexical forms of multiple of these literals
+ // within the same file are all mapped to the same blank node, and so
+ // are all blank node identifers that occur directly in the file (i.e.,
+ // ourside of CDT literals).
+
+ if ( datatype.equals(CompositeDatatypeList.type) ) {
+ return createListLiteral(lex);
+ }
+
+ if ( datatype.equals(CompositeDatatypeMap.type) ) {
+ return createMapLiteral(lex);
+ }
+
+ return super.createTypedLiteral(lex, datatype, line, col);
+ }
+
+ protected Node createListLiteral( final String lex ) {
+ // Attention: In contrast to the overridden createTypedLiteral function
+ // in the superclass, for literals of the CDT datatypes we do not perform
+ // a checkLiteral check because that would parse the lexical form of the
+ // literal already once before doing the other parse to obtain the value.
+
+ // parse the given lexical form using this same parser profile
+ final List<CDTValue> value;
+ try {
+ value = ParserForCDTLiterals.parseListLiteral(this, lex);
+ }
+ catch ( final Exception ex ) {
+ throw new DatatypeFormatException(lex, CompositeDatatypeList.type, ex);
+ }
+
+ // At this point we have both the lexical form (which, after the
+ // parsing, we now know is well formed) and the corresponding value
+ // of the literal. We create a LiteralLabel with both of them, for
+ // the following reasons.
+ // If we were to create the LiteralLabel with the lexical form only,
+ // then the LiteralLabel implementation would parse that lexical form
+ // again, which gives us an unnecessary performance penalty (in
+ // particular for huge lists).
+ // If we were to create the LiteralLabel with the value only, then the
+ // LiteralLabel implementation would reproduce the lexical form, which
+ // may not be identical to the lexical form with which we have created
+ // the value here. The issue with that is that a SAMETERM comparison
+ // would incorrectly return false.
+ final LiteralLabel ll = LiteralLabelFactory.createIncludingValue(lex, value, CompositeDatatypeList.type);
+ @SuppressWarnings("deprecation")
+ Node n = NodeFactory.createLiteral(ll);
+ return n;
+ }
+
+ protected Node createMapLiteral( final String lex ) {
+ // Attention: In contrast to the overridden createTypedLiteral function
+ // in the superclass, for literals of the CDT datatypes we do not perform
+ // a checkLiteral check because that would parse the lexical form of the
+ // literal already once before doing the other parse to obtain the value.
+
+ // parse the given lexical form using this same parser profile
+ final Map<CDTKey,CDTValue> value;
+ try {
+ value = ParserForCDTLiterals.parseMapLiteral(this, lex);
+ }
+ catch ( final Exception ex ) {
+ throw new DatatypeFormatException(lex, CompositeDatatypeMap.type, ex);
+ }
+
+ // We create a LiteralLabel with both the lexical form and the value,
+ // for the same reasons as described above in createListLiteral().
+ final LiteralLabel ll = LiteralLabelFactory.createIncludingValue(lex, value, CompositeDatatypeMap.type);
+ @SuppressWarnings("deprecation")
+ Node n = NodeFactory.createLiteral(ll);
+ return n;
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java
index 55a193e133..3a43f26c00 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/algebra/op/OpUnfold.java
@@ -28,75 +28,69 @@ import org.apache.jena.sparql.expr.Expr;
import org.apache.jena.sparql.sse.Tags;
import org.apache.jena.sparql.util.NodeIsomorphismMap;
-public class OpUnfold extends Op1
-{
- protected final Expr expr ;
- protected final Var var1 ;
- protected final Var var2 ;
+public class OpUnfold extends Op1 {
+ protected final Expr expr;
+ protected final Var var1;
+ protected final Var var2;
public OpUnfold(Op subOp, Expr expr, Var var1, Var var2) {
- super(subOp) ;
- this.expr = expr ;
- this.var1 = var1 ;
- this.var2 = var2 ;
+ super(subOp);
+ this.expr = expr;
+ this.var1 = var1;
+ this.var2 = var2;
}
- public Expr getExpr()
- {
- return expr ;
+ public Expr getExpr() {
+ return expr;
}
- public Var getVar1()
- {
- return var1 ;
+ public Var getVar1() {
+ return var1;
}
- public Var getVar2()
- {
- return var2 ;
+ public Var getVar2() {
+ return var2;
}
@Override
public String getName() {
- return Tags.tagUnfold ;
+ return Tags.tagUnfold;
}
@Override
public void visit(OpVisitor opVisitor) {
- opVisitor.visit(this) ;
+ opVisitor.visit(this);
}
@Override
public Op1 copy(Op subOp) {
- OpUnfold op = new OpUnfold(subOp, expr, var1, var2) ;
- return op ;
+ OpUnfold op = new OpUnfold(subOp, expr, var1, var2);
+ return op;
}
@Override
public boolean equalTo(Op other, NodeIsomorphismMap labelMap) {
- if ( !(other instanceof OpUnfold) )
- return false ;
- OpUnfold unfold = (OpUnfold)other ;
-
- if ( !Objects.equals(var1, unfold.var1) )
- return false ;
- if ( !Objects.equals(var2, unfold.var2) )
- return false ;
- if ( !Objects.equals(expr, unfold.expr) )
- return false ;
- return getSubOp().equalTo(unfold.getSubOp(), labelMap) ;
+ if ( !(other instanceof OpUnfold unfold) )
+ return false;
+ if ( !Objects.equals(var1, unfold.var1) )
+ return false;
+ if ( !Objects.equals(var2, unfold.var2) )
+ return false;
+ if ( !Objects.equals(expr, unfold.expr) )
+ return false;
+ return getSubOp().equalTo(unfold.getSubOp(), labelMap);
}
@Override
public Op apply(Transform transform, Op subOp) {
- return transform.transform(this, subOp) ;
+ return transform.transform(this, subOp);
}
@Override
public int hashCode() {
if ( var2 == null )
- return getName().hashCode() ^ expr.hashCode() ^ var1.hashCode() ^ getSubOp().hashCode() ;
+ return getName().hashCode() ^ expr.hashCode() ^ var1.hashCode() ^ getSubOp().hashCode();
else
- return getName().hashCode() ^ expr.hashCode() ^ var1.hashCode() ^ var2.hashCode() ^ getSubOp().hashCode() ;
+ return getName().hashCode() ^ expr.hashCode() ^ var1.hashCode() ^ var2.hashCode() ^ getSubOp().hashCode();
}
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java
index 6de9f31fc8..500aefa3d3 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterUnfold.java
@@ -43,16 +43,16 @@ import org.apache.jena.sparql.serializer.SerializationContext;
public class QueryIterUnfold extends QueryIterRepeatApply
{
- protected final Expr expr ;
- protected final Var var1 ;
- protected final Var var2 ;
+ protected final Expr expr;
+ protected final Var var1;
+ protected final Var var2;
public QueryIterUnfold(QueryIterator qIter, Expr expr, Var var1, Var var2, ExecutionContext execCxt) {
- super(qIter, execCxt) ;
+ super(qIter, execCxt);
- this.expr = expr ;
- this.var1 = var1 ;
- this.var2 = var2 ;
+ this.expr = expr;
+ this.var1 = var1;
+ this.var2 = var2;
}
@Override
@@ -65,7 +65,6 @@ public class QueryIterUnfold extends QueryIterRepeatApply
// If the expression failed to evaluate, we create no
// no assignment (exactly as in the case of BIND, see
// the 'accept' method in 'QueryIterAssign')
-
return QueryIterSingleton.create( inputBinding, getExecContext() );
}
@@ -140,7 +139,7 @@ public class QueryIterUnfold extends QueryIterRepeatApply
final Node indexNode;
if ( var2 != null ) {
final String indexStr = Integer.toString(nextIndex);
- indexNode = NodeFactory.createLiteral(indexStr, XSDDatatype.XSDinteger);
+ indexNode = NodeFactory.createLiteralDT(indexStr, XSDDatatype.XSDinteger);
}
else {
indexNode = null;
@@ -273,7 +272,6 @@ public class QueryIterUnfold extends QueryIterRepeatApply
}
}
-
protected static class ListElementExtractor extends ElementExtractorBase<String> {
public ListElementExtractor( final String listAsString ) {
super(listAsString);
@@ -300,7 +298,6 @@ public class QueryIterUnfold extends QueryIterRepeatApply
}
}
-
protected static class MapElementExtractor extends ElementExtractorBase<Map.Entry<String,String>> {
public MapElementExtractor( final String mapAsString ) {
super(mapAsString);
@@ -342,5 +339,4 @@ public class QueryIterUnfold extends QueryIterRepeatApply
cursor++;
}
}
-
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java
index d7d5f14674..534eb6d787 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctionUtils.java
@@ -34,120 +34,120 @@ import org.apache.jena.sparql.expr.NodeValue;
public class CDTLiteralFunctionUtils
{
- /**
- * Uses {@link CompositeDatatypeList#isListLiteral(Node)} to check whether
- * the given node is a cdt:List literal and throws an exception if not.
- */
- public static final void ensureListLiteral( final Node n ) throws ExprEvalException {
- if ( ! CompositeDatatypeList.isListLiteral(n) )
- throw new ExprEvalException("Not a cdt:List literal: " + n);
- }
-
- /**
- * Uses {@link CompositeDatatypeMap#isMapLiteral(Node)} to check whether
- * the given node is a cdt:Map literal and throws an exception if not.
- */
- public static final void ensureMapLiteral( final Node n ) throws ExprEvalException {
- if ( ! CompositeDatatypeMap.isMapLiteral(n) )
- throw new ExprEvalException("Not a cdt:Map literal: " + n);
- }
-
- /**
- * Assumes that the given node is a cdt:List literal and uses
- * {@link CompositeDatatypeList#getValue(LiteralLabel)} to get
- * the list.
- *
- * Throws an ExprEvalException if a DatatypeFormatException is
- * thrown by {@link CompositeDatatypeList#getValue(LiteralLabel)}.
- */
- public static final List<CDTValue> getList( final Node n ) throws ExprEvalException {
- if ( ! n.getLiteral().isWellFormed() )
- throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n);
-
- try {
- return CompositeDatatypeList.getValue( n.getLiteral() );
- }
- catch ( final DatatypeFormatException ex ) {
- throw new ExprEvalException("Not a well-formed cdt:List literal: " + n, ex);
- }
- }
-
- /**
- * Assumes that the given node is a cdt:Map literal and uses
- * {@link CompositeDatatypeMap#getValue(LiteralLabel)} to get
- * the map.
- *
- * Throws an ExprEvalException if a DatatypeFormatException is
- * thrown by {@link CompositeDatatypeMap#getValue(LiteralLabel)}.
- */
- public static final Map<CDTKey,CDTValue> getMap( final Node n ) throws ExprEvalException {
- if ( ! n.getLiteral().isWellFormed() )
- throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n);
-
- try {
- return CompositeDatatypeMap.getValue( n.getLiteral() );
- }
- catch ( final DatatypeFormatException ex ) {
- throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n, ex);
- }
- }
-
- /**
- * Calls {@link #ensureListLiteral(Node)} first, and {@link #getList(Node)}
- * afterwards.
- */
- public static final List<CDTValue> checkAndGetList( final Node n ) throws ExprEvalException {
- ensureListLiteral(n);
- return getList(n);
- }
-
- /**
- * Calls {@link #ensureMapLiteral(Node)} first, and {@link #getMap(Node)}
- * afterwards.
- */
- public static final Map<CDTKey,CDTValue> checkAndGetMap( final Node n ) throws ExprEvalException {
- ensureMapLiteral(n);
- return getMap(n);
- }
-
- public static final List<CDTValue> checkAndGetList( final NodeValue nv ) throws ExprEvalException {
- return checkAndGetList( nv.asNode() );
- }
-
- public static final Map<CDTKey,CDTValue> checkAndGetMap( final NodeValue nv ) throws ExprEvalException {
- return checkAndGetMap( nv.asNode() );
- }
-
- /**
- * Creates a {@link NodeV} with a cdt:List literal that represents the
- * given list.
- */
- public static final Node createNode( final List<CDTValue> list ) {
- return NodeFactory.createLiteralByValue(list, CompositeDatatypeList.type);
- }
-
- /**
- * Creates a {@link Node} with a cdt:Map literal that represents the
- * given map.
- */
- public static final Node createNode( final Map<CDTKey,CDTValue> map ) {
- return NodeFactory.createLiteralByValue(map, CompositeDatatypeMap.type);
- }
-
- /**
- * Creates a {@link NodeValue} with a cdt:List literal that represents the
- * given list.
- */
- public static final NodeValue createNodeValue( final List<CDTValue> list ) {
- return NodeValue.makeNode( createNode(list) );
- }
-
- /**
- * Creates a {@link NodeValue} with a cdt:Map literal that represents the
- * given map.
- */
- public static final NodeValue createNodeValue( final Map<CDTKey,CDTValue> map ) {
- return NodeValue.makeNode( createNode(map) );
- }
+ /**
+ * Uses {@link CompositeDatatypeList#isListLiteral(Node)} to check whether
+ * the given node is a cdt:List literal and throws an exception if not.
+ */
+ public static final void ensureListLiteral( final Node n ) throws ExprEvalException {
+ if ( ! CompositeDatatypeList.isListLiteral(n) )
+ throw new ExprEvalException("Not a cdt:List literal: " + n);
+ }
+
+ /**
+ * Uses {@link CompositeDatatypeMap#isMapLiteral(Node)} to check whether
+ * the given node is a cdt:Map literal and throws an exception if not.
+ */
+ public static final void ensureMapLiteral( final Node n ) throws ExprEvalException {
+ if ( ! CompositeDatatypeMap.isMapLiteral(n) )
+ throw new ExprEvalException("Not a cdt:Map literal: " + n);
+ }
+
+ /**
+ * Assumes that the given node is a cdt:List literal and uses
+ * {@link CompositeDatatypeList#getValue(LiteralLabel)} to get
+ * the list.
+ *
+ * Throws an ExprEvalException if a DatatypeFormatException is
+ * thrown by {@link CompositeDatatypeList#getValue(LiteralLabel)}.
+ */
+ public static final List<CDTValue> getList( final Node n ) throws ExprEvalException {
+ if ( ! n.getLiteral().isWellFormed() )
+ throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n);
+
+ try {
+ return CompositeDatatypeList.getValue( n.getLiteral() );
+ }
+ catch ( final DatatypeFormatException ex ) {
+ throw new ExprEvalException("Not a well-formed cdt:List literal: " + n, ex);
+ }
+ }
+
+ /**
+ * Assumes that the given node is a cdt:Map literal and uses
+ * {@link CompositeDatatypeMap#getValue(LiteralLabel)} to get
+ * the map.
+ *
+ * Throws an ExprEvalException if a DatatypeFormatException is
+ * thrown by {@link CompositeDatatypeMap#getValue(LiteralLabel)}.
+ */
+ public static final Map<CDTKey,CDTValue> getMap( final Node n ) throws ExprEvalException {
+ if ( ! n.getLiteral().isWellFormed() )
+ throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n);
+
+ try {
+ return CompositeDatatypeMap.getValue( n.getLiteral() );
+ }
+ catch ( final DatatypeFormatException ex ) {
+ throw new ExprEvalException("Not a well-formed cdt:Map literal: " + n, ex);
+ }
+ }
+
+ /**
+ * Calls {@link #ensureListLiteral(Node)} first, and {@link #getList(Node)}
+ * afterwards.
+ */
+ public static final List<CDTValue> checkAndGetList( final Node n ) throws ExprEvalException {
+ ensureListLiteral(n);
+ return getList(n);
+ }
+
+ /**
+ * Calls {@link #ensureMapLiteral(Node)} first, and {@link #getMap(Node)}
+ * afterwards.
+ */
+ public static final Map<CDTKey,CDTValue> checkAndGetMap( final Node n ) throws ExprEvalException {
+ ensureMapLiteral(n);
+ return getMap(n);
+ }
+
+ public static final List<CDTValue> checkAndGetList( final NodeValue nv ) throws ExprEvalException {
+ return checkAndGetList( nv.asNode() );
+ }
+
+ public static final Map<CDTKey,CDTValue> checkAndGetMap( final NodeValue nv ) throws ExprEvalException {
+ return checkAndGetMap( nv.asNode() );
+ }
+
+ /**
+ * Creates a {@link Node} with a cdt:List literal that represents the
+ * given list.
+ */
+ public static final Node createNode( final List<CDTValue> list ) {
+ return NodeFactory.createLiteralByValue(list, CompositeDatatypeList.type);
+ }
+
+ /**
+ * Creates a {@link Node} with a cdt:Map literal that represents the
+ * given map.
+ */
+ public static final Node createNode( final Map<CDTKey,CDTValue> map ) {
+ return NodeFactory.createLiteralByValue(map, CompositeDatatypeMap.type);
+ }
+
+ /**
+ * Creates a {@link NodeValue} with a cdt:List literal that represents the
+ * given list.
+ */
+ public static final NodeValue createNodeValue( final List<CDTValue> list ) {
+ return NodeValue.makeNode( createNode(list) );
+ }
+
+ /**
+ * Creates a {@link NodeValue} with a cdt:Map literal that represents the
+ * given map.
+ */
+ public static final NodeValue createNodeValue( final Map<CDTKey,CDTValue> map ) {
+ return NodeValue.makeNode( createNode(map) );
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java
index 35b2e78a78..7072839688 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/CDTLiteralFunctions.java
@@ -22,22 +22,22 @@ import org.apache.jena.sparql.ARQConstants;
import org.apache.jena.sparql.function.FunctionRegistry;
public class CDTLiteralFunctions {
- public static void register( final FunctionRegistry functionRegistry ) {
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "concat", ConcatFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "contains", ContainsFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "containsKey", ContainsKeyFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "containsTerm", ContainsTermFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "get", GetFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "head", HeadFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "keys", KeysFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "List", ListFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "Map", MapFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "merge", MergeFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "put", PutFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "remove", RemoveFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "reverse", ReverseFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "size", SizeFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "subseq", SubSeqFct.class );
- functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "tail", TailFct.class );
- }
+ public static void register( final FunctionRegistry functionRegistry ) {
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "concat", ConcatFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "contains", ContainsFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "containsKey", ContainsKeyFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "containsTerm", ContainsTermFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "get", GetFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "head", HeadFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "keys", KeysFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "List", ListFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "Map", MapFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "merge", MergeFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "put", PutFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "remove", RemoveFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "reverse", ReverseFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "size", SizeFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "subseq", SubSeqFct.class );
+ functionRegistry.put( ARQConstants.CDTFunctionLibraryURI + "tail", TailFct.class );
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java
index 6a0dba2350..1825619709 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ConcatFct.java
@@ -29,33 +29,33 @@ import org.apache.jena.sparql.function.FunctionBase;
public class ConcatFct extends FunctionBase
{
- @Override
- public void checkBuild( final String uri, final ExprList args ) {
- // nothing to check
- }
-
- @Override
- public NodeValue exec( final List<NodeValue> args ) {
- if ( args.isEmpty() ) {
- final List<CDTValue> result = Collections.emptyList();
- return CDTLiteralFunctionUtils.createNodeValue(result);
- }
-
- if ( args.size() == 1 ) {
- final NodeValue nv = args.get(0);
- // make sure that the argument is a well-formed cdt:List literal
- CDTLiteralFunctionUtils.checkAndGetList(nv);
-
- return nv;
- }
-
- final List<CDTValue> result = new ArrayList<>();
- for ( final NodeValue nv : args ) {
- final List<CDTValue> l = CDTLiteralFunctionUtils.checkAndGetList(nv);
- result.addAll(l);
- }
-
- return CDTLiteralFunctionUtils.createNodeValue(result);
- }
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ // nothing to check
+ }
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ if ( args.isEmpty() ) {
+ final List<CDTValue> result = Collections.emptyList();
+ return CDTLiteralFunctionUtils.createNodeValue(result);
+ }
+
+ if ( args.size() == 1 ) {
+ final NodeValue nv = args.get(0);
+ // make sure that the argument is a well-formed cdt:List literal
+ CDTLiteralFunctionUtils.checkAndGetList(nv);
+
+ return nv;
+ }
+
+ final List<CDTValue> result = new ArrayList<>();
+ for ( final NodeValue nv : args ) {
+ final List<CDTValue> l = CDTLiteralFunctionUtils.checkAndGetList(nv);
+ result.addAll(l);
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(result);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java
index 90aa9217a8..ae847d9313 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsFct.java
@@ -26,27 +26,27 @@ import org.apache.jena.sparql.function.FunctionBase2;
public class ContainsFct extends FunctionBase2
{
- @Override
- public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
- final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv1);
- final boolean result = containsNode( list, nv2 );
- return NodeValue.booleanReturn(result);
- }
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv1);
+ final boolean result = containsNode( list, nv2 );
+ return NodeValue.booleanReturn(result);
+ }
- /**
- * Returns true if the given list contains the given RDF term.
- */
- protected boolean containsNode( final List<CDTValue> list, final NodeValue nv ) {
- for ( final CDTValue v : list ) {
- if ( v.isNode() ) {
- final NodeValue vv = NodeValue.makeNode( v.asNode() );
- if ( NodeValue.sameValueAs(vv, nv) ) {
- return true;
- }
- }
- }
+ /**
+ * Returns true if the given list contains the given RDF term.
+ */
+ protected boolean containsNode( final List<CDTValue> list, final NodeValue nv ) {
+ for ( final CDTValue v : list ) {
+ if ( v.isNode() ) {
+ final NodeValue vv = NodeValue.makeNode( v.asNode() );
+ if ( NodeValue.sameValueAs(vv, nv) ) {
+ return true;
+ }
+ }
+ }
- return false;
- }
+ return false;
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java
index 88a46fd2d0..902d964f2e 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsKeyFct.java
@@ -29,25 +29,25 @@ import org.apache.jena.sparql.function.FunctionBase2;
public class ContainsKeyFct extends FunctionBase2
{
- @Override
- public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
- final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
- final Node n2 = nv2.asNode();
+ final Node n2 = nv2.asNode();
- // If the second argument is not an IRI or a literal, then it cannot be
- // a map key in the given map and, by definition of cdt:containsKey, we
- // have to return false.
- if ( ! n2.isURI() && ! n2.isLiteral() )
- return NodeValue.booleanReturn(false);
+ // If the second argument is not an IRI or a literal, then it cannot be
+ // a map key in the given map and, by definition of cdt:containsKey, we
+ // have to return false.
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ return NodeValue.booleanReturn(false);
- if ( map.isEmpty() )
- return NodeValue.booleanReturn(false);
+ if ( map.isEmpty() )
+ return NodeValue.booleanReturn(false);
- final CDTKey key = CDTFactory.createKey(n2);
- final CDTValue value = map.get(key);
+ final CDTKey key = CDTFactory.createKey(n2);
+ final CDTValue value = map.get(key);
- return NodeValue.booleanReturn( value != null );
- }
+ return NodeValue.booleanReturn( value != null );
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java
index e5fc0421f4..c2818ce136 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ContainsTermFct.java
@@ -27,26 +27,26 @@ import org.apache.jena.sparql.function.FunctionBase2;
public class ContainsTermFct extends FunctionBase2
{
- @Override
- public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
- final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv1);
- final boolean result = containsTerm( list, nv2 );
- return NodeValue.booleanReturn(result);
- }
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv1);
+ final boolean result = containsTerm( list, nv2 );
+ return NodeValue.booleanReturn(result);
+ }
- /**
- * Returns true if the given list contains the given RDF term.
- */
- protected boolean containsTerm( final List<CDTValue> list, final NodeValue nv ) {
- for ( final CDTValue v : list ) {
- if ( v.isNode() ) {
- if ( NodeFunctions.sameTerm(v.asNode(), nv.asNode()) ) {
- return true;
- }
- }
- }
+ /**
+ * Returns true if the given list contains the given RDF term.
+ */
+ protected boolean containsTerm( final List<CDTValue> list, final NodeValue nv ) {
+ for ( final CDTValue v : list ) {
+ if ( v.isNode() ) {
+ if ( NodeFunctions.sameTerm(v.asNode(), nv.asNode()) ) {
+ return true;
+ }
+ }
+ }
- return false;
- }
+ return false;
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java
index 0b2af54810..720a8db064 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/FunctionBase1List.java
@@ -26,11 +26,11 @@ import org.apache.jena.sparql.function.FunctionBase1;
public abstract class FunctionBase1List extends FunctionBase1
{
- @Override
- public NodeValue exec( final NodeValue nv ) {
- final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv);
- return _exec(list, nv);
- }
+ @Override
+ public NodeValue exec( final NodeValue nv ) {
+ final List<CDTValue> list = CDTLiteralFunctionUtils.checkAndGetList(nv);
+ return _exec(list, nv);
+ }
- protected abstract NodeValue _exec( List<CDTValue> list, NodeValue nvList );
+ protected abstract NodeValue _exec( List<CDTValue> list, NodeValue nvList );
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java
index 24bcbfcfb5..fdc3f490e7 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/GetFct.java
@@ -33,70 +33,70 @@ import org.apache.jena.sparql.function.FunctionBase2;
public class GetFct extends FunctionBase2
{
- @Override
- public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
- final Node n1 = nv1.asNode();
-
- if ( CompositeDatatypeList.isListLiteral(n1) )
- return getFromList(n1, nv2);
-
- if ( CompositeDatatypeMap.isMapLiteral(n1) )
- return getFromMap(n1, nv2);
-
- throw new ExprEvalException("Neither a list nor a map literal: " + nv1);
- }
-
- protected NodeValue getFromList( final Node n1, final NodeValue nv2 ) {
- if ( ! nv2.isInteger() )
- throw new ExprEvalException("Not an integer literal: " + nv2);
-
- final int index = nv2.getInteger().intValue();
-
- if ( index < 1 )
- throw new ExprEvalException("Out of bounds index value: " + nv2);
-
- final List<CDTValue> list = CDTLiteralFunctionUtils.getList(n1);
-
- if ( index > list.size() )
- throw new ExprEvalException("Out of bounds index value: " + nv2);
-
- final CDTValue value = list.get( index-1 );
- if ( value.isNull() ) {
- throw new ExprEvalException("accessing null value from list" );
- }
- else if ( value.isNode() ) {
- return NodeValue.makeNode( value.asNode() );
- }
- else {
- throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
- }
- }
-
- protected NodeValue getFromMap( final Node n1, final NodeValue nv2 ) {
- final Node n2 = nv2.asNode();
- if ( ! n2.isURI() && ! n2.isLiteral() )
- throw new ExprEvalException("Not a valid map key: " + nv2);
-
- final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.getMap(n1);
-
- if ( map.isEmpty() )
- throw new ExprEvalException("empty map");
-
- final CDTKey key = CDTFactory.createKey(n2);
- final CDTValue value = map.get(key);
-
- if ( value == null ) {
- throw new ExprEvalException("key is not in the map");
- }
- else if ( value.isNull() ) {
- throw new ExprEvalException("value for key is in null");
- }
- else if ( value.isNode() ) {
- return NodeValue.makeNode( value.asNode() );
- }
- else {
- throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
- }
- }
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Node n1 = nv1.asNode();
+
+ if ( CompositeDatatypeList.isListLiteral(n1) )
+ return getFromList(n1, nv2);
+
+ if ( CompositeDatatypeMap.isMapLiteral(n1) )
+ return getFromMap(n1, nv2);
+
+ throw new ExprEvalException("Neither a list nor a map literal: " + nv1);
+ }
+
+ protected NodeValue getFromList( final Node n1, final NodeValue nv2 ) {
+ if ( ! nv2.isInteger() )
+ throw new ExprEvalException("Not an integer literal: " + nv2);
+
+ final int index = nv2.getInteger().intValue();
+
+ if ( index < 1 )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
+
+ final List<CDTValue> list = CDTLiteralFunctionUtils.getList(n1);
+
+ if ( index > list.size() )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
+
+ final CDTValue value = list.get( index-1 );
+ if ( value.isNull() ) {
+ throw new ExprEvalException("accessing null value from list" );
+ }
+ else if ( value.isNode() ) {
+ return NodeValue.makeNode( value.asNode() );
+ }
+ else {
+ throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
+ }
+ }
+
+ protected NodeValue getFromMap( final Node n1, final NodeValue nv2 ) {
+ final Node n2 = nv2.asNode();
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ throw new ExprEvalException("Not a valid map key: " + nv2);
+
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.getMap(n1);
+
+ if ( map.isEmpty() )
+ throw new ExprEvalException("empty map");
+
+ final CDTKey key = CDTFactory.createKey(n2);
+ final CDTValue value = map.get(key);
+
+ if ( value == null ) {
+ throw new ExprEvalException("key is not in the map");
+ }
+ else if ( value.isNull() ) {
+ throw new ExprEvalException("value for key is in null");
+ }
+ else if ( value.isNode() ) {
+ return NodeValue.makeNode( value.asNode() );
+ }
+ else {
+ throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
+ }
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
index 0eb1348f98..8789396d66 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/HeadFct.java
@@ -26,21 +26,21 @@ import org.apache.jena.sparql.expr.NodeValue;
public class HeadFct extends FunctionBase1List
{
- @Override
- protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
- if ( list.size() == 0 )
- throw new ExprEvalException("Empty list");
+ @Override
+ protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
+ if ( list.size() == 0 )
+ throw new ExprEvalException("Empty list");
- final CDTValue value = list.get(0);
- if ( value.isNull() ) {
- throw new ExprEvalException("accessing null value from list" );
- }
- else if ( value.isNode() ) {
- return NodeValue.makeNode( value.asNode() );
- }
- else {
- throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
- }
- }
+ final CDTValue value = list.get(0);
+ if ( value.isNull() ) {
+ throw new ExprEvalException("accessing null value from list" );
+ }
+ else if ( value.isNode() ) {
+ return NodeValue.makeNode( value.asNode() );
+ }
+ else {
+ throw new ExprEvalException("Unexpected type of CDTValue: " + value.getClass().getName() );
+ }
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
index 2c919eb934..589527a4f4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/KeysFct.java
@@ -30,17 +30,17 @@ import org.apache.jena.sparql.function.FunctionBase1;
public class KeysFct extends FunctionBase1
{
- @Override
- public NodeValue exec( final NodeValue nv ) {
- final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv);
+ @Override
+ public NodeValue exec( final NodeValue nv ) {
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv);
- final List<CDTValue> list = new ArrayList<>( map.size() );
- for ( final CDTKey key : map.keySet() ) {
- final CDTValue value = CDTFactory.createValue( key.asNode() );
- list.add(value);
- }
+ final List<CDTValue> list = new ArrayList<>( map.size() );
+ for ( final CDTKey key : map.keySet() ) {
+ final CDTValue value = CDTFactory.createValue( key.asNode() );
+ list.add(value);
+ }
- return CDTLiteralFunctionUtils.createNodeValue(list);
- }
+ return CDTLiteralFunctionUtils.createNodeValue(list);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java
index dc50559d9f..828178e2d9 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ListFct.java
@@ -33,33 +33,33 @@ import org.apache.jena.sparql.function.FunctionEnv;
public class ListFct extends FunctionBase
{
- @Override
- public void checkBuild( final String uri, final ExprList args ) {
- // nothing to do here
- }
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ // nothing to do here
+ }
- @Override
- public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
- final List<CDTValue> list = new ArrayList<>( args.size() );
+ @Override
+ public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
+ final List<CDTValue> list = new ArrayList<>( args.size() );
- for ( final Expr e : args ) {
- CDTValue v;
- try {
- final NodeValue nv = e.eval(binding, env);
- v = CDTFactory.createValue( nv.asNode() );
- } catch ( final ExprException ex ) {
- v = CDTFactory.getNullValue();
- }
+ for ( final Expr e : args ) {
+ CDTValue v;
+ try {
+ final NodeValue nv = e.eval(binding, env);
+ v = CDTFactory.createValue( nv.asNode() );
+ } catch ( final ExprException ex ) {
+ v = CDTFactory.getNullValue();
+ }
- list.add(v);
- }
+ list.add(v);
+ }
- return CDTLiteralFunctionUtils.createNodeValue(list);
- }
+ return CDTLiteralFunctionUtils.createNodeValue(list);
+ }
- @Override
- public NodeValue exec( final List<NodeValue> args ) {
- throw new IllegalStateException("should never end up here");
- }
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ throw new IllegalStateException("should never end up here");
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java
index fec5c22052..f92b00d504 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MapFct.java
@@ -39,64 +39,64 @@ import org.apache.jena.sparql.function.FunctionEnv;
public class MapFct extends FunctionBase
{
- @Override
- public void checkBuild( final String uri, final ExprList args ) {
- if ( args.size() % 2 == 1 )
- throw new QueryBuildException("Function '"+Lib.className(this)+"' takes an even number of arguments");
- }
-
- @Override
- public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
- if ( args.size() % 2 == 1 )
- throw new ExprException("Function '"+Lib.className(this)+"' takes an even number of arguments");
-
- final Map<CDTKey,CDTValue> map = new HashMap<>();
-
- final Iterator<Expr> it = args.iterator();
- while ( it.hasNext() ) {
- final Expr exprKey = it.next();
- final Expr exprValue = it.next();
-
- final CDTKey key = getKey(exprKey, binding, env);
- if ( key != null ) {
- final CDTValue value = getValue(exprValue, binding, env);
- map.put(key, value);
- }
- }
-
- return CDTLiteralFunctionUtils.createNodeValue(map);
- }
-
- protected CDTKey getKey( final Expr e, final Binding binding, final FunctionEnv env ) {
- final NodeValue nv;
- try {
- nv = e.eval(binding, env);
- } catch ( final ExprException ex ) {
- return null;
- }
-
- final Node n = nv.asNode();
- if ( ! n.isURI() && ! n.isLiteral() )
- return null;
-
- return CDTFactory.createKey(n);
- }
-
- protected CDTValue getValue( final Expr e, final Binding binding, final FunctionEnv env ) {
- final NodeValue nv;
- try {
- nv = e.eval(binding, env);
- } catch ( final ExprException ex ) {
- return CDTFactory.getNullValue();
- }
-
- return CDTFactory.createValue( nv.asNode() );
- }
-
-
- @Override
- public NodeValue exec( final List<NodeValue> args ) {
- throw new IllegalStateException("should never end up here");
- }
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ if ( args.size() % 2 == 1 )
+ throw new QueryBuildException("Function '"+Lib.className(this)+"' takes an even number of arguments");
+ }
+
+ @Override
+ public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
+ if ( args.size() % 2 == 1 )
+ throw new ExprException("Function '"+Lib.className(this)+"' takes an even number of arguments");
+
+ final Map<CDTKey,CDTValue> map = new HashMap<>();
+
+ final Iterator<Expr> it = args.iterator();
+ while ( it.hasNext() ) {
+ final Expr exprKey = it.next();
+ final Expr exprValue = it.next();
+
+ final CDTKey key = getKey(exprKey, binding, env);
+ if ( key != null ) {
+ final CDTValue value = getValue(exprValue, binding, env);
+ map.put(key, value);
+ }
+ }
+
+ return CDTLiteralFunctionUtils.createNodeValue(map);
+ }
+
+ protected CDTKey getKey( final Expr e, final Binding binding, final FunctionEnv env ) {
+ final NodeValue nv;
+ try {
+ nv = e.eval(binding, env);
+ } catch ( final ExprException ex ) {
+ return null;
+ }
+
+ final Node n = nv.asNode();
+ if ( ! n.isURI() && ! n.isLiteral() )
+ return null;
+
+ return CDTFactory.createKey(n);
+ }
+
+ protected CDTValue getValue( final Expr e, final Binding binding, final FunctionEnv env ) {
+ final NodeValue nv;
+ try {
+ nv = e.eval(binding, env);
+ } catch ( final ExprException ex ) {
+ return CDTFactory.getNullValue();
+ }
+
+ return CDTFactory.createValue( nv.asNode() );
+ }
+
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ throw new IllegalStateException("should never end up here");
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
index 344f3117fa..1acb45324d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/MergeFct.java
@@ -28,21 +28,21 @@ import org.apache.jena.sparql.function.FunctionBase2;
public class MergeFct extends FunctionBase2
{
- @Override
- public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
- final Map<CDTKey,CDTValue> map1 = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
- final Map<CDTKey,CDTValue> map2 = CDTLiteralFunctionUtils.checkAndGetMap(nv2);
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Map<CDTKey,CDTValue> map1 = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+ final Map<CDTKey,CDTValue> map2 = CDTLiteralFunctionUtils.checkAndGetMap(nv2);
- if ( map1.isEmpty() )
- return nv2;
+ if ( map1.isEmpty() )
+ return nv2;
- if ( map2.isEmpty() )
- return nv1;
+ if ( map2.isEmpty() )
+ return nv1;
- final Map<CDTKey,CDTValue> newMap = new HashMap<>(map2);
- newMap.putAll(map1);
+ final Map<CDTKey,CDTValue> newMap = new HashMap<>(map2);
+ newMap.putAll(map1);
- return CDTLiteralFunctionUtils.createNodeValue(newMap);
- }
+ return CDTLiteralFunctionUtils.createNodeValue(newMap);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java
index 428c000d5b..6e3ef14706 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/PutFct.java
@@ -38,75 +38,75 @@ import org.apache.jena.sparql.function.FunctionEnv;
public class PutFct extends FunctionBase
{
- @Override
- public void checkBuild( final String uri, final ExprList args ) {
- if ( args.size() < 2 || args.size() > 3 )
- throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two or three arguments");
- }
-
- @Override
- public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
- if ( args.size() < 2 || args.size() > 3 )
- throw new ExprException("wrong number of arguments (" + args.size() + "), must be 2 or 3");
-
- // check the second argument first because that's less expensive
- final NodeValue nv2 = args.get(1).eval(binding, env);
- final Node n2 = nv2.asNode();
- if ( ! n2.isURI() && ! n2.isLiteral() )
- throw new ExprEvalException("Not a valid map key: " + nv2);
-
- // now check the first argument
- final NodeValue nv1 = args.get(0).eval(binding, env);
- final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
-
- final CDTKey key = CDTFactory.createKey(n2);
-
- // produce a map value from the third argument (if any)
- final CDTValue newValue;
- if ( args.size() == 2 ) {
- newValue = CDTFactory.getNullValue();
- }
- else { // in this case, we have that args.size() == 3
- NodeValue nv3 = null;
- try {
- nv3 = args.get(2).eval(binding, env);
- }
- catch ( final ExprException ex ) {
- // nothing to do here
- }
-
- if ( nv3 != null ) {
- newValue = CDTFactory.createValue( nv3.asNode() );
- }
- else {
- newValue = CDTFactory.getNullValue();
- }
- }
-
- // check if the given map already contains the exact same map entry
- // if so, simply return the given cdt:Map literal
- final CDTValue oldValue = map.get(key);
- if ( oldValue != null ) {
- if ( oldValue.isNull() && newValue.isNull() )
- return nv1;
-
- if ( ! oldValue.isNull() && ! newValue.isNull() ) {
- final Node on = oldValue.asNode();
- final Node nn = newValue.asNode();
- if ( on.equals(nn) )
- return nv1;
- }
- }
-
- final Map<CDTKey,CDTValue> newMap = new HashMap<>(map);
- newMap.put(key, newValue);
-
- return CDTLiteralFunctionUtils.createNodeValue(newMap);
- }
-
- @Override
- public NodeValue exec( final List<NodeValue> args ) {
- throw new IllegalStateException("should never end up here");
- }
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ if ( args.size() < 2 || args.size() > 3 )
+ throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two or three arguments");
+ }
+
+ @Override
+ public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
+ if ( args.size() < 2 || args.size() > 3 )
+ throw new ExprException("wrong number of arguments (" + args.size() + "), must be 2 or 3");
+
+ // check the second argument first because that's less expensive
+ final NodeValue nv2 = args.get(1).eval(binding, env);
+ final Node n2 = nv2.asNode();
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ throw new ExprEvalException("Not a valid map key: " + nv2);
+
+ // now check the first argument
+ final NodeValue nv1 = args.get(0).eval(binding, env);
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+
+ final CDTKey key = CDTFactory.createKey(n2);
+
+ // produce a map value from the third argument (if any)
+ final CDTValue newValue;
+ if ( args.size() == 2 ) {
+ newValue = CDTFactory.getNullValue();
+ }
+ else { // in this case, we have that args.size() == 3
+ NodeValue nv3 = null;
+ try {
+ nv3 = args.get(2).eval(binding, env);
+ }
+ catch ( final ExprException ex ) {
+ // nothing to do here
+ }
+
+ if ( nv3 != null ) {
+ newValue = CDTFactory.createValue( nv3.asNode() );
+ }
+ else {
+ newValue = CDTFactory.getNullValue();
+ }
+ }
+
+ // check if the given map already contains the exact same map entry
+ // if so, simply return the given cdt:Map literal
+ final CDTValue oldValue = map.get(key);
+ if ( oldValue != null ) {
+ if ( oldValue.isNull() && newValue.isNull() )
+ return nv1;
+
+ if ( ! oldValue.isNull() && ! newValue.isNull() ) {
+ final Node on = oldValue.asNode();
+ final Node nn = newValue.asNode();
+ if ( on.equals(nn) )
+ return nv1;
+ }
+ }
+
+ final Map<CDTKey,CDTValue> newMap = new HashMap<>(map);
+ newMap.put(key, newValue);
+
+ return CDTLiteralFunctionUtils.createNodeValue(newMap);
+ }
+
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ throw new IllegalStateException("should never end up here");
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java
index b5df5a5a29..d165eaeeea 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/RemoveFct.java
@@ -30,29 +30,29 @@ import org.apache.jena.sparql.function.FunctionBase2;
public class RemoveFct extends FunctionBase2
{
- @Override
- public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
- final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
+ @Override
+ public NodeValue exec( final NodeValue nv1, final NodeValue nv2 ) {
+ final Map<CDTKey,CDTValue> map = CDTLiteralFunctionUtils.checkAndGetMap(nv1);
- if ( map.isEmpty() )
- return nv1;
+ if ( map.isEmpty() )
+ return nv1;
- final Node n2 = nv2.asNode();
+ final Node n2 = nv2.asNode();
- // If the second term is not a map key (and the first term is a well-
- // formed cdt:Map literal), the first term needs to be returned as is.
- if ( ! n2.isURI() && ! n2.isLiteral() )
- return nv1;
+ // If the second term is not a map key (and the first term is a well-
+ // formed cdt:Map literal), the first term needs to be returned as is.
+ if ( ! n2.isURI() && ! n2.isLiteral() )
+ return nv1;
- final CDTKey key = CDTFactory.createKey(n2);
+ final CDTKey key = CDTFactory.createKey(n2);
- if ( ! map.containsKey(key) )
- return nv1;
+ if ( ! map.containsKey(key) )
+ return nv1;
- final Map<CDTKey,CDTValue> newMap = new HashMap<>(map);
- newMap.remove(key);
+ final Map<CDTKey,CDTValue> newMap = new HashMap<>(map);
+ newMap.remove(key);
- return CDTLiteralFunctionUtils.createNodeValue(newMap);
- }
+ return CDTLiteralFunctionUtils.createNodeValue(newMap);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java
index 9b918036c7..bc7fe6a611 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/ReverseFct.java
@@ -26,20 +26,20 @@ import org.apache.jena.sparql.expr.NodeValue;
public class ReverseFct extends FunctionBase1List
{
- @Override
- protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
- if ( list.size() < 2 )
- return nvList;
+ @Override
+ protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
+ if ( list.size() < 2 )
+ return nvList;
- final CDTValue[] reverseArray = new CDTValue[ list.size() ];
- int i = list.size() - 1;
- for ( final CDTValue v : list ) {
- reverseArray[i] = v;
- i--;
- }
+ final CDTValue[] reverseArray = new CDTValue[ list.size() ];
+ int i = list.size() - 1;
+ for ( final CDTValue v : list ) {
+ reverseArray[i] = v;
+ i--;
+ }
- final List<CDTValue> reverseList = Arrays.asList(reverseArray);
- return CDTLiteralFunctionUtils.createNodeValue(reverseList);
- }
+ final List<CDTValue> reverseList = Arrays.asList(reverseArray);
+ return CDTLiteralFunctionUtils.createNodeValue(reverseList);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java
index e0bb791c07..f258007bda 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SizeFct.java
@@ -27,22 +27,22 @@ import org.apache.jena.sparql.function.FunctionBase1;
public class SizeFct extends FunctionBase1
{
- @Override
- public NodeValue exec( final NodeValue nv ) {
- final Node n = nv.asNode();
+ @Override
+ public NodeValue exec( final NodeValue nv ) {
+ final Node n = nv.asNode();
- final int size;
- if ( CompositeDatatypeList.isListLiteral(n) ) {
- size = CDTLiteralFunctionUtils.getList(n).size();
- }
- else if ( CompositeDatatypeMap.isMapLiteral(n) ) {
- size = CDTLiteralFunctionUtils.getMap(n).size();
- }
- else {
- throw new ExprEvalException("Neither a list nor a map literal: " + nv);
- }
+ final int size;
+ if ( CompositeDatatypeList.isListLiteral(n) ) {
+ size = CDTLiteralFunctionUtils.getList(n).size();
+ }
+ else if ( CompositeDatatypeMap.isMapLiteral(n) ) {
+ size = CDTLiteralFunctionUtils.getMap(n).size();
+ }
+ else {
+ throw new ExprEvalException("Neither a list nor a map literal: " + nv);
+ }
- return NodeValue.makeInteger(size);
- }
+ return NodeValue.makeInteger(size);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java
index e508185c7d..0aed90a3f9 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/SubSeqFct.java
@@ -32,70 +32,70 @@ import org.apache.jena.sparql.function.FunctionBase;
public class SubSeqFct extends FunctionBase
{
- @Override
- public void checkBuild( final String uri, final ExprList args ) {
- if ( args.size() < 2 || args.size() > 3 )
- throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two or three arguments");
- }
+ @Override
+ public void checkBuild( final String uri, final ExprList args ) {
+ if ( args.size() < 2 || args.size() > 3 )
+ throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two or three arguments");
+ }
- @Override
- public NodeValue exec( final List<NodeValue> args ) {
- final NodeValue nv1 = args.get(0);
- final Node n1 = nv1.asNode();
+ @Override
+ public NodeValue exec( final List<NodeValue> args ) {
+ final NodeValue nv1 = args.get(0);
+ final Node n1 = nv1.asNode();
- CDTLiteralFunctionUtils.ensureListLiteral(n1);
+ CDTLiteralFunctionUtils.ensureListLiteral(n1);
- final NodeValue nv2 = args.get(1);
+ final NodeValue nv2 = args.get(1);
- if ( ! nv2.isInteger() )
- throw new ExprEvalException("Not an integer literal: " + nv2);
+ if ( ! nv2.isInteger() )
+ throw new ExprEvalException("Not an integer literal: " + nv2);
- final int index = nv2.getInteger().intValue();
+ final int index = nv2.getInteger().intValue();
- if ( index < 1 )
- throw new ExprEvalException("Out of bounds index value: " + nv2);
+ if ( index < 1 )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
- final int length;
- final List<CDTValue> list;
- if ( args.size() == 3 ) {
- final NodeValue nv3 = args.get(2);
+ final int length;
+ final List<CDTValue> list;
+ if ( args.size() == 3 ) {
+ final NodeValue nv3 = args.get(2);
- if ( ! nv3.isInteger() )
- throw new ExprEvalException("Not an integer literal: " + nv3);
+ if ( ! nv3.isInteger() )
+ throw new ExprEvalException("Not an integer literal: " + nv3);
- length = nv3.getInteger().intValue();
+ length = nv3.getInteger().intValue();
- if ( length < 0 )
- throw new ExprEvalException("Illegal length value: " + nv3);
+ if ( length < 0 )
+ throw new ExprEvalException("Illegal length value: " + nv3);
- list = CDTLiteralFunctionUtils.getList(n1);
- }
- else {
- list = CDTLiteralFunctionUtils.getList(n1);
- length = list.size() - index + 1;
- }
+ list = CDTLiteralFunctionUtils.getList(n1);
+ }
+ else {
+ list = CDTLiteralFunctionUtils.getList(n1);
+ length = list.size() - index + 1;
+ }
- if ( index > list.size() + 1 )
- throw new ExprEvalException("Out of bounds index value: " + nv2);
+ if ( index > list.size() + 1 )
+ throw new ExprEvalException("Out of bounds index value: " + nv2);
- if ( index + length > list.size() + 1 )
- throw new ExprEvalException("Beyond list length (index: " + index + ", length: " + length + ")");
+ if ( index + length > list.size() + 1 )
+ throw new ExprEvalException("Beyond list length (index: " + index + ", length: " + length + ")");
- final List<CDTValue> sublist;
- if ( index == list.size() + 1 ) {
- if ( length != 0 )
- throw new ExprEvalException("Illegal arguments (index: " + index + ", length: " + length + ")");
+ final List<CDTValue> sublist;
+ if ( index == list.size() + 1 ) {
+ if ( length != 0 )
+ throw new ExprEvalException("Illegal arguments (index: " + index + ", length: " + length + ")");
- if ( list.isEmpty() )
- return nv1;
+ if ( list.isEmpty() )
+ return nv1;
- sublist = Collections.emptyList();
- }
- else {
- sublist = list.subList( index - 1, index - 1 + length );
- }
+ sublist = Collections.emptyList();
+ }
+ else {
+ sublist = list.subList( index - 1, index - 1 + length );
+ }
- return CDTLiteralFunctionUtils.createNodeValue(sublist);
- }
+ return CDTLiteralFunctionUtils.createNodeValue(sublist);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java
index aee058e658..f0d8a71b8d 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/function/library/cdt/TailFct.java
@@ -26,13 +26,13 @@ import org.apache.jena.sparql.expr.NodeValue;
public class TailFct extends FunctionBase1List
{
- @Override
- protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
- if ( list.size() == 0 )
- throw new ExprEvalException("Empty list");
+ @Override
+ protected NodeValue _exec( final List<CDTValue> list, final NodeValue nvList ) {
+ if ( list.size() == 0 )
+ throw new ExprEvalException("Empty list");
- final List<CDTValue> sublist = list.subList( 1, list.size() );
- return CDTLiteralFunctionUtils.createNodeValue(sublist);
- }
+ final List<CDTValue> sublist = list.subList( 1, list.size() );
+ return CDTLiteralFunctionUtils.createNodeValue(sublist);
+ }
}
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
index 9d1009042c..dec80e38c2 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/lang/arq/ARQParser.java
@@ -1,3 +1,4 @@
+/* ARQParser.java */
/* Generated By:JavaCC: Do not edit this line. ARQParser.java */
package org.apache.jena.sparql.lang.arq ;
import org.apache.jena.graph.* ;
@@ -19,108 +20,116 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
final public void QueryUnit() throws ParseException {
ByteOrderMark();
- startQuery() ;
+startQuery() ;
Query();
jj_consume_token(0);
- finishQuery() ;
- }
+finishQuery() ;
+}
final public void Query() throws ParseException {
Prologue();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SELECT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SELECT:{
SelectQuery();
break;
- case CONSTRUCT:
+ }
+ case CONSTRUCT:{
ConstructQuery();
break;
- case DESCRIBE:
+ }
+ case DESCRIBE:{
DescribeQuery();
break;
- case ASK:
+ }
+ case ASK:{
AskQuery();
break;
- case JSON:
+ }
+ case JSON:{
JsonQuery();
break;
+ }
default:
jj_la1[0] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
ValuesClause();
- }
+}
final public void UpdateUnit() throws ParseException {
ByteOrderMark();
- startUpdateRequest() ;
+startUpdateRequest() ;
Update();
jj_consume_token(0);
- finishUpdateRequest() ;
- }
+finishUpdateRequest() ;
+}
final public void ByteOrderMark() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BOM:{
jj_consume_token(BOM);
break;
+ }
default:
jj_la1[1] = jj_gen;
;
}
- }
+}
final public void Prologue() throws ParseException {
label_1:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case BASE:
- case PREFIX:
+ case PREFIX:{
;
break;
+ }
default:
jj_la1[2] = jj_gen;
break label_1;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BASE:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BASE:{
BaseDecl();
break;
- case PREFIX:
+ }
+ case PREFIX:{
PrefixDecl();
break;
+ }
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
- }
+}
- final public void BaseDecl() throws ParseException {
- Token t ; String iri ;
+ final public void BaseDecl() throws ParseException {Token t ; String iri ;
t = jj_consume_token(BASE);
iri = IRIREF();
- setBase(iri, t.beginLine, t.beginColumn ) ;
- }
+setBase(iri, t.beginLine, t.beginColumn ) ;
+}
- final public void PrefixDecl() throws ParseException {
- Token t ; String iri ;
+ final public void PrefixDecl() throws ParseException {Token t ; String iri ;
jj_consume_token(PREFIX);
t = jj_consume_token(PNAME_NS);
iri = IRIREF();
- String s = fixupPrefix(t.image, t.beginLine, t.beginColumn);
+String s = fixupPrefix(t.image, t.beginLine, t.beginColumn);
setPrefix(s, iri, t.beginLine, t.beginColumn) ;
- }
+}
final public void SelectQuery() throws ParseException {
SelectClause();
label_2:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FROM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case FROM:{
;
break;
+ }
default:
jj_la1[4] = jj_gen;
break label_2;
@@ -129,43 +138,45 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
WhereClause();
SolutionModifier();
- }
+}
final public void SubSelect() throws ParseException {
SelectClause();
WhereClause();
SolutionModifier();
ValuesClause();
- }
+}
- final public void SelectClause() throws ParseException {
- Var v ; Expr expr ; Node n ;
+ final public void SelectClause() throws ParseException {Var v ; Expr expr ; Node n ;
jj_consume_token(SELECT);
- getQuery().setQuerySelectType() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+getQuery().setQuerySelectType() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case DISTINCT:
- case REDUCED:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DISTINCT:
+ case REDUCED:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DISTINCT:{
jj_consume_token(DISTINCT);
- getQuery().setDistinct(true);
+getQuery().setDistinct(true);
break;
- case REDUCED:
+ }
+ case REDUCED:{
jj_consume_token(REDUCED);
- getQuery().setReduced(true);
+getQuery().setReduced(true);
break;
+ }
default:
jj_la1[5] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[6] = jj_gen;
;
}
- setAllowAggregatesInExpressions(true) ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+setAllowAggregatesInExpressions(true) ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -267,15 +278,16 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case LPAREN:
+ case LPAREN:{
label_3:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
v = Var();
- getQuery().addResultVar(v) ;
+getQuery().addResultVar(v) ;
break;
+ }
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -374,25 +386,27 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
if (jj_2_1(2)) {
expr = BuiltInCall();
- getQuery().addResultVar((Var)null, expr) ;
+getQuery().addResultVar((Var)null, expr) ;
} else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
expr = FunctionCall();
- getQuery().addResultVar((Var)null, expr) ;
+getQuery().addResultVar((Var)null, expr) ;
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
+getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -401,15 +415,17 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteral();
- getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
+getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
+getQuery().addResultVar((Var)null, NodeValue.makeNode(n)) ;
break;
+ }
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
@@ -417,29 +433,32 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
}
break;
- case LPAREN:
- v = null ;
+ }
+ case LPAREN:{
+v = null ;
jj_consume_token(LPAREN);
expr = Expression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case AS:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case AS:{
jj_consume_token(AS);
v = Var();
break;
+ }
default:
jj_la1[8] = jj_gen;
;
}
jj_consume_token(RPAREN);
- getQuery().addResultVar(v, expr) ;
- getQuery().setQueryResultStar(false) ;
+getQuery().addResultVar(v, expr) ;
+getQuery().setQueryResultStar(false) ;
break;
+ }
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -541,42 +560,45 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case LPAREN:
+ case LPAREN:{
;
break;
+ }
default:
jj_la1[10] = jj_gen;
break label_3;
}
}
break;
- case STAR:
+ }
+ case STAR:{
jj_consume_token(STAR);
- getQuery().setQueryResultStar(true) ;
+getQuery().setQueryResultStar(true) ;
break;
+ }
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- setAllowAggregatesInExpressions(false) ;
- }
+setAllowAggregatesInExpressions(false) ;
+}
- final public void ConstructQuery() throws ParseException {
- Template t ;
+ final public void ConstructQuery() throws ParseException {Template t ;
QuadAcc acc = new QuadAcc() ;
jj_consume_token(CONSTRUCT);
- getQuery().setQueryConstructType() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
+getQuery().setQueryConstructType() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LBRACE:{
t = ConstructTemplate();
- getQuery().setConstructTemplate(t) ;
+getQuery().setConstructTemplate(t) ;
label_4:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FROM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case FROM:{
;
break;
+ }
default:
jj_la1[12] = jj_gen;
break label_4;
@@ -586,14 +608,16 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
WhereClause();
SolutionModifier();
break;
+ }
case FROM:
- case WHERE:
+ case WHERE:{
label_5:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FROM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case FROM:{
;
break;
+ }
default:
jj_la1[13] = jj_gen;
break label_5;
@@ -605,51 +629,54 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
ConstructQuads(acc);
jj_consume_token(RBRACE);
SolutionModifier();
- t = new Template(acc) ;
+t = new Template(acc) ;
getQuery().setConstructTemplate(t) ;
ElementGroup elg = createQueryPattern(t);
getQuery().setQueryPattern(elg) ;
break;
+ }
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
- final public void DescribeQuery() throws ParseException {
- Node n ;
+ final public void DescribeQuery() throws ParseException {Node n ;
jj_consume_token(DESCRIBE);
- getQuery().setQueryDescribeType() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+getQuery().setQueryDescribeType() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
- case VAR2:
+ case VAR2:{
label_6:
while (true) {
n = VarOrIri();
- getQuery().addDescribeNode(n) ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+getQuery().addDescribeNode(n) ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
- case VAR2:
+ case VAR2:{
;
break;
+ }
default:
jj_la1[15] = jj_gen;
break label_6;
}
}
- getQuery().setQueryResultStar(false) ;
+getQuery().setQueryResultStar(false) ;
break;
- case STAR:
+ }
+ case STAR:{
jj_consume_token(STAR);
- getQuery().setQueryResultStar(true) ;
+getQuery().setQueryResultStar(true) ;
break;
+ }
default:
jj_la1[16] = jj_gen;
jj_consume_token(-1);
@@ -657,37 +684,40 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
label_7:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FROM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case FROM:{
;
break;
+ }
default:
jj_la1[17] = jj_gen;
break label_7;
}
DatasetClause();
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case WHERE:
- case LBRACE:
+ case LBRACE:{
WhereClause();
break;
+ }
default:
jj_la1[18] = jj_gen;
;
}
SolutionModifier();
- }
+}
final public void AskQuery() throws ParseException {
jj_consume_token(ASK);
- getQuery().setQueryAskType() ;
+getQuery().setQueryAskType() ;
label_8:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FROM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case FROM:{
;
break;
+ }
default:
jj_la1[19] = jj_gen;
break label_8;
@@ -696,16 +726,17 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
WhereClause();
SolutionModifier();
- }
+}
final public void JsonQuery() throws ParseException {
JsonClause();
label_9:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FROM:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case FROM:{
;
break;
+ }
default:
jj_la1[20] = jj_gen;
break label_9;
@@ -714,19 +745,20 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
WhereClause();
SolutionModifier();
- }
+}
final public void JsonClause() throws ParseException {
jj_consume_token(JSON);
- getQuery().setQueryJsonType() ;
+getQuery().setQueryJsonType() ;
jj_consume_token(LBRACE);
JsonObjectMember();
label_10:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[21] = jj_gen;
break label_10;
@@ -735,27 +767,28 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
JsonObjectMember();
}
jj_consume_token(RBRACE);
- }
+}
- final public void JsonObjectMember() throws ParseException {
- Node o ; String s ; Token t;
+ final public void JsonObjectMember() throws ParseException {Node o ; String s ; Token t;
s = String();
t = jj_consume_token(PNAME_NS);
- if ( ! t.image.equals(":") )
+if ( ! t.image.equals(":") )
throwParseException("Prefix name expression not legal at this point : "+t.image, t.beginLine, t.beginColumn) ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
o = Var();
- getQuery().addResultVar((Var)o) ; getQuery().addJsonMapping(s, o) ;
+getQuery().addResultVar((Var)o) ; getQuery().addJsonMapping(s, o) ;
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
o = RDFLiteral();
- getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
+getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -764,111 +797,116 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
o = NumericLiteral();
- getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
+getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
o = BooleanLiteral();
- getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
+getQuery().addResultVar(s, NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ;
break;
+ }
default:
jj_la1[22] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
final public void DatasetClause() throws ParseException {
jj_consume_token(FROM);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
DefaultGraphClause();
break;
- case NAMED:
+ }
+ case NAMED:{
NamedGraphClause();
break;
+ }
default:
jj_la1[23] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
- final public void DefaultGraphClause() throws ParseException {
- String iri ;
+ final public void DefaultGraphClause() throws ParseException {String iri ;
iri = SourceSelector();
- getQuery().addGraphURI(iri) ;
- }
+getQuery().addGraphURI(iri) ;
+}
- final public void NamedGraphClause() throws ParseException {
- String iri ;
+ final public void NamedGraphClause() throws ParseException {String iri ;
jj_consume_token(NAMED);
iri = SourceSelector();
- getQuery().addNamedGraphURI(iri) ;
- }
+getQuery().addNamedGraphURI(iri) ;
+}
- final public String SourceSelector() throws ParseException {
- String iri ;
+ final public String SourceSelector() throws ParseException {String iri ;
iri = iri();
- {if (true) return iri ;}
+{if ("" != null) return iri ;}
throw new Error("Missing return statement in function");
- }
+}
- final public void WhereClause() throws ParseException {
- Element el ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case WHERE:
+ final public void WhereClause() throws ParseException {Element el ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case WHERE:{
jj_consume_token(WHERE);
break;
+ }
default:
jj_la1[24] = jj_gen;
;
}
- startWherePattern() ;
+startWherePattern() ;
el = GroupGraphPattern();
- getQuery().setQueryPattern(el) ;
- finishWherePattern() ;
- }
+getQuery().setQueryPattern(el) ;
+finishWherePattern() ;
+}
final public void SolutionModifier() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case GROUP:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case GROUP:{
GroupClause();
break;
+ }
default:
jj_la1[25] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case HAVING:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case HAVING:{
HavingClause();
break;
+ }
default:
jj_la1[26] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ORDER:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case ORDER:{
OrderClause();
break;
+ }
default:
jj_la1[27] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LIMIT:
- case OFFSET:
+ case OFFSET:{
LimitOffsetClauses();
break;
+ }
default:
jj_la1[28] = jj_gen;
;
}
- }
+}
final public void GroupClause() throws ParseException {
jj_consume_token(GROUP);
@@ -876,7 +914,7 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
label_11:
while (true) {
GroupCondition();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -963,19 +1001,19 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
+ case LPAREN:{
;
break;
+ }
default:
jj_la1[29] = jj_gen;
break label_11;
}
}
- }
+}
- final public void GroupCondition() throws ParseException {
- Var v = null ; Expr expr = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public void GroupCondition() throws ParseException {Var v = null ; Expr expr = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case TRIPLE:
case IS_TRIPLE:
case SUBJECT:
@@ -1056,50 +1094,55 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA1:
case SHA256:
case SHA384:
- case SHA512:
+ case SHA512:{
expr = BuiltInCall();
- getQuery().addGroupBy((Var)null, expr) ;
+getQuery().addGroupBy((Var)null, expr) ;
break;
+ }
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
expr = FunctionCall();
- getQuery().addGroupBy((Var)null, expr) ;
+getQuery().addGroupBy((Var)null, expr) ;
break;
- case LPAREN:
+ }
+ case LPAREN:{
jj_consume_token(LPAREN);
expr = Expression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case AS:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case AS:{
jj_consume_token(AS);
v = Var();
break;
+ }
default:
jj_la1[30] = jj_gen;
;
}
jj_consume_token(RPAREN);
- getQuery().addGroupBy(v ,expr) ;
+getQuery().addGroupBy(v ,expr) ;
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
v = Var();
- getQuery().addGroupBy(v) ;
+getQuery().addGroupBy(v) ;
break;
+ }
default:
jj_la1[31] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
final public void HavingClause() throws ParseException {
- setAllowAggregatesInExpressions(true) ;
+setAllowAggregatesInExpressions(true) ;
jj_consume_token(HAVING);
label_12:
while (true) {
HavingCondition();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1184,31 +1227,31 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
+ case LPAREN:{
;
break;
+ }
default:
jj_la1[32] = jj_gen;
break label_12;
}
}
- setAllowAggregatesInExpressions(false) ;
- }
+setAllowAggregatesInExpressions(false) ;
+}
- final public void HavingCondition() throws ParseException {
- Expr c ;
+ final public void HavingCondition() throws ParseException {Expr c ;
c = Constraint();
- getQuery().addHavingCondition(c) ;
- }
+getQuery().addHavingCondition(c) ;
+}
final public void OrderClause() throws ParseException {
- setAllowAggregatesInExpressions(true) ;
+setAllowAggregatesInExpressions(true) ;
jj_consume_token(ORDER);
jj_consume_token(BY);
label_13:
while (true) {
OrderCondition();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1297,32 +1340,34 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
+ case LPAREN:{
;
break;
+ }
default:
jj_la1[33] = jj_gen;
break label_13;
}
}
- setAllowAggregatesInExpressions(false) ;
- }
+setAllowAggregatesInExpressions(false) ;
+}
- final public void OrderCondition() throws ParseException {
- int direction = 0 ; Expr expr = null ; Node v = null ;
- direction = Query.ORDER_DEFAULT ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public void OrderCondition() throws ParseException {int direction = 0 ; Expr expr = null ; Node v = null ;
+direction = Query.ORDER_DEFAULT ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case ASC:
- case DESC:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASC:
+ case DESC:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case ASC:{
jj_consume_token(ASC);
- direction = Query.ORDER_ASCENDING ;
+direction = Query.ORDER_ASCENDING ;
break;
- case DESC:
+ }
+ case DESC:{
jj_consume_token(DESC);
- direction = Query.ORDER_DESCENDING ;
+direction = Query.ORDER_DESCENDING ;
break;
+ }
default:
jj_la1[34] = jj_gen;
jj_consume_token(-1);
@@ -1330,6 +1375,7 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
expr = BrackettedExpression();
break;
+ }
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1416,8 +1462,8 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case LPAREN:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1502,45 +1548,49 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
+ case LPAREN:{
expr = Constraint();
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
v = Var();
break;
+ }
default:
jj_la1[35] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[36] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- if ( v == null )
+if ( v == null )
getQuery().addOrderBy(expr, direction) ;
else
getQuery().addOrderBy(v, direction) ;
- }
+}
- final public SortCondition OrderConditionForAggregationFunction() throws ParseException {
- int direction = 0 ; Expr expr = null ; Node v = null ;
- direction = Query.ORDER_DEFAULT ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public SortCondition OrderConditionForAggregationFunction() throws ParseException {int direction = 0 ; Expr expr = null ; Node v = null ;
+direction = Query.ORDER_DEFAULT ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case ASC:
- case DESC:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASC:
+ case DESC:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case ASC:{
jj_consume_token(ASC);
- direction = Query.ORDER_ASCENDING ;
+direction = Query.ORDER_ASCENDING ;
break;
- case DESC:
+ }
+ case DESC:{
jj_consume_token(DESC);
- direction = Query.ORDER_DESCENDING ;
+direction = Query.ORDER_DESCENDING ;
break;
+ }
default:
jj_la1[37] = jj_gen;
jj_consume_token(-1);
@@ -1548,6 +1598,7 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
expr = BrackettedExpression();
break;
+ }
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1634,8 +1685,8 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case LPAREN:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -1720,94 +1771,99 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA256:
case SHA384:
case SHA512:
- case LPAREN:
+ case LPAREN:{
expr = Constraint();
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
v = Var();
break;
+ }
default:
jj_la1[38] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[39] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- if ( v == null )
- {if (true) return new SortCondition(expr, direction) ;}
+if ( v == null )
+ {if ("" != null) return new SortCondition(expr, direction) ;}
else
- {if (true) return new SortCondition(v, direction) ;}
+ {if ("" != null) return new SortCondition(v, direction) ;}
throw new Error("Missing return statement in function");
- }
+}
final public void LimitOffsetClauses() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LIMIT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LIMIT:{
LimitClause();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case OFFSET:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case OFFSET:{
OffsetClause();
break;
+ }
default:
jj_la1[40] = jj_gen;
;
}
break;
- case OFFSET:
+ }
+ case OFFSET:{
OffsetClause();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LIMIT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LIMIT:{
LimitClause();
break;
+ }
default:
jj_la1[41] = jj_gen;
;
}
break;
+ }
default:
jj_la1[42] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
- final public void LimitClause() throws ParseException {
- Token t ;
+ final public void LimitClause() throws ParseException {Token t ;
jj_consume_token(LIMIT);
t = jj_consume_token(INTEGER);
- getQuery().setLimit(integerValue(t.image)) ;
- }
+getQuery().setLimit(integerValue(t.image)) ;
+}
- final public void OffsetClause() throws ParseException {
- Token t ;
+ final public void OffsetClause() throws ParseException {Token t ;
jj_consume_token(OFFSET);
t = jj_consume_token(INTEGER);
- getQuery().setOffset(integerValue(t.image)) ;
- }
+getQuery().setOffset(integerValue(t.image)) ;
+}
- final public void ValuesClause() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VALUES:
+ final public void ValuesClause() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VALUES:{
t = jj_consume_token(VALUES);
- startValuesClause(t.beginLine, t.beginColumn) ;
+startValuesClause(t.beginLine, t.beginColumn) ;
DataBlock();
- finishValuesClause(t.beginLine, t.beginColumn) ;
+finishValuesClause(t.beginLine, t.beginColumn) ;
break;
+ }
default:
jj_la1[43] = jj_gen;
;
}
- }
+}
final public void Update() throws ParseException {
Prologue();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case INSERT:
case DELETE:
case INSERT_DATA:
@@ -1820,7 +1876,7 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case MOVE:
case COPY:
case DROP:
- case WITH:
+ case WITH:{
Update1();
label_14:
while (true) {
@@ -1833,155 +1889,168 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
Prologue();
Update1();
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SEMICOLON:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SEMICOLON:{
jj_consume_token(SEMICOLON);
Prologue();
break;
+ }
default:
jj_la1[44] = jj_gen;
;
}
break;
+ }
default:
jj_la1[45] = jj_gen;
;
}
- }
+}
- final public void Update1() throws ParseException {
- Update up = null ;
- startUpdateOperation() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LOAD:
+ final public void Update1() throws ParseException {Update up = null ;
+startUpdateOperation() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LOAD:{
up = Load();
break;
- case CLEAR:
+ }
+ case CLEAR:{
up = Clear();
break;
- case DROP:
+ }
+ case DROP:{
up = Drop();
break;
- case ADD:
+ }
+ case ADD:{
up = Add();
break;
- case MOVE:
+ }
+ case MOVE:{
up = Move();
break;
- case COPY:
+ }
+ case COPY:{
up = Copy();
break;
- case CREATE:
+ }
+ case CREATE:{
up = Create();
break;
- case DELETE_WHERE:
+ }
+ case DELETE_WHERE:{
up = DeleteWhere();
break;
+ }
case INSERT:
case DELETE:
- case WITH:
+ case WITH:{
up = Modify();
break;
- case INSERT_DATA:
+ }
+ case INSERT_DATA:{
InsertData();
break;
- case DELETE_DATA:
+ }
+ case DELETE_DATA:{
DeleteData();
break;
+ }
default:
jj_la1[46] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- if (null != up) emitUpdate(up) ;
+if (null != up) emitUpdate(up) ;
finishUpdateOperation() ;
- }
+}
- final public Update Load() throws ParseException {
- String url ; Node dest = null ; boolean silent = false ;
+ final public Update Load() throws ParseException {String url ; Node dest = null ; boolean silent = false ;
jj_consume_token(LOAD);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent = true ;
+silent = true ;
break;
+ }
default:
jj_la1[47] = jj_gen;
;
}
url = iri();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INTO:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case INTO:{
jj_consume_token(INTO);
dest = GraphRef();
break;
+ }
default:
jj_la1[48] = jj_gen;
;
}
- {if (true) return new UpdateLoad(url, dest, silent) ;}
+{if ("" != null) return new UpdateLoad(url, dest, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Clear() throws ParseException {
- boolean silent = false ; Target target ;
+ final public Update Clear() throws ParseException {boolean silent = false ; Target target ;
jj_consume_token(CLEAR);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent = true ;
+silent = true ;
break;
+ }
default:
jj_la1[49] = jj_gen;
;
}
target = GraphRefAll();
- {if (true) return new UpdateClear(target, silent) ;}
+{if ("" != null) return new UpdateClear(target, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Drop() throws ParseException {
- boolean silent = false ; Target target ;
+ final public Update Drop() throws ParseException {boolean silent = false ; Target target ;
jj_consume_token(DROP);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent = true ;
+silent = true ;
break;
+ }
default:
jj_la1[50] = jj_gen;
;
}
target = GraphRefAll();
- {if (true) return new UpdateDrop(target, silent) ;}
+{if ("" != null) return new UpdateDrop(target, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Create() throws ParseException {
- Node iri ; boolean silent = false ;
+ final public Update Create() throws ParseException {Node iri ; boolean silent = false ;
jj_consume_token(CREATE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent=true ;
+silent=true ;
break;
+ }
default:
jj_la1[51] = jj_gen;
;
}
iri = GraphRef();
- {if (true) return new UpdateCreate(iri, silent) ;}
+{if ("" != null) return new UpdateCreate(iri, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Add() throws ParseException {
- Target src ; Target dest ; boolean silent = false ;
+ final public Update Add() throws ParseException {Target src ; Target dest ; boolean silent = false ;
jj_consume_token(ADD);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent=true ;
+silent=true ;
break;
+ }
default:
jj_la1[52] = jj_gen;
;
@@ -1989,18 +2058,18 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
src = GraphOrDefault();
jj_consume_token(TO);
dest = GraphOrDefault();
- {if (true) return new UpdateAdd(src, dest, silent) ;}
+{if ("" != null) return new UpdateAdd(src, dest, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Move() throws ParseException {
- Target src ; Target dest ; boolean silent = false ;
+ final public Update Move() throws ParseException {Target src ; Target dest ; boolean silent = false ;
jj_consume_token(MOVE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent=true ;
+silent=true ;
break;
+ }
default:
jj_la1[53] = jj_gen;
;
@@ -2008,18 +2077,18 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
src = GraphOrDefault();
jj_consume_token(TO);
dest = GraphOrDefault();
- {if (true) return new UpdateMove(src, dest, silent) ;}
+{if ("" != null) return new UpdateMove(src, dest, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Copy() throws ParseException {
- Target src ; Target dest ; boolean silent = false ;
+ final public Update Copy() throws ParseException {Target src ; Target dest ; boolean silent = false ;
jj_consume_token(COPY);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent=true ;
+silent=true ;
break;
+ }
default:
jj_la1[54] = jj_gen;
;
@@ -2027,70 +2096,70 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
src = GraphOrDefault();
jj_consume_token(TO);
dest = GraphOrDefault();
- {if (true) return new UpdateCopy(src, dest, silent) ;}
+{if ("" != null) return new UpdateCopy(src, dest, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public void InsertData() throws ParseException {
- QuadDataAccSink qd = createInsertDataSink() ; Token t ;
+ final public void InsertData() throws ParseException {QuadDataAccSink qd = createInsertDataSink() ; Token t ;
t = jj_consume_token(INSERT_DATA);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- startDataInsert(qd, beginLine, beginColumn) ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+startDataInsert(qd, beginLine, beginColumn) ;
QuadData(qd);
- finishDataInsert(qd, beginLine, beginColumn) ;
+finishDataInsert(qd, beginLine, beginColumn) ;
qd.close() ;
- }
+}
- final public void DeleteData() throws ParseException {
- QuadDataAccSink qd = createDeleteDataSink() ; Token t ;
+ final public void DeleteData() throws ParseException {QuadDataAccSink qd = createDeleteDataSink() ; Token t ;
t = jj_consume_token(DELETE_DATA);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- startDataDelete(qd, beginLine, beginColumn) ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+startDataDelete(qd, beginLine, beginColumn) ;
QuadData(qd);
- finishDataDelete(qd, beginLine, beginColumn) ;
+finishDataDelete(qd, beginLine, beginColumn) ;
qd.close() ;
- }
+}
- final public Update DeleteWhere() throws ParseException {
- QuadAcc qp = new QuadAcc() ; Token t ;
+ final public Update DeleteWhere() throws ParseException {QuadAcc qp = new QuadAcc() ; Token t ;
t = jj_consume_token(DELETE_WHERE);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- startDeleteTemplate(qp, beginLine, beginColumn) ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+startDeleteTemplate(qp, beginLine, beginColumn) ;
QuadPattern(qp);
- finishDeleteTemplate(qp, beginLine, beginColumn) ;
- {if (true) return new UpdateDeleteWhere(qp) ;}
+finishDeleteTemplate(qp, beginLine, beginColumn) ;
+{if ("" != null) return new UpdateDeleteWhere(qp) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Update Modify() throws ParseException {
- Element el ; String iri = null ;
+ final public Update Modify() throws ParseException {Element el ; String iri = null ;
UpdateModify up = new UpdateModify() ;
- startModifyUpdate() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case WITH:
+startModifyUpdate() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case WITH:{
jj_consume_token(WITH);
iri = iri();
- Node n = createNode(iri) ; up.setWithIRI(n) ;
+Node n = createNode(iri) ; up.setWithIRI(n) ;
break;
+ }
default:
jj_la1[55] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DELETE:{
DeleteClause(up);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INSERT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case INSERT:{
InsertClause(up);
break;
+ }
default:
jj_la1[56] = jj_gen;
;
}
break;
- case INSERT:
+ }
+ case INSERT:{
InsertClause(up);
break;
+ }
default:
jj_la1[57] = jj_gen;
jj_consume_token(-1);
@@ -2098,10 +2167,11 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
label_15:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case USING:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case USING:{
;
break;
+ }
default:
jj_la1[58] = jj_gen;
break label_15;
@@ -2109,136 +2179,139 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
UsingClause(up);
}
jj_consume_token(WHERE);
- startWherePattern() ;
+startWherePattern() ;
el = GroupGraphPattern();
- up.setElement(el) ;
- finishWherePattern() ;
- finishModifyUpdate() ;
- {if (true) return up ;}
+up.setElement(el) ;
+finishWherePattern() ;
+finishModifyUpdate() ;
+{if ("" != null) return up ;}
throw new Error("Missing return statement in function");
- }
+}
- final public void DeleteClause(UpdateModify up) throws ParseException {
- QuadAcc qp = up.getDeleteAcc() ; Token t ;
+ final public void DeleteClause(UpdateModify up) throws ParseException {QuadAcc qp = up.getDeleteAcc() ; Token t ;
t = jj_consume_token(DELETE);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- startDeleteTemplate(qp, beginLine, beginColumn) ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+startDeleteTemplate(qp, beginLine, beginColumn) ;
QuadPattern(qp);
- finishDeleteTemplate(qp, beginLine, beginColumn) ;
- up.setHasDeleteClause(true) ;
- }
+finishDeleteTemplate(qp, beginLine, beginColumn) ;
+up.setHasDeleteClause(true) ;
+}
- final public void InsertClause(UpdateModify up) throws ParseException {
- QuadAcc qp = up.getInsertAcc() ; Token t ;
+ final public void InsertClause(UpdateModify up) throws ParseException {QuadAcc qp = up.getInsertAcc() ; Token t ;
t = jj_consume_token(INSERT);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- startInsertTemplate(qp, beginLine, beginColumn) ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+startInsertTemplate(qp, beginLine, beginColumn) ;
QuadPattern(qp);
- finishInsertTemplate(qp, beginLine, beginColumn) ;
- up.setHasInsertClause(true) ;
- }
+finishInsertTemplate(qp, beginLine, beginColumn) ;
+up.setHasInsertClause(true) ;
+}
- final public void UsingClause(UpdateWithUsing update) throws ParseException {
- String iri ; Node n ;
+ final public void UsingClause(UpdateWithUsing update) throws ParseException {String iri ; Node n ;
jj_consume_token(USING);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- n = createNode(iri) ; update.addUsing(n) ;
+n = createNode(iri) ; update.addUsing(n) ;
break;
- case NAMED:
+ }
+ case NAMED:{
jj_consume_token(NAMED);
iri = iri();
- n = createNode(iri) ; update.addUsingNamed(n) ;
+n = createNode(iri) ; update.addUsingNamed(n) ;
break;
+ }
default:
jj_la1[59] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
- final public Target GraphOrDefault() throws ParseException {
- String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DFT:
+ final public Target GraphOrDefault() throws ParseException {String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DFT:{
jj_consume_token(DFT);
- {if (true) return Target.DEFAULT ;}
+{if ("" != null) return Target.DEFAULT ;}
break;
+ }
case IRIref:
case PNAME_NS:
case PNAME_LN:
- case GRAPH:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case GRAPH:
+ case GRAPH:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case GRAPH:{
jj_consume_token(GRAPH);
break;
+ }
default:
jj_la1[60] = jj_gen;
;
}
iri = iri();
- {if (true) return Target.create(createNode(iri)) ;}
+{if ("" != null) return Target.create(createNode(iri)) ;}
break;
+ }
default:
jj_la1[61] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node GraphRef() throws ParseException {
- String iri ;
+ final public Node GraphRef() throws ParseException {String iri ;
jj_consume_token(GRAPH);
iri = iri();
- {if (true) return createNode(iri) ;}
+{if ("" != null) return createNode(iri) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Target GraphRefAll() throws ParseException {
- Node iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case GRAPH:
+ final public Target GraphRefAll() throws ParseException {Node iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case GRAPH:{
iri = GraphRef();
- {if (true) return Target.create(iri) ;}
+{if ("" != null) return Target.create(iri) ;}
break;
- case DFT:
+ }
+ case DFT:{
jj_consume_token(DFT);
- {if (true) return Target.DEFAULT ;}
+{if ("" != null) return Target.DEFAULT ;}
break;
- case NAMED:
+ }
+ case NAMED:{
jj_consume_token(NAMED);
- {if (true) return Target.NAMED ;}
+{if ("" != null) return Target.NAMED ;}
break;
- case ALL:
+ }
+ case ALL:{
jj_consume_token(ALL);
- {if (true) return Target.ALL ;}
+{if ("" != null) return Target.ALL ;}
break;
+ }
default:
jj_la1[62] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
final public void QuadPattern(QuadAcc acc) throws ParseException {
jj_consume_token(LBRACE);
Quads(acc);
jj_consume_token(RBRACE);
- }
+}
final public void QuadData(QuadDataAccSink acc) throws ParseException {
jj_consume_token(LBRACE);
Quads(acc);
jj_consume_token(RBRACE);
- }
+}
final public void Quads(QuadAccSink acc) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2264,33 +2337,36 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesTemplate(acc);
break;
+ }
default:
jj_la1[63] = jj_gen;
;
}
label_16:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case GRAPH:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case GRAPH:{
;
break;
+ }
default:
jj_la1[64] = jj_gen;
break label_16;
}
QuadsNotTriples(acc);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
jj_consume_token(DOT);
break;
+ }
default:
jj_la1[65] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2316,23 +2392,23 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesTemplate(acc);
break;
+ }
default:
jj_la1[66] = jj_gen;
;
}
}
- }
+}
- final public void QuadsNotTriples(QuadAccSink acc) throws ParseException {
- Node gn ; Node prev = acc.getGraph() ;
+ final public void QuadsNotTriples(QuadAccSink acc) throws ParseException {Node gn ; Node prev = acc.getGraph() ;
jj_consume_token(GRAPH);
gn = VarOrBlankNodeOrIri();
- setAccGraph(acc, gn) ;
+setAccGraph(acc, gn) ;
jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2358,19 +2434,20 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesTemplate(acc);
break;
+ }
default:
jj_la1[67] = jj_gen;
;
}
jj_consume_token(RBRACE);
- setAccGraph(acc, prev) ;
- }
+setAccGraph(acc, prev) ;
+}
final public void ConstructQuads(QuadAcc acc) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2396,34 +2473,37 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesTemplate(acc);
break;
+ }
default:
jj_la1[68] = jj_gen;
;
}
label_17:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case GRAPH:
- case LBRACE:
+ case LBRACE:{
;
break;
+ }
default:
jj_la1[69] = jj_gen;
break label_17;
}
ConstructQuadsNotTriples(acc);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
jj_consume_token(DOT);
break;
+ }
default:
jj_la1[70] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2449,31 +2529,32 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesTemplate(acc);
break;
+ }
default:
jj_la1[71] = jj_gen;
;
}
}
- }
+}
- final public void ConstructQuadsNotTriples(QuadAccSink acc) throws ParseException {
- Node gn = Quad.defaultGraphNodeGenerated ;
+ final public void ConstructQuadsNotTriples(QuadAccSink acc) throws ParseException {Node gn = Quad.defaultGraphNodeGenerated ;
Node prev = acc.getGraph() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case GRAPH:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case GRAPH:{
jj_consume_token(GRAPH);
gn = VarOrBlankNodeOrIri();
break;
+ }
default:
jj_la1[72] = jj_gen;
;
}
- setAccGraph(acc, gn) ;
+setAccGraph(acc, gn) ;
jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2499,16 +2580,17 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesTemplate(acc);
break;
+ }
default:
jj_la1[73] = jj_gen;
;
}
jj_consume_token(RBRACE);
- setAccGraph(acc, prev) ;
- }
+setAccGraph(acc, prev) ;
+}
final public void TriplesTemplate(TripleCollector acc) throws ParseException {
TriplesSameSubject(acc);
@@ -2522,41 +2604,41 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(DOT);
TriplesSameSubject(acc);
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
jj_consume_token(DOT);
break;
+ }
default:
jj_la1[74] = jj_gen;
;
}
- }
+}
- final public Element GroupGraphPattern() throws ParseException {
- Element el = null ; Token t ;
+ final public Element GroupGraphPattern() throws ParseException {Element el = null ; Token t ;
t = jj_consume_token(LBRACE);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SELECT:
- startSubSelect(beginLine, beginColumn) ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SELECT:{
+startSubSelect(beginLine, beginColumn) ;
SubSelect();
- Query q = endSubSelect(beginLine, beginColumn) ;
+Query q = endSubSelect(beginLine, beginColumn) ;
el = new ElementSubQuery(q) ;
break;
+ }
default:
jj_la1[75] = jj_gen;
el = GroupGraphPatternSub();
}
jj_consume_token(RBRACE);
- {if (true) return el ;}
+{if ("" != null) return el ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element GroupGraphPatternSub() throws ParseException {
- Element el = null ;
- ElementGroup elg = new ElementGroup() ;
- startGroup(elg) ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Element GroupGraphPatternSub() throws ParseException {Element el = null ;
+ElementGroup elg = new ElementGroup() ;
+startGroup(elg) ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2582,19 +2664,20 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
- startTriplesBlock() ;
+ case LT2:{
+startTriplesBlock() ;
el = TriplesBlock(null);
- endTriplesBlock() ;
+endTriplesBlock() ;
elg.addElement(el) ;
break;
+ }
default:
jj_la1[76] = jj_gen;
;
}
label_19:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VALUES:
case GRAPH:
case OPTIONAL:
@@ -2607,24 +2690,26 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case EXISTS:
case NOT:
case FILTER:
- case LBRACE:
+ case LBRACE:{
;
break;
+ }
default:
jj_la1[77] = jj_gen;
break label_19;
}
el = GraphPatternNotTriples();
- elg.addElement(el) ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
+elg.addElement(el) ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
jj_consume_token(DOT);
break;
+ }
default:
jj_la1[78] = jj_gen;
;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2650,30 +2735,31 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
- startTriplesBlock() ;
+ case LT2:{
+startTriplesBlock() ;
el = TriplesBlock(null);
- endTriplesBlock() ;
+endTriplesBlock() ;
elg.addElement(el) ;
break;
+ }
default:
jj_la1[79] = jj_gen;
;
}
}
- endGroup(elg) ;
- {if (true) return elg ;}
+endGroup(elg) ;
+{if ("" != null) return elg ;}
throw new Error("Missing return statement in function");
- }
+}
final public Element TriplesBlock(ElementPathBlock acc) throws ParseException {
- if ( acc == null )
+if ( acc == null )
acc = new ElementPathBlock() ;
TriplesSameSubjectPath(acc);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
jj_consume_token(DOT);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2699,166 +2785,176 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
TriplesBlock(acc);
break;
+ }
default:
jj_la1[80] = jj_gen;
;
}
break;
+ }
default:
jj_la1[81] = jj_gen;
;
}
- {if (true) return acc ;}
+{if ("" != null) return acc ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element GraphPatternNotTriples() throws ParseException {
- Element el = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
+ final public Element GraphPatternNotTriples() throws ParseException {Element el = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LBRACE:{
el = GroupOrUnionGraphPattern();
break;
- case OPTIONAL:
+ }
+ case OPTIONAL:{
el = OptionalGraphPattern();
break;
- case LATERAL:
+ }
+ case LATERAL:{
el = LateralGraphPattern();
break;
- case MINUS_P:
+ }
+ case MINUS_P:{
el = MinusGraphPattern();
break;
- case GRAPH:
+ }
+ case GRAPH:{
el = GraphGraphPattern();
break;
- case SERVICE:
+ }
+ case SERVICE:{
el = ServiceGraphPattern();
break;
- case FILTER:
+ }
+ case FILTER:{
el = Filter();
break;
- case BIND:
+ }
+ case BIND:{
el = Bind();
break;
- case VALUES:
+ }
+ case VALUES:{
el = InlineData();
break;
- case LET:
+ }
+ case LET:{
el = Assignment();
break;
- case UNFOLD:
- el = Unfold();
- break;
- case EXISTS:
+ }
+ case EXISTS:{
el = ExistsElt();
break;
- case NOT:
+ }
+ case NOT:{
el = NotExistsElt();
break;
+ }
+ case UNFOLD:{
+ el = Unfold();
+ break;
+ }
default:
jj_la1[82] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return el ;}
+{if ("" != null) return el ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element OptionalGraphPattern() throws ParseException {
- Element el ;
+ final public Element OptionalGraphPattern() throws ParseException {Element el ;
jj_consume_token(OPTIONAL);
el = GroupGraphPattern();
- {if (true) return new ElementOptional(el) ;}
+{if ("" != null) return new ElementOptional(el) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element LateralGraphPattern() throws ParseException {
- Element el ;
+ final public Element LateralGraphPattern() throws ParseException {Element el ;
jj_consume_token(LATERAL);
el = GroupGraphPattern();
- {if (true) return new ElementLateral(el) ;}
+{if ("" != null) return new ElementLateral(el) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element GraphGraphPattern() throws ParseException {
- Element el ; Node n ;
+ final public Element GraphGraphPattern() throws ParseException {Element el ; Node n ;
jj_consume_token(GRAPH);
n = VarOrIri();
el = GroupGraphPattern();
- {if (true) return new ElementNamedGraph(n, el) ;}
+{if ("" != null) return new ElementNamedGraph(n, el) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element ServiceGraphPattern() throws ParseException {
- Element el ; Node n ; boolean silent = false ;
+ final public Element ServiceGraphPattern() throws ParseException {Element el ; Node n ; boolean silent = false ;
jj_consume_token(SERVICE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SILENT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SILENT:{
jj_consume_token(SILENT);
- silent=true;
+silent=true;
break;
+ }
default:
jj_la1[83] = jj_gen;
;
}
n = VarOrIri();
el = GroupGraphPattern();
- {if (true) return new ElementService(n, el, silent) ;}
+{if ("" != null) return new ElementService(n, el, silent) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element Bind() throws ParseException {
- Var v ; Expr expr ;
+ final public Element Bind() throws ParseException {Var v ; Expr expr ;
jj_consume_token(BIND);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(AS);
v = Var();
jj_consume_token(RPAREN);
- {if (true) return new ElementBind(v, expr) ;}
+{if ("" != null) return new ElementBind(v, expr) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element InlineData() throws ParseException {
- ElementData el ; Token t ;
+ final public Element InlineData() throws ParseException {ElementData el ; Token t ;
t = jj_consume_token(VALUES);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- el = new ElementData() ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+el = new ElementData() ;
startInlineData(el.getVars(), el.getRows(), beginLine, beginColumn) ;
DataBlock();
- finishInlineData(beginLine, beginColumn) ;
- {if (true) return el ;}
+finishInlineData(beginLine, beginColumn) ;
+ {if ("" != null) return el ;}
throw new Error("Missing return statement in function");
- }
+}
final public void DataBlock() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
InlineDataOneVar();
break;
+ }
case LPAREN:
- case NIL:
+ case NIL:{
InlineDataFull();
break;
+ }
default:
jj_la1[84] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
- final public void InlineDataOneVar() throws ParseException {
- Var v ; Node n ; Token t ; ; int beginLine; int beginColumn;
+ final public void InlineDataOneVar() throws ParseException {Var v ; Node n ; Token t ; ; int beginLine; int beginColumn;
v = Var();
- emitDataBlockVariable(v) ;
+emitDataBlockVariable(v) ;
t = jj_consume_token(LBRACE);
- beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
+beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
label_20:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2878,45 +2974,48 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case LT2:
+ case LT2:{
;
break;
+ }
default:
jj_la1[85] = jj_gen;
break label_20;
}
n = DataBlockValue();
- startDataBlockValueRow(beginLine, beginColumn) ;
+startDataBlockValueRow(beginLine, beginColumn) ;
emitDataBlockValue(n, beginLine, beginColumn) ;
finishDataBlockValueRow(beginLine, beginColumn) ;
}
t = jj_consume_token(RBRACE);
- }
+}
- final public void InlineDataFull() throws ParseException {
- Var v ; Node n ; Token t ; int beginLine; int beginColumn;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case NIL:
+ final public void InlineDataFull() throws ParseException {Var v ; Node n ; Token t ; int beginLine; int beginColumn;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case NIL:{
jj_consume_token(NIL);
break;
- case LPAREN:
+ }
+ case LPAREN:{
jj_consume_token(LPAREN);
label_21:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
;
break;
+ }
default:
jj_la1[86] = jj_gen;
break label_21;
}
v = Var();
- emitDataBlockVariable(v) ;
+emitDataBlockVariable(v) ;
}
jj_consume_token(RPAREN);
break;
+ }
default:
jj_la1[87] = jj_gen;
jj_consume_token(-1);
@@ -2925,23 +3024,24 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(LBRACE);
label_22:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LPAREN:
- case NIL:
+ case NIL:{
;
break;
+ }
default:
jj_la1[88] = jj_gen;
break label_22;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
t = jj_consume_token(LPAREN);
- beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
- startDataBlockValueRow(beginLine, beginColumn) ;
+beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
+startDataBlockValueRow(beginLine, beginColumn) ;
label_23:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -2961,26 +3061,29 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
- case LT2:
+ case LT2:{
;
break;
+ }
default:
jj_la1[89] = jj_gen;
break label_23;
}
n = DataBlockValue();
- emitDataBlockValue(n, beginLine, beginColumn) ;
+emitDataBlockValue(n, beginLine, beginColumn) ;
}
t = jj_consume_token(RPAREN);
- beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
- finishDataBlockValueRow(beginLine, beginColumn) ;
+beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
+finishDataBlockValueRow(beginLine, beginColumn) ;
break;
- case NIL:
+ }
+ case NIL:{
t = jj_consume_token(NIL);
- beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
- startDataBlockValueRow(beginLine, beginColumn) ;
- finishDataBlockValueRow(beginLine, beginColumn) ;
+beginLine = t.beginLine; beginColumn = t.beginColumn; t = null;
+startDataBlockValueRow(beginLine, beginColumn) ;
+finishDataBlockValueRow(beginLine, beginColumn) ;
break;
+ }
default:
jj_la1[90] = jj_gen;
jj_consume_token(-1);
@@ -2988,24 +3091,25 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
}
jj_consume_token(RBRACE);
- }
+}
- final public Node DataBlockValue() throws ParseException {
- Node n ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node DataBlockValue() throws ParseException {Node n ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- {if (true) return createNode(iri) ;}
+{if ("" != null) return createNode(iri) ;}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -3014,130 +3118,129 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case UNDEF:
+ }
+ case UNDEF:{
jj_consume_token(UNDEF);
- {if (true) return null ;}
+{if ("" != null) return null ;}
break;
- case LT2:
+ }
+ case LT2:{
n = QuotedTripleData();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[91] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Element Assignment() throws ParseException {
- Var v ; Expr expr ;
+ final public Element Assignment() throws ParseException {Var v ; Expr expr ;
jj_consume_token(LET);
jj_consume_token(LPAREN);
v = Var();
jj_consume_token(ASSIGN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new ElementAssign(v, expr) ;}
+{if ("" != null) return new ElementAssign(v, expr) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element Unfold() throws ParseException {
- Var v1 ; Var v2 = null ; Expr expr ;
+ final public Element ExistsElt() throws ParseException {Element el ;
+ jj_consume_token(EXISTS);
+ el = GroupGraphPattern();
+{if ("" != null) return new ElementExists(el) ;}
+ throw new Error("Missing return statement in function");
+}
+
+ final public Element NotExistsElt() throws ParseException {Element el ;
+ jj_consume_token(NOT);
+ jj_consume_token(EXISTS);
+ el = GroupGraphPattern();
+{if ("" != null) return new ElementNotExists(el) ;}
+ throw new Error("Missing return statement in function");
+}
+
+ final public Element Unfold() throws ParseException {Var v1 ; Var v2 = null ; Expr expr ;
jj_consume_token(UNFOLD);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(AS);
v1 = Var();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
jj_consume_token(COMMA);
v2 = Var();
- ;
+;
break;
+ }
default:
jj_la1[92] = jj_gen;
;
}
jj_consume_token(RPAREN);
- {if (true) return new ElementUnfold(expr, v1, v2) ;}
- throw new Error("Missing return statement in function");
- }
-
- final public Element ExistsElt() throws ParseException {
- Element el ;
- jj_consume_token(EXISTS);
- el = GroupGraphPattern();
- {if (true) return new ElementExists(el) ;}
+{if ("" != null) return new ElementUnfold(expr, v1, v2) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element NotExistsElt() throws ParseException {
- Element el ;
- jj_consume_token(NOT);
- jj_consume_token(EXISTS);
- el = GroupGraphPattern();
- {if (true) return new ElementNotExists(el) ;}
- throw new Error("Missing return statement in function");
- }
-
- final public Element MinusGraphPattern() throws ParseException {
- Element el ;
+ final public Element MinusGraphPattern() throws ParseException {Element el ;
jj_consume_token(MINUS_P);
el = GroupGraphPattern();
- {if (true) return new ElementMinus(el) ;}
+{if ("" != null) return new ElementMinus(el) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element GroupOrUnionGraphPattern() throws ParseException {
- Element el = null ; ElementUnion el2 = null ;
+ final public Element GroupOrUnionGraphPattern() throws ParseException {Element el = null ; ElementUnion el2 = null ;
el = GroupGraphPattern();
label_24:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case UNION:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case UNION:{
;
break;
+ }
default:
jj_la1[93] = jj_gen;
break label_24;
}
jj_consume_token(UNION);
- if ( el2 == null )
+if ( el2 == null )
{
el2 = new ElementUnion() ;
el2.addElement(el) ;
}
el = GroupGraphPattern();
- el2.addElement(el) ;
+el2.addElement(el) ;
}
- {if (true) return (el2==null)? el : el2 ;}
+{if ("" != null) return (el2==null)? el : el2 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Element Filter() throws ParseException {
- Expr c ;
+ final public Element Filter() throws ParseException {Expr c ;
jj_consume_token(FILTER);
c = Constraint();
- {if (true) return new ElementFilter(c) ;}
+{if ("" != null) return new ElementFilter(c) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr Constraint() throws ParseException {
- Expr c ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ final public Expr Constraint() throws ParseException {Expr c ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
c = BrackettedExpression();
break;
+ }
case TRIPLE:
case IS_TRIPLE:
case SUBJECT:
@@ -3218,132 +3321,137 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA1:
case SHA256:
case SHA384:
- case SHA512:
+ case SHA512:{
c = BuiltInCall();
break;
+ }
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
c = FunctionCall();
break;
+ }
default:
jj_la1[94] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return c ;}
+{if ("" != null) return c ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr FunctionCall() throws ParseException {
- String fname ; Args a ;
+ final public Expr FunctionCall() throws ParseException {String fname ; Args a ;
fname = iri();
a = ArgList();
- if ( AggregateRegistry.isRegistered(fname) ) {
+if ( AggregateRegistry.isRegistered(fname) ) {
if ( ! getAllowAggregatesInExpressions() )
throwParseException("Aggregate expression not legal at this point : "+fname, -1, -1) ;
Aggregator agg = AggregatorFactory.createCustom(fname, a) ;
Expr exprAgg = getQuery().allocAggregate(agg) ;
- {if (true) return exprAgg ;}
+ {if ("" != null) return exprAgg ;}
}
- {if (true) return new E_Function(fname, a) ;}
+ {if ("" != null) return new E_Function(fname, a) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Args ArgList() throws ParseException {
- Expr expr ; Args args = new Args() ; Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case NIL:
+ final public Args ArgList() throws ParseException {Expr expr ; Args args = new Args() ; Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case NIL:{
jj_consume_token(NIL);
break;
- case LPAREN:
+ }
+ case LPAREN:{
jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DISTINCT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DISTINCT:{
t = jj_consume_token(DISTINCT);
- args.distinct = true ;
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
- if ( ! getAllowAggregatesInExpressions() )
+args.distinct = true ;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+if ( ! getAllowAggregatesInExpressions() )
throwParseException("Aggregate expression not legal at this point",
beginLine, beginColumn) ;
break;
+ }
default:
jj_la1[95] = jj_gen;
;
}
expr = Expression();
- args.add(expr) ;
+args.add(expr) ;
label_25:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[96] = jj_gen;
break label_25;
}
jj_consume_token(COMMA);
expr = Expression();
- args.add(expr) ;
+args.add(expr) ;
}
jj_consume_token(RPAREN);
break;
+ }
default:
jj_la1[97] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return args ;}
+{if ("" != null) return args ;}
throw new Error("Missing return statement in function");
- }
+}
- final public ExprList ExpressionList() throws ParseException {
- Expr expr = null ; ExprList exprList = new ExprList() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case NIL:
+ final public ExprList ExpressionList() throws ParseException {Expr expr = null ; ExprList exprList = new ExprList() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case NIL:{
jj_consume_token(NIL);
break;
- case LPAREN:
+ }
+ case LPAREN:{
jj_consume_token(LPAREN);
expr = Expression();
- exprList.add(expr) ;
+exprList.add(expr) ;
label_26:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[98] = jj_gen;
break label_26;
}
jj_consume_token(COMMA);
expr = Expression();
- exprList.add(expr) ;
+exprList.add(expr) ;
}
jj_consume_token(RPAREN);
break;
+ }
default:
jj_la1[99] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return exprList ;}
+{if ("" != null) return exprList ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Template ConstructTemplate() throws ParseException {
- QuadAcc acc = new QuadAcc() ;
+ final public Template ConstructTemplate() throws ParseException {QuadAcc acc = new QuadAcc() ;
Template t = new Template (acc);
- setInConstructTemplate(true) ;
+setInConstructTemplate(true) ;
jj_consume_token(LBRACE);
ConstructQuads(acc);
jj_consume_token(RBRACE);
- setInConstructTemplate(false) ;
- {if (true) return t ;}
+setInConstructTemplate(false) ;
+ {if ("" != null) return t ;}
throw new Error("Missing return statement in function");
- }
+}
final public void ConstructTriples(TripleCollector acc) throws ParseException {
TriplesSameSubject(acc);
@@ -3357,19 +3465,19 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(DOT);
TriplesSameSubject(acc);
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case DOT:{
jj_consume_token(DOT);
break;
+ }
default:
jj_la1[100] = jj_gen;
;
}
- }
+}
- final public void TriplesSameSubject(TripleCollector acc) throws ParseException {
- Node s ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public void TriplesSameSubject(TripleCollector acc) throws ParseException {Node s ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3393,104 +3501,109 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL_LONG2:
case NIL:
case ANON:
- case LT2:
+ case LT2:{
s = VarOrTerm();
PropertyListNotEmpty(s, acc);
break;
+ }
case LPAREN:
- case LBRACKET:
- ElementPathBlock tempAcc = new ElementPathBlock() ;
+ case LBRACKET:{
+ElementPathBlock tempAcc = new ElementPathBlock() ;
s = TriplesNode(tempAcc);
PropertyList(s, tempAcc);
- insert(acc, tempAcc) ;
+insert(acc, tempAcc) ;
break;
+ }
default:
jj_la1[101] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
final public void PropertyList(Node s, TripleCollector acc) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
case VAR2:
- case KW_A:
+ case KW_A:{
PropertyListNotEmpty(s, acc);
break;
+ }
default:
jj_la1[102] = jj_gen;
;
}
- }
+}
- final public void PropertyListNotEmpty(Node s, TripleCollector acc) throws ParseException {
- Node p = null ;
+ final public void PropertyListNotEmpty(Node s, TripleCollector acc) throws ParseException {Node p = null ;
p = Verb();
ObjectList(s, p, null, acc);
label_28:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SEMICOLON:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SEMICOLON:{
;
break;
+ }
default:
jj_la1[103] = jj_gen;
break label_28;
}
jj_consume_token(SEMICOLON);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
case VAR2:
- case KW_A:
+ case KW_A:{
p = Verb();
ObjectList(s, p, null, acc);
break;
+ }
default:
jj_la1[104] = jj_gen;
;
}
}
- }
+}
- final public Node Verb() throws ParseException {
- Node p ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node Verb() throws ParseException {Node p ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case VAR1:
- case VAR2:
+ case VAR2:{
p = VarOrIri();
break;
- case KW_A:
+ }
+ case KW_A:{
jj_consume_token(KW_A);
- p = nRDFtype ;
+p = nRDFtype ;
break;
+ }
default:
jj_la1[105] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public void ObjectList(Node s, Node p, Path path, TripleCollector acc) throws ParseException {
- Node o ;
+ final public void ObjectList(Node s, Node p, Path path, TripleCollector acc) throws ParseException {Node o ;
Object(s, p, path, acc);
label_29:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[106] = jj_gen;
break label_29;
@@ -3498,19 +3611,17 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(COMMA);
Object(s, p, path, acc);
}
- }
+}
- final public void Object(Node s, Node p, Path path, TripleCollector acc) throws ParseException {
- Node o ;
- ElementPathBlock tempAcc = new ElementPathBlock() ; int mark = tempAcc.mark() ;
+ final public void Object(Node s, Node p, Path path, TripleCollector acc) throws ParseException {Node o ;
+ElementPathBlock tempAcc = new ElementPathBlock() ; int mark = tempAcc.mark() ;
o = GraphNode(tempAcc);
- insert(tempAcc, mark, s, p, path, o) ; insert(acc, tempAcc) ;
+insert(tempAcc, mark, s, p, path, o) ; insert(acc, tempAcc) ;
Annotation(acc, s, p, path, o);
- }
+}
- final public void TriplesSameSubjectPath(TripleCollector acc) throws ParseException {
- Node s ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public void TriplesSameSubjectPath(TripleCollector acc) throws ParseException {Node s ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3534,26 +3645,28 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL_LONG2:
case NIL:
case ANON:
- case LT2:
+ case LT2:{
s = VarOrTerm();
PropertyListPathNotEmpty(s, acc);
break;
+ }
case LPAREN:
- case LBRACKET:
- ElementPathBlock tempAcc = new ElementPathBlock() ;
+ case LBRACKET:{
+ElementPathBlock tempAcc = new ElementPathBlock() ;
s = TriplesNodePath(tempAcc);
PropertyListPath(s, tempAcc);
- insert(acc, tempAcc) ;
+insert(acc, tempAcc) ;
break;
+ }
default:
jj_la1[107] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- }
+}
final public void PropertyListPath(Node s, TripleCollector acc) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3565,18 +3678,18 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHORTEST:
case LPAREN:
case BANG:
- case CARAT:
+ case CARAT:{
PropertyListPathNotEmpty(s, acc);
break;
+ }
default:
jj_la1[108] = jj_gen;
;
}
- }
+}
- final public void PropertyListPathNotEmpty(Node s, TripleCollector acc) throws ParseException {
- Path path = null ; Node p = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public void PropertyListPathNotEmpty(Node s, TripleCollector acc) throws ParseException {Path path = null ; Node p = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3586,13 +3699,15 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHORTEST:
case LPAREN:
case BANG:
- case CARAT:
+ case CARAT:{
path = VerbPath();
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
p = VerbSimple();
break;
+ }
default:
jj_la1[109] = jj_gen;
jj_consume_token(-1);
@@ -3601,17 +3716,18 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
ObjectListPath(s, p, path, acc);
label_30:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SEMICOLON:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SEMICOLON:{
;
break;
+ }
default:
jj_la1[110] = jj_gen;
break label_30;
}
jj_consume_token(SEMICOLON);
- path = null ; p = null ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+path = null ; p = null ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3623,8 +3739,8 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHORTEST:
case LPAREN:
case BANG:
- case CARAT:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case CARAT:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3634,13 +3750,15 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHORTEST:
case LPAREN:
case BANG:
- case CARAT:
+ case CARAT:{
path = VerbPath();
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
p = VerbSimple();
break;
+ }
default:
jj_la1[111] = jj_gen;
jj_consume_token(-1);
@@ -3648,36 +3766,35 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
ObjectListPath(s, p, path, acc);
break;
+ }
default:
jj_la1[112] = jj_gen;
;
}
}
- }
+}
- final public Path VerbPath() throws ParseException {
- Node p ; Path path ;
+ final public Path VerbPath() throws ParseException {Node p ; Path path ;
path = Path();
- {if (true) return path ;}
+{if ("" != null) return path ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node VerbSimple() throws ParseException {
- Node p ;
+ final public Node VerbSimple() throws ParseException {Node p ;
p = Var();
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public void ObjectListPath(Node s, Node p, Path path, TripleCollector acc) throws ParseException {
- Node o ;
+ final public void ObjectListPath(Node s, Node p, Path path, TripleCollector acc) throws ParseException {Node o ;
ObjectPath(s, p, path, acc);
label_31:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[113] = jj_gen;
break label_31;
@@ -3685,109 +3802,107 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(COMMA);
ObjectPath(s, p, path, acc);
}
- }
+}
- final public void ObjectPath(Node s, Node p, Path path, TripleCollector acc) throws ParseException {
- Node o ;
- ElementPathBlock tempAcc = new ElementPathBlock() ; int mark = tempAcc.mark() ;
+ final public void ObjectPath(Node s, Node p, Path path, TripleCollector acc) throws ParseException {Node o ;
+ElementPathBlock tempAcc = new ElementPathBlock() ; int mark = tempAcc.mark() ;
o = GraphNodePath(tempAcc);
- insert(tempAcc, mark, s, p, path, o) ; insert(acc, tempAcc) ;
+insert(tempAcc, mark, s, p, path, o) ; insert(acc, tempAcc) ;
AnnotationPath(acc, s, p, path, o);
- }
+}
- final public Path PathUnit() throws ParseException {
- Path p ;
+ final public Path PathUnit() throws ParseException {Path p ;
ByteOrderMark();
p = Path();
jj_consume_token(0);
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path Path() throws ParseException {
- Path p ;
+ final public Path Path() throws ParseException {Path p ;
p = PathAlternative();
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathAlternative() throws ParseException {
- Path p1 , p2 ;
+ final public Path PathAlternative() throws ParseException {Path p1 , p2 ;
p1 = PathSequence();
label_32:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VBAR:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VBAR:{
;
break;
+ }
default:
jj_la1[114] = jj_gen;
break label_32;
}
jj_consume_token(VBAR);
p2 = PathSequence();
- p1 = PathFactory.pathAlt(p1, p2) ;
+p1 = PathFactory.pathAlt(p1, p2) ;
}
- {if (true) return p1 ;}
+{if ("" != null) return p1 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathSequence() throws ParseException {
- Path p1 , p2 ;
+ final public Path PathSequence() throws ParseException {Path p1 , p2 ;
p1 = PathEltOrInverse();
label_33:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case SLASH:
- case CARAT:
+ case CARAT:{
;
break;
+ }
default:
jj_la1[115] = jj_gen;
break label_33;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SLASH:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SLASH:{
jj_consume_token(SLASH);
p2 = PathEltOrInverse();
- p1 = PathFactory.pathSeq(p1, p2) ;
+p1 = PathFactory.pathSeq(p1, p2) ;
break;
- case CARAT:
+ }
+ case CARAT:{
jj_consume_token(CARAT);
p2 = PathElt();
- p1 = PathFactory.pathSeq(p1, new P_Inverse(p2)) ;
+p1 = PathFactory.pathSeq(p1, new P_Inverse(p2)) ;
break;
+ }
default:
jj_la1[116] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
- {if (true) return p1;}
+{if ("" != null) return p1;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathElt() throws ParseException {
- String str ; Node n ; Path p ;
+ final public Path PathElt() throws ParseException {String str ; Node n ; Path p ;
p = PathPrimary();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case LBRACE:
case PLUS:
case STAR:
- case QMARK:
+ case QMARK:{
p = PathMod(p);
break;
+ }
default:
jj_la1[117] = jj_gen;
;
}
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathEltOrInverse() throws ParseException {
- String str ; Node n ; Path p ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Path PathEltOrInverse() throws ParseException {String str ; Node n ; Path p ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -3796,327 +3911,351 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case MULTI:
case SHORTEST:
case LPAREN:
- case BANG:
+ case BANG:{
p = PathElt();
break;
- case CARAT:
+ }
+ case CARAT:{
jj_consume_token(CARAT);
p = PathElt();
- p = PathFactory.pathInverse(p) ;
+p = PathFactory.pathInverse(p) ;
break;
+ }
default:
jj_la1[118] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathMod(Path p) throws ParseException {
- long i1 ; long i2 ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case QMARK:
+ final public Path PathMod(Path p) throws ParseException {long i1 ; long i2 ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case QMARK:{
jj_consume_token(QMARK);
- {if (true) return PathFactory.pathZeroOrOne(p) ;}
+{if ("" != null) return PathFactory.pathZeroOrOne(p) ;}
break;
- case STAR:
+ }
+ case STAR:{
jj_consume_token(STAR);
- {if (true) return PathFactory.pathZeroOrMore1(p) ;}
+{if ("" != null) return PathFactory.pathZeroOrMore1(p) ;}
break;
- case PLUS:
+ }
+ case PLUS:{
jj_consume_token(PLUS);
- {if (true) return PathFactory.pathOneOrMore1(p) ;}
+{if ("" != null) return PathFactory.pathOneOrMore1(p) ;}
break;
- case LBRACE:
+ }
+ case LBRACE:{
jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STAR:{
jj_consume_token(STAR);
jj_consume_token(RBRACE);
- {if (true) return PathFactory.pathZeroOrMoreN(p) ;}
+{if ("" != null) return PathFactory.pathZeroOrMoreN(p) ;}
break;
- case PLUS:
+ }
+ case PLUS:{
jj_consume_token(PLUS);
jj_consume_token(RBRACE);
- {if (true) return PathFactory.pathOneOrMoreN(p) ;}
+{if ("" != null) return PathFactory.pathOneOrMoreN(p) ;}
break;
- case INTEGER:
+ }
+ case INTEGER:{
i1 = Integer();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
jj_consume_token(COMMA);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case RBRACE:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case RBRACE:{
jj_consume_token(RBRACE);
- {if (true) return PathFactory.pathMod(p, i1, PathFactory.UNSET) ;}
+{if ("" != null) return PathFactory.pathMod(p, i1, PathFactory.UNSET) ;}
break;
- case INTEGER:
+ }
+ case INTEGER:{
i2 = Integer();
jj_consume_token(RBRACE);
- {if (true) return PathFactory.pathMod(p, i1, i2) ;}
+{if ("" != null) return PathFactory.pathMod(p, i1, i2) ;}
break;
+ }
default:
jj_la1[119] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
- case RBRACE:
+ }
+ case RBRACE:{
jj_consume_token(RBRACE);
- {if (true) return PathFactory.pathFixedLength(p, i1) ;}
+{if ("" != null) return PathFactory.pathFixedLength(p, i1) ;}
break;
+ }
default:
jj_la1[120] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
- case COMMA:
+ }
+ case COMMA:{
jj_consume_token(COMMA);
i2 = Integer();
jj_consume_token(RBRACE);
- {if (true) return PathFactory.pathMod(p, PathFactory.UNSET, i2) ;}
+{if ("" != null) return PathFactory.pathMod(p, PathFactory.UNSET, i2) ;}
break;
+ }
default:
jj_la1[121] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[122] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathPrimary() throws ParseException {
- String str ; Path p ; Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Path PathPrimary() throws ParseException {String str ; Path p ; Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
str = iri();
- n = createNode(str) ; p = PathFactory.pathLink(n) ;
+n = createNode(str) ; p = PathFactory.pathLink(n) ;
break;
- case KW_A:
+ }
+ case KW_A:{
jj_consume_token(KW_A);
- p = PathFactory.pathLink(nRDFtype) ;
+p = PathFactory.pathLink(nRDFtype) ;
break;
- case BANG:
+ }
+ case BANG:{
jj_consume_token(BANG);
p = PathNegatedPropertySet();
break;
- case LPAREN:
+ }
+ case LPAREN:{
jj_consume_token(LPAREN);
p = Path();
jj_consume_token(RPAREN);
break;
- case DISTINCT:
+ }
+ case DISTINCT:{
jj_consume_token(DISTINCT);
jj_consume_token(LPAREN);
p = Path();
- p = PathFactory.pathDistinct(p) ;
+p = PathFactory.pathDistinct(p) ;
jj_consume_token(RPAREN);
break;
- case SHORTEST:
+ }
+ case SHORTEST:{
jj_consume_token(SHORTEST);
jj_consume_token(LPAREN);
p = Path();
- p = PathFactory.pathShortest(p) ;
+p = PathFactory.pathShortest(p) ;
jj_consume_token(RPAREN);
break;
- case MULTI:
+ }
+ case MULTI:{
jj_consume_token(MULTI);
jj_consume_token(LPAREN);
p = Path();
- p = PathFactory.pathMulti(p) ;
+p = PathFactory.pathMulti(p) ;
jj_consume_token(RPAREN);
break;
+ }
default:
jj_la1[123] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return p ;}
+{if ("" != null) return p ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Path PathNegatedPropertySet() throws ParseException {
- P_Path0 p ; P_NegPropSet pNegSet ;
- pNegSet = new P_NegPropSet() ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Path PathNegatedPropertySet() throws ParseException {P_Path0 p ; P_NegPropSet pNegSet ;
+pNegSet = new P_NegPropSet() ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case KW_A:
- case CARAT:
+ case CARAT:{
p = PathOneInPropertySet();
- pNegSet.add(p) ;
+pNegSet.add(p) ;
break;
- case LPAREN:
+ }
+ case LPAREN:{
jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
case KW_A:
- case CARAT:
+ case CARAT:{
p = PathOneInPropertySet();
- pNegSet.add(p) ;
+pNegSet.add(p) ;
label_34:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VBAR:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VBAR:{
;
break;
+ }
default:
jj_la1[124] = jj_gen;
break label_34;
}
jj_consume_token(VBAR);
p = PathOneInPropertySet();
- pNegSet.add(p) ;
+pNegSet.add(p) ;
}
break;
+ }
default:
jj_la1[125] = jj_gen;
;
}
jj_consume_token(RPAREN);
break;
+ }
default:
jj_la1[126] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return pNegSet ;}
+{if ("" != null) return pNegSet ;}
throw new Error("Missing return statement in function");
- }
+}
- final public P_Path0 PathOneInPropertySet() throws ParseException {
- String str ; Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public P_Path0 PathOneInPropertySet() throws ParseException {String str ; Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
str = iri();
- n = createNode(str) ; {if (true) return new P_Link(n) ;}
+n = createNode(str) ; {if ("" != null) return new P_Link(n) ;}
break;
- case KW_A:
+ }
+ case KW_A:{
jj_consume_token(KW_A);
- {if (true) return new P_Link(nRDFtype) ;}
+{if ("" != null) return new P_Link(nRDFtype) ;}
break;
- case CARAT:
+ }
+ case CARAT:{
jj_consume_token(CARAT);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
str = iri();
- n = createNode(str) ; {if (true) return new P_ReverseLink(n) ;}
+n = createNode(str) ; {if ("" != null) return new P_ReverseLink(n) ;}
break;
- case KW_A:
+ }
+ case KW_A:{
jj_consume_token(KW_A);
- {if (true) return new P_ReverseLink(nRDFtype) ;}
+{if ("" != null) return new P_ReverseLink(nRDFtype) ;}
break;
+ }
default:
jj_la1[127] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[128] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public long Integer() throws ParseException {
- Token t ;
+ final public long Integer() throws ParseException {Token t ;
t = jj_consume_token(INTEGER);
- {if (true) return integerValue(t.image) ;}
+{if ("" != null) return integerValue(t.image) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node TriplesNode(TripleCollectorMark acc) throws ParseException {
- Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ final public Node TriplesNode(TripleCollectorMark acc) throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
n = Collection(acc);
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case LBRACKET:
+ }
+ case LBRACKET:{
n = BlankNodePropertyList(acc);
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[129] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node BlankNodePropertyList(TripleCollector acc) throws ParseException {
- Token t ;
+ final public Node BlankNodePropertyList(TripleCollector acc) throws ParseException {Token t ;
t = jj_consume_token(LBRACKET);
- Node n = createBNode( t.beginLine, t.beginColumn) ;
+Node n = createBNode( t.beginLine, t.beginColumn) ;
PropertyListNotEmpty(n, acc);
jj_consume_token(RBRACKET);
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node TriplesNodePath(TripleCollectorMark acc) throws ParseException {
- Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ final public Node TriplesNodePath(TripleCollectorMark acc) throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
n = CollectionPath(acc);
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case LBRACKET:
+ }
+ case LBRACKET:{
n = BlankNodePropertyListPath(acc);
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[130] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node BlankNodePropertyListPath(TripleCollector acc) throws ParseException {
- Token t ;
+ final public Node BlankNodePropertyListPath(TripleCollector acc) throws ParseException {Token t ;
t = jj_consume_token(LBRACKET);
- Node n = createBNode( t.beginLine, t.beginColumn) ;
+Node n = createBNode( t.beginLine, t.beginColumn) ;
PropertyListPathNotEmpty(n, acc);
jj_consume_token(RBRACKET);
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node Collection(TripleCollectorMark acc) throws ParseException {
- Node listHead = nRDFnil ; Node lastCell = null ; int mark ; Node n ; Token t ;
+ final public Node Collection(TripleCollectorMark acc) throws ParseException {Node listHead = nRDFnil ; Node lastCell = null ; int mark ; Node n ; Token t ;
t = jj_consume_token(LPAREN);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
label_35:
while (true) {
- Node cell = createListNode( beginLine, beginColumn) ;
+Node cell = createListNode( beginLine, beginColumn) ;
if ( listHead == nRDFnil )
listHead = cell ;
if ( lastCell != null )
insert(acc, lastCell, nRDFrest, cell) ;
mark = acc.mark() ;
n = GraphNode(acc);
- insert(acc, mark, cell, nRDFfirst, n) ;
+insert(acc, mark, cell, nRDFfirst, n) ;
lastCell = cell ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -4142,37 +4281,37 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
;
break;
+ }
default:
jj_la1[131] = jj_gen;
break label_35;
}
}
jj_consume_token(RPAREN);
- if ( lastCell != null )
+if ( lastCell != null )
insert(acc, lastCell, nRDFrest, nRDFnil) ;
- {if (true) return listHead ;}
+ {if ("" != null) return listHead ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node CollectionPath(TripleCollectorMark acc) throws ParseException {
- Node listHead = nRDFnil ; Node lastCell = null ; int mark ; Node n ; Token t ;
+ final public Node CollectionPath(TripleCollectorMark acc) throws ParseException {Node listHead = nRDFnil ; Node lastCell = null ; int mark ; Node n ; Token t ;
t = jj_consume_token(LPAREN);
- int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
+int beginLine = t.beginLine; int beginColumn = t.beginColumn; t = null;
label_36:
while (true) {
- Node cell = createListNode( beginLine, beginColumn) ;
+Node cell = createListNode( beginLine, beginColumn) ;
if ( listHead == nRDFnil )
listHead = cell ;
if ( lastCell != null )
insert(acc, lastCell, nRDFrest, cell) ;
mark = acc.mark() ;
n = GraphNodePath(acc);
- insert(acc, mark, cell, nRDFfirst, n) ;
+insert(acc, mark, cell, nRDFfirst, n) ;
lastCell = cell ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -4198,54 +4337,56 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case NIL:
case LBRACKET:
case ANON:
- case LT2:
+ case LT2:{
;
break;
+ }
default:
jj_la1[132] = jj_gen;
break label_36;
}
}
jj_consume_token(RPAREN);
- if ( lastCell != null )
+if ( lastCell != null )
insert(acc, lastCell, nRDFrest, nRDFnil) ;
- {if (true) return listHead ;}
+ {if ("" != null) return listHead ;}
throw new Error("Missing return statement in function");
- }
+}
final public void AnnotationPath(TripleCollector acc, Node s, Node p, Path path, Node o) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case L_ANN:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case L_ANN:{
jj_consume_token(L_ANN);
- Node pAnn = preConditionAnnotation(s, p, path, o, token.beginLine, token.beginColumn) ;
+Node pAnn = preConditionAnnotation(s, p, path, o, token.beginLine, token.beginColumn) ;
Node x = createQuotedTriple(s, pAnn, o, token.beginLine, token.beginColumn);
PropertyListPathNotEmpty(x, acc);
jj_consume_token(R_ANN);
break;
+ }
default:
jj_la1[133] = jj_gen;
;
}
- }
+}
final public void Annotation(TripleCollector acc, Node s, Node p, Path path, Node o) throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case L_ANN:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case L_ANN:{
jj_consume_token(L_ANN);
- Node pAnn = preConditionAnnotation(s, p, path, o, token.beginLine, token.beginColumn) ;
+Node pAnn = preConditionAnnotation(s, p, path, o, token.beginLine, token.beginColumn) ;
Node x = createQuotedTriple(s, p, o, token.beginLine, token.beginColumn);
PropertyListNotEmpty(x, acc);
jj_consume_token(R_ANN);
break;
+ }
default:
jj_la1[134] = jj_gen;
;
}
- }
+}
- final public Node GraphNode(TripleCollectorMark acc) throws ParseException {
- Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node GraphNode(TripleCollectorMark acc) throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -4269,26 +4410,27 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL_LONG2:
case NIL:
case ANON:
- case LT2:
+ case LT2:{
n = VarOrTerm();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case LPAREN:
- case LBRACKET:
+ case LBRACKET:{
n = TriplesNode(acc);
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[135] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node GraphNodePath(TripleCollectorMark acc) throws ParseException {
- Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node GraphNodePath(TripleCollectorMark acc) throws ParseException {Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -4312,43 +4454,47 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL_LONG2:
case NIL:
case ANON:
- case LT2:
+ case LT2:{
n = VarOrTerm();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case LPAREN:
- case LBRACKET:
+ case LBRACKET:{
n = TriplesNodePath(acc);
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[136] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node VarOrTerm() throws ParseException {
- Node n = null ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node VarOrTerm() throws ParseException {Node n = null ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
n = Var();
break;
+ }
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- {if (true) return createNode(iri) ;}
+{if ("" != null) return createNode(iri) ;}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -4357,91 +4503,97 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case BLANK_NODE_LABEL:
- case ANON:
+ case ANON:{
n = BlankNode();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case NIL:
+ }
+ case NIL:{
jj_consume_token(NIL);
- {if (true) return nRDFnil ;}
+{if ("" != null) return nRDFnil ;}
break;
- case LT2:
+ }
+ case LT2:{
n = QuotedTriple();
break;
+ }
default:
jj_la1[137] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node QuotedTriple() throws ParseException {
- Node n = null ; Token t ; Node s , p , o ;
+ final public Node QuotedTriple() throws ParseException {Node n = null ; Token t ; Node s , p , o ;
t = jj_consume_token(LT2);
s = VarOrTerm();
p = Verb();
o = VarOrTerm();
- n = createQuotedTriple(s, p, o, t.beginLine, t.beginColumn);
+n = createQuotedTriple(s, p, o, t.beginLine, t.beginColumn);
jj_consume_token(GT2);
- {if (true) return n;}
+{if ("" != null) return n;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node QuotedTripleData() throws ParseException {
- Node n = null ; Token t ; String iri ; Node s , p , o ;
+ final public Node QuotedTripleData() throws ParseException {Node n = null ; Token t ; String iri ; Node s , p , o ;
t = jj_consume_token(LT2);
s = DataValueTerm();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- p = createNode(iri) ;
+p = createNode(iri) ;
break;
- case KW_A:
+ }
+ case KW_A:{
jj_consume_token(KW_A);
- p = nRDFtype ;
+p = nRDFtype ;
break;
+ }
default:
jj_la1[138] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
o = DataValueTerm();
- n = createQuotedTriple(s, p, o, t.beginLine, t.beginColumn);
+n = createQuotedTriple(s, p, o, t.beginLine, t.beginColumn);
jj_consume_token(GT2);
- {if (true) return n;}
+{if ("" != null) return n;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node DataValueTerm() throws ParseException {
- Node n = null ; String iri ; Node s , p , o ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node DataValueTerm() throws ParseException {Node n = null ; String iri ; Node s , p , o ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- {if (true) return createNode(iri) ;}
+{if ("" != null) return createNode(iri) ;}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -4450,153 +4602,157 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
- case LT2:
+ }
+ case LT2:{
n = QuotedTripleData();
- {if (true) return n ;}
+{if ("" != null) return n ;}
break;
+ }
default:
jj_la1[139] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node VarOrIri() throws ParseException {
- Node n = null ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node VarOrIri() throws ParseException {Node n = null ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
n = Var();
break;
+ }
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- n = createNode(iri) ;
+n = createNode(iri) ;
break;
+ }
default:
jj_la1[140] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node VarOrBlankNodeOrIri() throws ParseException {
- Node n = null ; String iri ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node VarOrBlankNodeOrIri() throws ParseException {Node n = null ; String iri ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case VAR1:
- case VAR2:
+ case VAR2:{
n = Var();
break;
+ }
case BLANK_NODE_LABEL:
- case ANON:
+ case ANON:{
n = BlankNode();
break;
+ }
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
iri = iri();
- n = createNode(iri) ;
+n = createNode(iri) ;
break;
+ }
default:
jj_la1[141] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return n ;}
+{if ("" != null) return n ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Var Var() throws ParseException {
- Token t ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VAR1:
+ final public Var Var() throws ParseException {Token t ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case VAR1:{
t = jj_consume_token(VAR1);
break;
- case VAR2:
+ }
+ case VAR2:{
t = jj_consume_token(VAR2);
break;
+ }
default:
jj_la1[142] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return createVariable(t.image, t.beginLine, t.beginColumn) ;}
+{if ("" != null) return createVariable(t.image, t.beginLine, t.beginColumn) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr Expression() throws ParseException {
- Expr expr ;
+ final public Expr Expression() throws ParseException {Expr expr ;
expr = ConditionalOrExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr ConditionalOrExpression() throws ParseException {
- Expr expr1, expr2 ;
+ final public Expr ConditionalOrExpression() throws ParseException {Expr expr1, expr2 ;
expr1 = ConditionalAndExpression();
label_37:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SC_OR:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SC_OR:{
;
break;
+ }
default:
jj_la1[143] = jj_gen;
break label_37;
}
jj_consume_token(SC_OR);
expr2 = ConditionalAndExpression();
- expr1 = new E_LogicalOr(expr1, expr2) ;
+expr1 = new E_LogicalOr(expr1, expr2) ;
}
- {if (true) return expr1 ;}
+{if ("" != null) return expr1 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr ConditionalAndExpression() throws ParseException {
- Expr expr1, expr2 ;
+ final public Expr ConditionalAndExpression() throws ParseException {Expr expr1, expr2 ;
expr1 = ValueLogical();
label_38:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SC_AND:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case SC_AND:{
;
break;
+ }
default:
jj_la1[144] = jj_gen;
break label_38;
}
jj_consume_token(SC_AND);
expr2 = ValueLogical();
- expr1 = new E_LogicalAnd(expr1, expr2) ;
+expr1 = new E_LogicalAnd(expr1, expr2) ;
}
- {if (true) return expr1 ;}
+{if ("" != null) return expr1 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr ValueLogical() throws ParseException {
- Expr expr ;
+ final public Expr ValueLogical() throws ParseException {Expr expr ;
expr = RelationalExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr RelationalExpression() throws ParseException {
- Expr expr1, expr2 ; ExprList a ;
+ final public Expr RelationalExpression() throws ParseException {Expr expr1, expr2 ; ExprList a ;
expr1 = NumericExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case NOT:
case IN:
case EQ:
@@ -4604,76 +4760,83 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case GT:
case LT:
case LE:
- case GE:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
+ case GE:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case EQ:{
jj_consume_token(EQ);
expr2 = NumericExpression();
- expr1 = new E_Equals(expr1, expr2) ;
+expr1 = new E_Equals(expr1, expr2) ;
break;
- case NE:
+ }
+ case NE:{
jj_consume_token(NE);
expr2 = NumericExpression();
- expr1 = new E_NotEquals(expr1, expr2) ;
+expr1 = new E_NotEquals(expr1, expr2) ;
break;
- case LT:
+ }
+ case LT:{
jj_consume_token(LT);
expr2 = NumericExpression();
- expr1 = new E_LessThan(expr1, expr2) ;
+expr1 = new E_LessThan(expr1, expr2) ;
break;
- case GT:
+ }
+ case GT:{
jj_consume_token(GT);
expr2 = NumericExpression();
- expr1 = new E_GreaterThan(expr1, expr2) ;
+expr1 = new E_GreaterThan(expr1, expr2) ;
break;
- case LE:
+ }
+ case LE:{
jj_consume_token(LE);
expr2 = NumericExpression();
- expr1 = new E_LessThanOrEqual(expr1, expr2) ;
+expr1 = new E_LessThanOrEqual(expr1, expr2) ;
break;
- case GE:
+ }
+ case GE:{
jj_consume_token(GE);
expr2 = NumericExpression();
- expr1 = new E_GreaterThanOrEqual(expr1, expr2) ;
+expr1 = new E_GreaterThanOrEqual(expr1, expr2) ;
break;
- case IN:
+ }
+ case IN:{
jj_consume_token(IN);
a = ExpressionList();
- expr1 = new E_OneOf(expr1, a) ;
+expr1 = new E_OneOf(expr1, a) ;
break;
- case NOT:
+ }
+ case NOT:{
jj_consume_token(NOT);
jj_consume_token(IN);
a = ExpressionList();
- expr1 = new E_NotOneOf(expr1, a) ;
+expr1 = new E_NotOneOf(expr1, a) ;
break;
+ }
default:
jj_la1[145] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
+ }
default:
jj_la1[146] = jj_gen;
;
}
- {if (true) return expr1 ;}
+{if ("" != null) return expr1 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr NumericExpression() throws ParseException {
- Expr expr ;
+ final public Expr NumericExpression() throws ParseException {Expr expr ;
expr = AdditiveExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr AdditiveExpression() throws ParseException {
- Expr expr1, expr2, expr3 ; boolean addition ; Node n ;
+ final public Expr AdditiveExpression() throws ParseException {Expr expr1, expr2, expr3 ; boolean addition ; Node n ;
expr1 = MultiplicativeExpression();
label_39:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case INTEGER_POSITIVE:
case DECIMAL_POSITIVE:
case DOUBLE_POSITIVE:
@@ -4681,47 +4844,52 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DECIMAL_NEGATIVE:
case DOUBLE_NEGATIVE:
case PLUS:
- case MINUS:
+ case MINUS:{
;
break;
+ }
default:
jj_la1[147] = jj_gen;
break label_39;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case PLUS:{
jj_consume_token(PLUS);
expr2 = MultiplicativeExpression();
- expr1 = new E_Add(expr1, expr2) ;
+expr1 = new E_Add(expr1, expr2) ;
break;
- case MINUS:
+ }
+ case MINUS:{
jj_consume_token(MINUS);
expr2 = MultiplicativeExpression();
- expr1 = new E_Subtract(expr1, expr2) ;
+expr1 = new E_Subtract(expr1, expr2) ;
break;
+ }
case INTEGER_POSITIVE:
case DECIMAL_POSITIVE:
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case DOUBLE_NEGATIVE:{
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case INTEGER_POSITIVE:
case DECIMAL_POSITIVE:
- case DOUBLE_POSITIVE:
+ case DOUBLE_POSITIVE:{
n = NumericLiteralPositive();
- n = stripSign(n) ;
+n = stripSign(n) ;
expr2 = asExpr(n) ;
addition = true ;
break;
+ }
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteralNegative();
- n = stripSign(n) ;
+n = stripSign(n) ;
expr2 = asExpr(n) ;
addition = false ;
break;
+ }
default:
jj_la1[148] = jj_gen;
jj_consume_token(-1);
@@ -4729,112 +4897,122 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
}
label_40:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case STAR:
- case SLASH:
+ case SLASH:{
;
break;
+ }
default:
jj_la1[149] = jj_gen;
break label_40;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STAR:{
jj_consume_token(STAR);
expr3 = UnaryExpression();
- expr2 = new E_Multiply(expr2, expr3) ;
+expr2 = new E_Multiply(expr2, expr3) ;
break;
- case SLASH:
+ }
+ case SLASH:{
jj_consume_token(SLASH);
expr3 = UnaryExpression();
- expr2 = new E_Divide(expr2, expr3) ;
+expr2 = new E_Divide(expr2, expr3) ;
break;
+ }
default:
jj_la1[150] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
- if ( addition )
+if ( addition )
expr1 = new E_Add(expr1, expr2) ;
else
expr1 = new E_Subtract(expr1, expr2) ;
break;
+ }
default:
jj_la1[151] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
- {if (true) return expr1 ;}
+{if ("" != null) return expr1 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr MultiplicativeExpression() throws ParseException {
- Expr expr1, expr2 ;
+ final public Expr MultiplicativeExpression() throws ParseException {Expr expr1, expr2 ;
expr1 = UnaryExpression();
label_41:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case MOD:
case IDIV:
case STAR:
- case SLASH:
+ case SLASH:{
;
break;
+ }
default:
jj_la1[152] = jj_gen;
break label_41;
}
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case STAR:{
jj_consume_token(STAR);
expr2 = UnaryExpression();
- expr1 = new E_Multiply(expr1, expr2) ;
+expr1 = new E_Multiply(expr1, expr2) ;
break;
- case SLASH:
+ }
+ case SLASH:{
jj_consume_token(SLASH);
expr2 = UnaryExpression();
- expr1 = new E_Divide(expr1, expr2) ;
+expr1 = new E_Divide(expr1, expr2) ;
break;
- case MOD:
+ }
+ case MOD:{
jj_consume_token(MOD);
expr2 = UnaryExpression();
- expr1 = new E_OpNumericMod(expr1, expr2) ;
+expr1 = new E_OpNumericMod(expr1, expr2) ;
break;
- case IDIV:
+ }
+ case IDIV:{
jj_consume_token(IDIV);
expr2 = UnaryExpression();
- expr1 = new E_OpNumericIntegerDivide(expr1, expr2) ;
+expr1 = new E_OpNumericIntegerDivide(expr1, expr2) ;
break;
+ }
default:
jj_la1[153] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
- {if (true) return expr1 ;}
+{if ("" != null) return expr1 ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr UnaryExpression() throws ParseException {
- Expr expr ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BANG:
+ final public Expr UnaryExpression() throws ParseException {Expr expr ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case BANG:{
jj_consume_token(BANG);
expr = PrimaryExpression();
- {if (true) return new E_LogicalNot(expr) ;}
+{if ("" != null) return new E_LogicalNot(expr) ;}
break;
- case PLUS:
+ }
+ case PLUS:{
jj_consume_token(PLUS);
expr = PrimaryExpression();
- {if (true) return new E_UnaryPlus(expr) ;}
+{if ("" != null) return new E_UnaryPlus(expr) ;}
break;
- case MINUS:
+ }
+ case MINUS:{
jj_consume_token(MINUS);
expr = PrimaryExpression();
- {if (true) return new E_UnaryMinus(expr) ;}
+{if ("" != null) return new E_UnaryMinus(expr) ;}
break;
+ }
case IRIref:
case PNAME_NS:
case PNAME_LN:
@@ -4937,25 +5115,26 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case STRING_LITERAL_LONG1:
case STRING_LITERAL_LONG2:
case LPAREN:
- case LT2:
+ case LT2:{
expr = PrimaryExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
+ }
default:
jj_la1[154] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr PrimaryExpression() throws ParseException {
- Expr expr ; Node n ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ final public Expr PrimaryExpression() throws ParseException {Expr expr ; Node n ;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
expr = BrackettedExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
+ }
case TRIPLE:
case IS_TRIPLE:
case SUBJECT:
@@ -5036,23 +5215,26 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case SHA1:
case SHA256:
case SHA384:
- case SHA512:
+ case SHA512:{
expr = BuiltInCall();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
+ }
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
expr = iriOrFunction();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
- {if (true) return asExpr(n) ;}
+{if ("" != null) return asExpr(n) ;}
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -5061,47 +5243,52 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteral();
- {if (true) return asExpr(n) ;}
+{if ("" != null) return asExpr(n) ;}
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
- {if (true) return asExpr(n) ;}
+{if ("" != null) return asExpr(n) ;}
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
n = Var();
- {if (true) return asExpr(n) ;}
+{if ("" != null) return asExpr(n) ;}
break;
- case LT2:
+ }
+ case LT2:{
n = ExprQuotedTriple();
- {if (true) return asExpr(n) ;}
+{if ("" != null) return asExpr(n) ;}
break;
+ }
default:
jj_la1[155] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Node ExprVarOrTerm() throws ParseException {
- Node n; String s;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ final public Node ExprVarOrTerm() throws ParseException {Node n; String s;
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case IRIref:
case PNAME_NS:
- case PNAME_LN:
+ case PNAME_LN:{
s = iri();
- n = createNode(s);
+n = createNode(s);
break;
+ }
case STRING_LITERAL1:
case STRING_LITERAL2:
case STRING_LITERAL_LONG1:
- case STRING_LITERAL_LONG2:
+ case STRING_LITERAL_LONG2:{
n = RDFLiteral();
break;
+ }
case INTEGER:
case DECIMAL:
case DOUBLE:
@@ -5110,55 +5297,56 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case DOUBLE_POSITIVE:
case INTEGER_NEGATIVE:
case DECIMAL_NEGATIVE:
- case DOUBLE_NEGATIVE:
+ case DOUBLE_NEGATIVE:{
n = NumericLiteral();
break;
+ }
case TRUE:
- case FALSE:
+ case FALSE:{
n = BooleanLiteral();
break;
+ }
case VAR1:
- case VAR2:
+ case VAR2:{
n = Var();
break;
- case LT2:
+ }
+ case LT2:{
n = ExprQuotedTriple();
break;
+ }
default:
jj_la1[156] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
- {if (true) return n;}
+{if ("" != null) return n;}
throw new Error("Missing return statement in function");
- }
+}
- final public Node ExprQuotedTriple() throws ParseException {
- Token t ; Node s,p,o,n;
+ final public Node ExprQuotedTriple() throws ParseException {Token t ; Node s,p,o,n;
t = jj_consume_token(LT2);
s = ExprVarOrTerm();
p = Verb();
o = ExprVarOrTerm();
- n = createQuotedTriple(s, p, o, t.beginLine, t.beginColumn);
+n = createQuotedTriple(s, p, o, t.beginLine, t.beginColumn);
jj_consume_token(GT2);
- {if (true) return n;}
+{if ("" != null) return n;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr BrackettedExpression() throws ParseException {
- Expr expr ;
+ final public Expr BrackettedExpression() throws ParseException {Expr expr ;
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr BuiltInCall() throws ParseException {
- Expr expr ;
+ final public Expr BuiltInCall() throws ParseException {Expr expr ;
Expr expr1 = null ; Expr expr2 = null ; Expr expr3 = null ;
Node gn ; ExprList a ;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case AGG:
case COUNT:
case MIN:
@@ -5175,391 +5363,445 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
case VAR_POP:
case FOLD:
case SAMPLE:
- case GROUP_CONCAT:
+ case GROUP_CONCAT:{
expr = Aggregate();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
- case STR:
+ }
+ case STR:{
jj_consume_token(STR);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_Str(expr) ;}
+{if ("" != null) return new E_Str(expr) ;}
break;
- case LANG:
+ }
+ case LANG:{
jj_consume_token(LANG);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_Lang(expr) ;}
+{if ("" != null) return new E_Lang(expr) ;}
break;
- case LANGMATCHES:
+ }
+ case LANGMATCHES:{
jj_consume_token(LANGMATCHES);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_LangMatches(expr1, expr2) ;}
+{if ("" != null) return new E_LangMatches(expr1, expr2) ;}
break;
- case DTYPE:
+ }
+ case DTYPE:{
jj_consume_token(DTYPE);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_Datatype(expr) ;}
+{if ("" != null) return new E_Datatype(expr) ;}
break;
- case BOUND:
+ }
+ case BOUND:{
jj_consume_token(BOUND);
jj_consume_token(LPAREN);
gn = Var();
jj_consume_token(RPAREN);
- {if (true) return new E_Bound(new ExprVar(gn)) ;}
+{if ("" != null) return new E_Bound(new ExprVar(gn)) ;}
break;
- case IRI:
+ }
+ case IRI:{
jj_consume_token(IRI);
jj_consume_token(LPAREN);
expr1 = Expression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
jj_consume_token(COMMA);
expr2 = Expression();
break;
+ }
default:
jj_la1[157] = jj_gen;
;
}
jj_consume_token(RPAREN);
- {if (true) return makeFunction_IRI(expr1, expr2) ;}
+{if ("" != null) return makeFunction_IRI(expr1, expr2) ;}
break;
- case URI:
+ }
+ case URI:{
jj_consume_token(URI);
jj_consume_token(LPAREN);
expr1 = Expression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
jj_consume_token(COMMA);
expr2 = Expression();
break;
+ }
default:
jj_la1[158] = jj_gen;
;
}
jj_consume_token(RPAREN);
- {if (true) return makeFunction_URI(expr1, expr2) ;}
+{if ("" != null) return makeFunction_URI(expr1, expr2) ;}
break;
- case BNODE:
+ }
+ case BNODE:{
jj_consume_token(BNODE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case LPAREN:{
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return makeFunction_BNode(expr1) ;}
+{if ("" != null) return makeFunction_BNode(expr1) ;}
break;
- case NIL:
+ }
+ case NIL:{
jj_consume_token(NIL);
- {if (true) return makeFunction_BNode() ;}
+{if ("" != null) return makeFunction_BNode() ;}
break;
+ }
default:
jj_la1[159] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
- case RAND:
+ }
+ case RAND:{
jj_consume_token(RAND);
jj_consume_token(NIL);
- {if (true) return new E_Random() ;}
+{if ("" != null) return new E_Random() ;}
break;
- case ABS:
+ }
+ case ABS:{
jj_consume_token(ABS);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_NumAbs(expr1) ;}
+{if ("" != null) return new E_NumAbs(expr1) ;}
break;
- case CEIL:
+ }
+ case CEIL:{
jj_consume_token(CEIL);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_NumCeiling(expr1) ;}
+{if ("" != null) return new E_NumCeiling(expr1) ;}
break;
- case FLOOR:
+ }
+ case FLOOR:{
jj_consume_token(FLOOR);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_NumFloor(expr1) ;}
+{if ("" != null) return new E_NumFloor(expr1) ;}
break;
- case ROUND:
+ }
+ case ROUND:{
jj_consume_token(ROUND);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_NumRound(expr1) ;}
+{if ("" != null) return new E_NumRound(expr1) ;}
break;
- case MOD:
+ }
+ case MOD:{
jj_consume_token(MOD);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_OpNumericMod(expr1, expr2);}
+{if ("" != null) return new E_OpNumericMod(expr1, expr2);}
break;
- case IDIV:
+ }
+ case IDIV:{
jj_consume_token(IDIV);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_OpNumericIntegerDivide(expr1, expr2);}
+{if ("" != null) return new E_OpNumericIntegerDivide(expr1, expr2);}
break;
- case CONCAT:
+ }
+ case CONCAT:{
jj_consume_token(CONCAT);
a = ExpressionList();
- {if (true) return new E_StrConcat(a) ;}
+{if ("" != null) return new E_StrConcat(a) ;}
break;
- case SUBSTR:
+ }
+ case SUBSTR:{
expr = SubstringExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
- case STRLEN:
+ }
+ case STRLEN:{
jj_consume_token(STRLEN);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrLength(expr1) ;}
+{if ("" != null) return new E_StrLength(expr1) ;}
break;
- case REPLACE:
+ }
+ case REPLACE:{
expr = StrReplaceExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
- case UCASE:
+ }
+ case UCASE:{
jj_consume_token(UCASE);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrUpperCase(expr1) ;}
+{if ("" != null) return new E_StrUpperCase(expr1) ;}
break;
- case LCASE:
+ }
+ case LCASE:{
jj_consume_token(LCASE);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrLowerCase(expr1) ;}
+{if ("" != null) return new E_StrLowerCase(expr1) ;}
break;
- case ENCODE_FOR_URI:
+ }
+ case ENCODE_FOR_URI:{
jj_consume_token(ENCODE_FOR_URI);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrEncodeForURI(expr1) ;}
+{if ("" != null) return new E_StrEncodeForURI(expr1) ;}
break;
- case CONTAINS:
+ }
+ case CONTAINS:{
jj_consume_token(CONTAINS);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrContains(expr1, expr2) ;}
+{if ("" != null) return new E_StrContains(expr1, expr2) ;}
break;
- case STRSTARTS:
+ }
+ case STRSTARTS:{
jj_consume_token(STRSTARTS);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrStartsWith(expr1, expr2) ;}
+{if ("" != null) return new E_StrStartsWith(expr1, expr2) ;}
break;
- case STRENDS:
+ }
+ case STRENDS:{
jj_consume_token(STRENDS);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrEndsWith(expr1, expr2) ;}
+{if ("" != null) return new E_StrEndsWith(expr1, expr2) ;}
break;
- case STRBEFORE:
+ }
+ case STRBEFORE:{
jj_consume_token(STRBEFORE);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrBefore(expr1, expr2) ;}
+{if ("" != null) return new E_StrBefore(expr1, expr2) ;}
break;
- case STRAFTER:
+ }
+ case STRAFTER:{
jj_consume_token(STRAFTER);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrAfter(expr1, expr2) ;}
+{if ("" != null) return new E_StrAfter(expr1, expr2) ;}
break;
- case YEAR:
+ }
+ case YEAR:{
jj_consume_token(YEAR);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeYear(expr1) ;}
+{if ("" != null) return new E_DateTimeYear(expr1) ;}
break;
- case MONTH:
+ }
+ case MONTH:{
jj_consume_token(MONTH);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeMonth(expr1) ;}
+{if ("" != null) return new E_DateTimeMonth(expr1) ;}
break;
- case DAY:
+ }
+ case DAY:{
jj_consume_token(DAY);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeDay(expr1) ;}
+{if ("" != null) return new E_DateTimeDay(expr1) ;}
break;
- case HOURS:
+ }
+ case HOURS:{
jj_consume_token(HOURS);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeHours(expr1) ;}
+{if ("" != null) return new E_DateTimeHours(expr1) ;}
break;
- case MINUTES:
+ }
+ case MINUTES:{
jj_consume_token(MINUTES);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeMinutes(expr1) ;}
+{if ("" != null) return new E_DateTimeMinutes(expr1) ;}
break;
- case SECONDS:
+ }
+ case SECONDS:{
jj_consume_token(SECONDS);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeSeconds(expr1) ;}
+{if ("" != null) return new E_DateTimeSeconds(expr1) ;}
break;
- case TIMEZONE:
+ }
+ case TIMEZONE:{
jj_consume_token(TIMEZONE);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeTimezone(expr1) ;}
+{if ("" != null) return new E_DateTimeTimezone(expr1) ;}
break;
- case TZ:
+ }
+ case TZ:{
jj_consume_token(TZ);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_DateTimeTZ(expr1) ;}
+{if ("" != null) return new E_DateTimeTZ(expr1) ;}
break;
- case ADJUST:
+ }
+ case ADJUST:{
jj_consume_token(ADJUST);
jj_consume_token(LPAREN);
expr1 = Expression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
jj_consume_token(COMMA);
expr2 = Expression();
break;
+ }
default:
jj_la1[160] = jj_gen;
;
}
jj_consume_token(RPAREN);
- {if (true) return new E_AdjustToTimezone(expr1, expr2) ;}
+{if ("" != null) return new E_AdjustToTimezone(expr1, expr2) ;}
break;
- case NOW:
+ }
+ case NOW:{
jj_consume_token(NOW);
jj_consume_token(NIL);
- {if (true) return new E_Now() ;}
+{if ("" != null) return new E_Now() ;}
break;
- case UUID:
+ }
+ case UUID:{
jj_consume_token(UUID);
jj_consume_token(NIL);
- {if (true) return new E_UUID() ;}
+{if ("" != null) return new E_UUID() ;}
break;
- case STRUUID:
+ }
+ case STRUUID:{
jj_consume_token(STRUUID);
jj_consume_token(NIL);
- {if (true) return new E_StrUUID() ;}
+{if ("" != null) return new E_StrUUID() ;}
break;
- case MD5:
+ }
+ case MD5:{
jj_consume_token(MD5);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_MD5(expr1) ;}
+{if ("" != null) return new E_MD5(expr1) ;}
break;
- case SHA1:
+ }
+ case SHA1:{
jj_consume_token(SHA1);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_SHA1(expr1) ;}
+{if ("" != null) return new E_SHA1(expr1) ;}
break;
- case SHA256:
+ }
+ case SHA256:{
jj_consume_token(SHA256);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_SHA256(expr1) ;}
+{if ("" != null) return new E_SHA256(expr1) ;}
break;
- case SHA384:
+ }
+ case SHA384:{
jj_consume_token(SHA384);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_SHA384(expr1) ;}
+{if ("" != null) return new E_SHA384(expr1) ;}
break;
- case SHA512:
+ }
+ case SHA512:{
jj_consume_token(SHA512);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_SHA512(expr1) ;}
+{if ("" != null) return new E_SHA512(expr1) ;}
break;
- case VERSION:
+ }
+ case VERSION:{
jj_consume_token(VERSION);
jj_consume_token(NIL);
- {if (true) return new E_Version();}
+{if ("" != null) return new E_Version();}
break;
- case COALESCE:
+ }
+ case COALESCE:{
jj_consume_token(COALESCE);
a = ExpressionList();
- {if (true) return new E_Coalesce(a) ;}
+{if ("" != null) return new E_Coalesce(a) ;}
break;
- case CALL:
+ }
+ case CALL:{
jj_consume_token(CALL);
- a = new ExprList() ;
+a = new ExprList() ;
jj_consume_token(LPAREN);
expr = Expression();
- a.add(expr) ;
+a.add(expr) ;
label_42:
while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
;
break;
+ }
default:
jj_la1[161] = jj_gen;
break label_42;
}
jj_consume_token(COMMA);
expr = Expression();
- a.add(expr) ;
+a.add(expr) ;
}
jj_consume_token(RPAREN);
- {if (true) return new E_Call(a) ;}
+{if ("" != null) return new E_Call(a) ;}
break;
- case IF:
+ }
+ case IF:{
jj_consume_token(IF);
jj_consume_token(LPAREN);
expr = Expression();
@@ -5568,90 +5810,103 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_Conditional(expr, expr1, expr2) ;}
+{if ("" != null) return new E_Conditional(expr, expr1, expr2) ;}
break;
- case STRLANG:
+ }
+ case STRLANG:{
jj_consume_token(STRLANG);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrLang(expr1, expr2) ;}
+{if ("" != null) return new E_StrLang(expr1, expr2) ;}
break;
- case STRDT:
+ }
+ case STRDT:{
jj_consume_token(STRDT);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_StrDatatype(expr1, expr2) ;}
+{if ("" != null) return new E_StrDatatype(expr1, expr2) ;}
break;
- case SAME_TERM:
+ }
+ case SAME_TERM:{
jj_consume_token(SAME_TERM);
jj_consume_token(LPAREN);
expr1 = Expression();
jj_consume_token(COMMA);
expr2 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_SameTerm(expr1, expr2) ;}
+{if ("" != null) return new E_SameTerm(expr1, expr2) ;}
break;
- case IS_IRI:
+ }
+ case IS_IRI:{
jj_consume_token(IS_IRI);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_IsIRI(expr) ;}
+{if ("" != null) return new E_IsIRI(expr) ;}
break;
- case IS_URI:
+ }
+ case IS_URI:{
jj_consume_token(IS_URI);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_IsURI(expr) ;}
+{if ("" != null) return new E_IsURI(expr) ;}
break;
- case IS_BLANK:
+ }
+ case IS_BLANK:{
jj_consume_token(IS_BLANK);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_IsBlank(expr) ;}
+{if ("" != null) return new E_IsBlank(expr) ;}
break;
- case IS_LITERAL:
+ }
+ case IS_LITERAL:{
jj_consume_token(IS_LITERAL);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_IsLiteral(expr) ;}
+{if ("" != null) return new E_IsLiteral(expr) ;}
break;
- case IS_NUMERIC:
+ }
+ case IS_NUMERIC:{
jj_consume_token(IS_NUMERIC);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_IsNumeric(expr) ;}
+{if ("" != null) return new E_IsNumeric(expr) ;}
break;
- case REGEX:
+ }
+ case REGEX:{
expr = RegexExpression();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
- case EXISTS:
+ }
+ case EXISTS:{
expr = ExistsFunc();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
- case NOT:
+ }
+ case NOT:{
expr = NotExistsFunc();
- {if (true) return expr ;}
+{if ("" != null) return expr ;}
break;
- case IS_TRIPLE:
+ }
+ case IS_TRIPLE:{
jj_consume_token(IS_TRIPLE);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_IsTriple(expr) ;}
+{if ("" != null) return new E_IsTriple(expr) ;}
break;
- case TRIPLE:
+ }
+ case TRIPLE:{
jj_consume_token(TRIPLE);
jj_consume_token(LPAREN);
expr1 = Expression();
@@ -5660,81 +5915,84 @@ public class ARQParser extends ARQParserBase implements ARQParserConstants {
jj_consume_token(COMMA);
expr3 = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_TripleFn(expr1, expr2, expr3) ;}
+{if ("" != null) return new E_TripleFn(expr1, expr2, expr3) ;}
break;
- case SUBJECT:
+ }
+ case SUBJECT:{
jj_consume_token(SUBJECT);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_TripleSubject(expr) ;}
+{if ("" != null) return new E_TripleSubject(expr) ;}
break;
- case PREDICATE:
+ }
+ case PREDICATE:{
jj_consume_token(PREDICATE);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_TriplePredicate(expr) ;}
+{if ("" != null) return new E_TriplePredicate(expr) ;}
break;
- case OBJECT:
+ }
+ case OBJECT:{
jj_consume_token(OBJECT);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(RPAREN);
- {if (true) return new E_TripleObject(expr) ;}
+{if ("" != null) return new E_TripleObject(expr) ;}
break;
+ }
default:
jj_la1[162] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr RegexExpression() throws ParseException {
- Expr expr ; Expr patExpr = null ; Expr flagsExpr = null ;
+ final public Expr RegexExpression() throws ParseException {Expr expr ; Expr patExpr = null ; Expr flagsExpr = null ;
jj_consume_token(REGEX);
jj_consume_token(LPAREN);
expr = Expression();
jj_consume_token(COMMA);
patExpr = Expression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
+ switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
+ case COMMA:{
jj_consume_token(COMMA);
flagsExpr = Expression();
break;
+ }
default:
jj_la1[163] = jj_gen;
;
}
jj_consume_token(RPAREN);
- {if (true) return new E_Regex(expr, patExpr, flagsExpr) ;}
+{if ("" != null) return new E_Regex(expr, patExpr, flagsExpr) ;}
throw new Error("Missing return statement in function");
- }
+}
- final public Expr SubstringExpression() throws ParseException {
- Expr expr1 ; Expr expr2 = null ; Expr expr3 = null ;
+ final public Expr SubstringExpression() throws ParseException {Expr expr1 ; Expr expr2 = null ; Expr expr3 = null ;
jj_consume_token(SUBSTR);
... 6368 lines suppressed ...