Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Feature/#743 add support for shacl #34

Merged

Conversation

hmottestad
Copy link
Contributor

@hmottestad hmottestad commented Dec 29, 2017

This is a PR to track the work on aligning the SHACL engine with the new repo layout, making tests, and adding support for optimised partial validation as well as maxCount and datatype validation.

This PR addresses GitHub issue: eclipse-rdf4j/rdf4j#743 .

Briefly describe the changes proposed in this PR:

  • Add support for SHACL (small subset)
  • Fix NotifyingSail for add-remove-add scenarios

@hmottestad hmottestad force-pushed the feature/#743-add-support-for-SHACL branch 13 times, most recently from ea569b0 to 2e0d511 Compare December 29, 2017 21:06
@hmottestad
Copy link
Contributor Author

@heshanjse I have moved your branch here, so that it can be merged in the correct place. I've started adding tests and fixing things so that I can implement support for validating only modified data. Your sign off footer seems too have been wrong for some reason, so I've fixed that in all your commits.

@hmottestad hmottestad force-pushed the feature/#743-add-support-for-SHACL branch 3 times, most recently from 2ecdc29 to c4ca5b5 Compare December 31, 2017 12:53
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Heshan Jayasinghe <heshanjse>
@hmottestad hmottestad force-pushed the feature/#743-add-support-for-SHACL branch from c4ca5b5 to bfe026e Compare December 31, 2017 12:54
Signed-off-by: Heshan Jayasinghe <heshanjse>
Signed-off-by: Heshan Jayasinghe <heshanjse>
Signed-off-by: Heshan Jayasinghe <heshanjse>
Signed-off-by: Heshan Jayasinghe <heshanjse>
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Heshan Jayasinghe <heshanjse>

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
… iterator

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
… the current transaction violates maxCount

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
…il if the current transaction fails the max count independently

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
@abrokenjester
Copy link
Member

FWIW at some point we simply have to bite the bullet and just roll this out - how confident are you currently, @hmottestad, that this is now in a state that is useful to RDF4J users (even if we call it a beta/experimental feature)?

@hmottestad
Copy link
Contributor Author

@jeenbroekstra

minCount, maxCount, simple property path and target class work fine. Performance for maxCount is still a bit low, but minCount is fast.

We just went into production last week with our system, but I’m still not going to have much time for rdf4j in the next few weeks. Asked my boss for time to work on rdf4j, he was positive but not extatic. Also moving apartments, last few boxes now.

There are two other things I haven’t done. 1. correct indentation; 2. correct author and copyright notices.

Also, I have a fix for a bug I found in the notifying sail implementation where it wouldn’t notify on changes correctly when adding, removing and re-adding a statement. Last add wasn’t reported.

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
…ment didn't trigger the notifying sale of the last add operation.

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
…e a simple left outer join and a sparql query instead if possible

Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
Signed-off-by: Håvard Ottestad <hmottestad@gmail.com>
@hmottestad hmottestad force-pushed the feature/#743-add-support-for-SHACL branch from 69711f1 to 075df24 Compare February 14, 2018 07:44
@hmottestad
Copy link
Contributor Author

@jamesrdf @jeenbroekstra

I'm fairly happy to merge this in as experimental and work-in-progess.

Supported features:

  • Shapes
  • Shapes with target class
  • Single predicate paths
  • minCount
  • maxCount

Failed validation will throw an exception. There is some logging for showing the general cause of the validation failure, but it is very rudimentary.

Travis is currently complaining about something completely different:

Running org.eclipse.rdf4j.sail.nativerdf.NativeStoreConcurrencyTest
09:20:13.819 [main] INFO  executing two large concurrent transactions
09:20:18.751 [Thread-2] INFO  Uploaded 200000 statements
09:25:28.840 [main] INFO  Still waiting for transactions to commit
09:30:28.841 [main] INFO  Still waiting for transactions to commit


The job exceeded the maximum time limit for jobs, and has been terminated.

Not sure if this is my fault.

@hmottestad
Copy link
Contributor Author

This is how you use the ShaclSail:

NotifyingSail baseSail = new MemoryStore();
SailRepository shaclRules = ... ;
SailRepository shaclSail = new SailRepository(new ShaclSail(baseSail, shaclRules));
shaclSail.initialize();

The SHACL rules can not be modified after initialization at the moment. It is possible to create a feature for rebuilding the AST (Abstract Syntax Tree), but there is no such feature at the moment.

@catch-point catch-point changed the base branch from develop to master February 22, 2018 14:21
@catch-point catch-point merged commit 2dd622f into eclipse:master Feb 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants