-
Notifications
You must be signed in to change notification settings - Fork 166
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
SHACL: add String-based constraints #1109
Comments
From @hmottestad on March 13, 2018 7:14 Datatype based restrictions are also useful and as simple as string based ones. |
From @hmottestad on March 13, 2018 7:30 The plan for validating such data should kick in (requiresEvalutation()) if:
The plan should handle the following cases:
Note that it is possible with combinations of these cases. Case 1 can easily degrade into case 3 by adding in the statements matching path for added nodes of type targetClass. This can then degrade into case 2 by filtering on the type statement from the underlying store. |
From @barthanssens on March 13, 2018 7:30 Indeed. I think I've managed the string constraints working, but probably suboptimal (seem to run more than they should) |
From @hmottestad on March 13, 2018 7:31 That's great. Do you have a branch? |
From @barthanssens on March 13, 2018 7:45 https://github.com/fedict/rdf4j-storage/tree/issues/%2349-shacl-stringconstraints Still pretty much work in progress, I'll check this evening if the code on github is actually the latest version of the I'm working on. Currently I'm checking minLength,maxLength and pattern in 1 single check, although I'm not sure that is the best option - or at least it may require additional return values - if there is a need to also implement the sh:ValidationReport reports. |
From @hmottestad on March 14, 2018 8:34 I had a quick look now. Lots of nice cleanup :) A couple of things I would like to keep though. Factory classes in the classes they belong to, makes it easier to understand and find, having them outside doubles the number of files and makes it harder to figure out which factory is for which class. Also a pain when renaming things later. Also, the queries with the binds, point here was to be able to track which statements in the database were used in evaluating a shacl rule, so that we can give an “explanation”. Currently this is being logged. Try to make some tests for your added rules. Remember that shacl rules with target class trigger for two cases, when an rdf:type statement is added or when a statement matching the path is added (for min count also when removed, but that’s not applicable here). |
From @barthanssens on March 19, 2018 19:39 Thanks for the review :-) |
…gth and maxLength Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
…gth and maxLength Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
…gth and maxLength Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
…gth and maxLength Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
…gth and maxLength Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
Signed-off-by: Håvard Ottestad <[email protected]>
* develop: (54 commits) setting version to 3.0-SNAPSHOT Use diamond inference Signed-off-by:Bart Hanssens <[email protected]> eclipse-rdf4j/rdf4j#998 simplify tests Upgraded assertj-core eclipse-rdf4j/rdf4j#998 list supported shacl predicates, with test to make sure the list is kept up-to-date eclipse-rdf4j/rdf4j#998 configurations for enabling logging of diagnostic info and better javadoc optimize imports various cleanup and fix for sh:or eclipse-rdf4j/rdf4j#1113 added config and factory class for ShaclSail eclipse-rdf4j/rdf4j#1113 moved graph name constant and fixed compliance test setup fixes after rebase eclipse-rdf4j/rdf4j#1247 support implicit and eclipse-rdf4j/rdf4j#1110 support nodeKind eclipse-rdf4j/rdf4j#1109 support for language in eclipse-rdf4j/rdf4j#1109 support for pattern eclipse-rdf4j/rdf4j#1109 reuse plan from datatype to implement minLength and maxLength eclipse-rdf4j/rdf4j#998 support for nested validation results eclipse-rdf4j/rdf4j#998 support sh:or better eclipse-rdf4j/rdf4j#998 support SHACL RDF report format eclipse-rdf4j/rdf4j#998 log which shape caused the issue ... Signed-off-by: Håvard Ottestad <[email protected]> # Conflicts: # shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/Utils.java
* master: (30 commits) very premature implementation of the w3c shacl tests with what seems like some bugs (since they don't run correctly) and also most of this isn't even supported eclipse-rdf4j/rdf4j#1268 add config for setting behavior when target is undefined eclipse-rdf4j/rdf4j#1266 some logging issues found while writing documentation solr embedded now uses managed schema by default - reintroduced necessary config files Use diamond inference Signed-off-by:Bart Hanssens <[email protected]> eclipse-rdf4j/rdf4j#998 simplify tests Upgraded assertj-core eclipse-rdf4j/rdf4j#998 list supported shacl predicates, with test to make sure the list is kept up-to-date eclipse-rdf4j/rdf4j#998 configurations for enabling logging of diagnostic info and better javadoc optimize imports various cleanup and fix for sh:or eclipse-rdf4j/rdf4j#1113 added config and factory class for ShaclSail eclipse-rdf4j/rdf4j#1113 moved graph name constant and fixed compliance test setup fixes after rebase eclipse-rdf4j/rdf4j#1247 support implicit and eclipse-rdf4j/rdf4j#1110 support nodeKind eclipse-rdf4j/rdf4j#1109 support for language in eclipse-rdf4j/rdf4j#1109 support for pattern eclipse-rdf4j/rdf4j#1109 reuse plan from datatype to implement minLength and maxLength eclipse-rdf4j/rdf4j#998 support for nested validation results ... Signed-off-by: Håvard Ottestad <[email protected]> # Conflicts: # shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java # shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ShaclTest.java
From @barthanssens on March 5, 2018 10:40
SHACL 4.4, most of the string-based constraints are probably fairly easy to add: minLength / maxLength / pattern / languageIn
(uniqueLang is more difficult / resource intensive)
See also https://www.w3.org/TR/shacl/#core-components-string
Copied from original issue: eclipse/rdf4j-storage#49
The text was updated successfully, but these errors were encountered: