Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separation of state between ShexValidator and ValidationContext #2

Open
ericprud opened this issue Jun 10, 2023 · 0 comments
Open

Separation of state between ShexValidator and ValidationContext #2

ericprud opened this issue Jun 10, 2023 · 0 comments
Assignees

Comments

@ericprud
Copy link

ericprud commented Jun 10, 2023

The life-cycle of a ShexValidator and the ability of users to supply specialized ValidationContexts will dictate which attributes appear in a validator vs a context.

currently:

ShexValidator:

    Collection<SemanticActionPlugin> semanticActionPlugins

ValidationContext:

    private final ShexSchema schema;
    private final Graph data;
    private ValidationContext parentCtx = null;
    private final Map<String, SemanticActionPlugin> semActPluginIndex;
    private final SorbeFactory sorbeFactory;
    private final Deque<ValidationStackElement> validationStack;

ShExMap needs access to the siblings and the arities of all expressions on the stack when any variable was bound.

Iovka and I discussed moving all state from the validator and making it static. Given that ShExMap needs access to the hierarchy of the AST (including cardinalities compiled out into TripleExprCardinalities), and that detailed error reporting could also benefit from such positioning, I'm currently tempted to move schema, data, and sorbeFactory from the context to the validator.

@ericprud ericprud changed the title Separation of state between [ShexValidator](https://github.com/fhircat/jena/blob/refactor-ast/jena-shex/src/main/java/org/apache/jena/shex/ShexValidator.java) and [ValidationContext](https://github.com/fhircat/jena/blob/refactor-ast/jena-shex/src/main/java/org/apache/jena/shex/validation/ValidationContext.java) Separation of state between ShexValidator and ValidationContext Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants