This is likely a syntax error on my part, but I am hoping someone can help me out because it will serve as an example in a larger project.
Referring to the attached data file minEx-Data.ttl, :Animal_00M02 should violate the constraint where End Date must be greater than or equal to Begin Date as written in the SHACL file minEx-SHACL.TTL. The query itself is correct as proven by executing minEx-RawQueryThis.rq which returns the correct observation that contains the error (Animal_00M02).
Suggestions greatly appreciated!
Tim
PS: Would love to see more documentation, and examples, or a webinar for advanced SHACL-SPARQL in Stardog.
I got to thinking, maybe this is an issue with the date comparison, even though it works in SPARQL. So I wrote this (rather pathetic) kludge and once again it works as a SPARQL query, but not as SHACL-SPARQL. Is anyone able to reproduce this problem?
Your focus node is :ReferenceInterval, however the way your query is written, $this will only ever be bound to :AnimalSubject entities. I rewrote the query so that ?interval is now $this as follows:
Adding this constraint, I was able to see a violation. I'm assuming this doesn't rewrite the constraint in a way that makes it not what you're looking for, but if it does, let me know and we can look more into it.
Thank you! This works, and makes sense. I wish there were more detailed SHACL-SPARQL examples available.
Other than executing a follow-up query, is there a way to to identify in the report which AnimalSubject has the interval that trips the constraint? I expect this is outside of the scope of SHACL-SPARQL.
Thanks again. Case closed (and it was my syntax all along)
Tim
Stephen, If you want to grab some easy Stackoverflow reputation karma, you can copypasta to my question on StackOverflow. I just put a bounty on it this afternoon. Enjoy a sweet +50 .