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

validation skipped on non-modified subjects #571

Open
dpetran opened this issue Sep 13, 2023 · 1 comment
Open

validation skipped on non-modified subjects #571

dpetran opened this issue Sep 13, 2023 · 1 comment
Labels
bug Something isn't working as expected

Comments

@dpetran
Copy link
Contributor

dpetran commented Sep 13, 2023

An ex:Person must have a ex:pet with an ex:tail that is datatype xsd:string:

{"@type"          "sh:NodeShape"
 "id"             "ex:personShape"
 "sh:targetClass" {"@id" "ex:Person"}
 "sh:property"    [{"sh:path" {"@list" [{"id" "ex:pet"}
                                        {"id" "ex:tail"}]}
 "sh:datatype" {"id" "xsd:string"}}]}

And we transact perfectly valid Person:

{"@id" "ex:pet-haver"
 "@type" "ex:Person"
 "ex:name" "Guy"
 "ex:pet" {"@id" "ex:dog"
           "ex:tail" "fluffy"}}

All is good.

But then, we update the pet:

{"@id" "ex:dog" "ex:tail" true}

This doesn't trigger validation at all, because we never touch the subject with the class that triggers this shape.

@dpetran
Copy link
Contributor Author

dpetran commented Sep 13, 2023

I have a general question:

  • How do we know which shapes need to be validated when we are processing a transaction?

We can't figure it out by just checking the types of the subjects that we modified, which is what we currently. So maybe we validate every shape? Or every shape that has a sh:path that has a predicate that is in the tx?

Which leads to a second question:

  • What do we have to validate after processing a transaction?

We currently start with the s-flakes of a subject that got changed, and then depending on the path and the constraints we may pull in other flakes. But if have to re-validate flakes that haven't changed, because of graph-crawling constraints in other shapes, we need a different way to constrain the scope so we don't have to re-validate the whole db: if we have a million Persons in the db, we don't want to re-validate all of them just because we changed one.

@dpetran dpetran added the bug Something isn't working as expected label Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

1 participant