You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "yurloc (via GitHub)" <gi...@apache.org> on 2024/02/20 22:42:49 UTC
[I] [new-parser] OOPath in queries doesn't work [incubator-kie-drools]
yurloc opened a new issue, #5711:
URL: https://github.com/apache/incubator-kie-drools/issues/5711
## Parent issue
- #5678
## Failing tests
- `org.drools.model.codegen.execmodel.QueryTest#testQueryWithOOPath`
## Notes
- Both `STANDARD_FROM_DRL` and `PATTERN_DSL`.
## Rule code snippet
```
query listSafeCities
$cities : List() from accumulate (Person ( $city: /address#InternationalAddress[state == "Safecountry"]/city), collectList($city))
end
```
## Error output
```
### parse : ANTLR4_PARSER_ENABLED = true
line 2:50 no viable alternative at input '(Person ( $city: /'
line 2:50 no viable alternative at input '$city: /'
line 2:50 extraneous input '/' expecting {'unit', 'function', 'global', 'declare', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'matches', 'memberOf', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'agenda-group', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', '(', '?', IDENTIFIER}
line 2:58 mismatched input '#' expecting {'(', '.'}
line 2:129 extraneous input ')' expecting {'unit', 'function', 'global', 'declare', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'matches', 'memberOf', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'forall', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'agenda-group', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', '(', '?', IDENTIFIER}
21:45:06.913 [main] ERROR o.d.d.parser.antlr4.DRLParserWrapper.parse:77 - Exception while creating PackageDescr
java.lang.IllegalStateException: ctx.lhsPattern().size() == 0 :
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitLhsPatternBind(DRLVisitorImpl.java:441)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitLhsPatternBind(DRLVisitorImpl.java:74)
at org.drools.drl.parser.antlr4.DRLParser$LhsPatternBindContext.accept(DRLParser.java:1961)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitDescrChildren(DRLVisitorImpl.java:795)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitLhsUnary(DRLVisitorImpl.java:775)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitLhsUnary(DRLVisitorImpl.java:74)
at org.drools.drl.parser.antlr4.DRLParser$LhsUnaryContext.accept(DRLParser.java:1862)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitDescrChildren(DRLVisitorImpl.java:795)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.lambda$visitQuerydef$4(DRLVisitorImpl.java:307)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitQuerydef(DRLVisitorImpl.java:308)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitQuerydef(DRLVisitorImpl.java:74)
at org.drools.drl.parser.antlr4.DRLParser$QuerydefContext.accept(DRLParser.java:1321)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
at org.drools.drl.parser.antlr4.DRLParserBaseVisitor.visitDrlStatementdef(DRLParserBaseVisitor.java:27)
at org.drools.drl.parser.antlr4.DRLParser$DrlStatementdefContext.accept(DRLParser.java:405)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitDescrChildren(DRLVisitorImpl.java:795)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitCompilationUnit(DRLVisitorImpl.java:91)
at org.drools.drl.parser.antlr4.DRLVisitorImpl.visitCompilationUnit(DRLVisitorImpl.java:74)
at org.drools.drl.parser.antlr4.DRLParser$CompilationUnitContext.accept(DRLParser.java:318)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
at org.drools.drl.parser.antlr4.DRLParserHelper.compilationUnitContext2PackageDescr(DRLParserHelper.java:87)
at org.drools.drl.parser.antlr4.DRLParserWrapper.parse(DRLParserWrapper.java:75)
at org.drools.drl.parser.antlr4.DRLParserWrapper.parse(DRLParserWrapper.java:55)
at org.drools.drl.parser.DrlParser.lambda$parse$2(DrlParser.java:189)
at org.drools.drl.parser.DrlParser.compileWithAntlr4Parser(DrlParser.java:202)
at org.drools.drl.parser.DrlParser.parse(DrlParser.java:189)
at org.drools.drl.parser.DrlParser.parse(DrlParser.java:177)
at org.drools.drl.parser.DrlParser.parse(DrlParser.java:166)
at org.drools.compiler.builder.impl.resources.DrlResourceHandler.process(DrlResourceHandler.java:55)
at org.drools.compiler.builder.impl.PackageDescrBuilder.buildResource(PackageDescrBuilder.java:73)
at org.drools.compiler.builder.impl.PackageDescrBuilder.build(PackageDescrBuilder.java:51)
at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildPackageDescr(CompositeKnowledgeBuilderImpl.java:173)
at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:116)
at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:109)
at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:274)
at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:220)
at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:84)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:285)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:251)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:208)
at org.drools.model.codegen.execmodel.BaseModelTest.createKieBuilder(BaseModelTest.java:151)
at org.drools.model.codegen.execmodel.BaseModelTest.createKieBuilder(BaseModelTest.java:132)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieContainer(BaseModelTest.java:121)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieContainer(BaseModelTest.java:114)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieSession(BaseModelTest.java:110)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieSession(BaseModelTest.java:106)
at org.drools.model.codegen.execmodel.QueryTest.testQueryWithOOPath(QueryTest.java:300)
21:45:06.913 [main] ERROR o.d.c.k.b.impl.AbstractKieProject.buildKnowledgePackages:280 - Unable to build KieBaseModel:defaultKieBase
[2,50]: no viable alternative at input '(Person ( $city: /'
[2,50]: no viable alternative at input '$city: /'
[2,50]: extraneous input '/' expecting {'unit', 'function', 'global', 'declare', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'matches', 'memberOf', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'agenda-group', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', '(', '?', IDENTIFIER}
[2,58]: mismatched input '#' expecting {'(', '.'}
[2,129]: extraneous input ')' expecting {'unit', 'function', 'global', 'declare', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'matches', 'memberOf', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'forall', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'agenda-group', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', '(', '?', IDENTIFIER}
[0,0]:
[0,0]: Parser returned a null Package
java.lang.AssertionError: [Message [id=1, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0
text=no viable alternative at input '(Person ( $city: /'], Message [id=2, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0
text=no viable alternative at input '$city: /'], Message [id=3, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0
text=extraneous input '/' expecting {'unit', 'function', 'global', 'declare', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'matches', 'memberOf', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'agenda-group', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', '(', '?', IDENTIFIER}], Message [id=4, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0
text=mismatched input '#' expecting {'(', '.'}], Message [id=5, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0
text=extraneous input ')' expecting {'unit', 'function', 'global', 'declare', 'rule', 'query', 'when', 'then', 'end', 'and', 'or', 'exists', 'not', 'in', 'from', 'matches', 'memberOf', 'accumulate', 'acc', 'init', 'action', 'reverse', 'result', 'entry-point', 'eval', 'forall', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active', 'refract', 'direct', 'agenda-group', 'activation-group', 'ruleflow-group', 'date-effective', 'date-expires', 'dialect', 'calendars', 'timer', 'duration', 'module', 'open', 'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive', 'var', 'yield', 'record', 'sealed', 'permits', '(', '?', IDENTIFIER}], Message [id=6, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=0, column=0
text=], Message [id=7, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=0, column=0
text=Parser returned a null Package]]
at org.drools.model.codegen.execmodel.BaseModelTest.createKieBuilder(BaseModelTest.java:157)
at org.drools.model.codegen.execmodel.BaseModelTest.createKieBuilder(BaseModelTest.java:132)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieContainer(BaseModelTest.java:121)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieContainer(BaseModelTest.java:114)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieSession(BaseModelTest.java:110)
at org.drools.model.codegen.execmodel.BaseModelTest.getKieSession(BaseModelTest.java:106)
at org.drools.model.codegen.execmodel.QueryTest.testQueryWithOOPath(QueryTest.java:300)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] [new-parser] Broken OOPath expressions [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #5711:
URL: https://github.com/apache/incubator-kie-drools/issues/5711#issuecomment-2006142985
/take
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] [new-parser] Broken OOPath expressions [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #5711:
URL: https://github.com/apache/incubator-kie-drools/issues/5711#issuecomment-2022201155
Fixed by https://github.com/apache/incubator-kie-drools/pull/5805
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [I] [new-parser] Broken OOPath expressions [incubator-kie-drools]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas closed issue #5711: [new-parser] Broken OOPath expressions
URL: https://github.com/apache/incubator-kie-drools/issues/5711
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org