ericprud commented on code in PR #1637:
URL: https://github.com/apache/jena/pull/1637#discussion_r1032589013
##########
jena-shex/src/main/java/org/apache/jena/shex/sys/ValidationContext.java:
##########
@@ -79,37 +127,81 @@ public void startValidate(ShexShape shape, Node data) {
// Return true if done or in-progress (i.e. don't walk further)
public boolean cycle(ShexShape shape, Node data) {
- return inProgress.stream().anyMatch(p->p.equalElts(data, shape));
+ return inProgress.stream().anyMatch(p -> p.equalElts(data, shape));
+ }
+
+ public boolean dispatchStartSemanticAction(ShexSchema schema,
ValidationContext vCxt) {
+ return !schema.getSemActs().stream().anyMatch(semAct -> {
+ String semActIri = semAct.getIri();
+ SemanticActionPlugin semActPlugin =
this.semActPluginIndex.get(semActIri);
+ if (semActPlugin != null) {
+ if (!semActPlugin.evaluateStart(semAct, schema)) {
+ vCxt.reportEntry(new ReportItem(String.format("%s start
shape failed", semActIri), null));
+ return true;
+ }
+ }
Review Comment:
Indeed. How about a contract where a plugin can [return (and passively
register) a specific
URL](https://github.com/apache/jena/pull/1637/files#diff-eac8e39fb9aaa5feae63ecad83a13992b4caef8b84ecc757239a7e4382875630R45-R49)
which gets called for any unregistered SemAct? You could pass an
implementation that throws or logs or pages a programmer.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]