[SHACL API] Differences in results when combining shape and data file

52 views
Skip to first unread message

Rik - CROW

unread,
May 13, 2022, 7:28:35 AM5/13/22
to TopBraid Suite Users
Hi,

I work with the Jena-based Java application to validate SHACL TTL files. I always put the shapesfile and the datafile apart and this always performs well.

But in my latest try the following is happening: I have the following files:
  1. Ontology file, including shapes
  2. Dataset file (instances)
When I validate file 1, it conforms. When I validate file 2 against file 1 is also conforms. But I know for a fact that it shouldn't (there are violations in file 2).

Then when I paste the content of file 2 into file 1 (say file 3) and validate this, it gives me the correct violations...

Does anybody have any clue what is happing? I have the latest and greatest release and with a minimal try-out I could not replicate this.

Thanks in advance, kind regards,

Rik

Rik - CROW

unread,
Jun 15, 2022, 8:45:56 AM6/15/22
to TopBraid Suite Users

I solved one problem. Stating the owl:ontology and owl:imports dash: solved the fact the validating file 2 against file 1 did conform (it now fails).

 But there are more errors when taking into account inferencing. When I validate file 3 it does come up with the errors (after inferencing).

 How does this work?



Op vrijdag 13 mei 2022 om 13:28:35 UTC+2 schreef Rik - CROW:

Holger Knublauch

unread,
Jun 15, 2022, 6:03:12 PM6/15/22
to topbrai...@googlegroups.com
Hi Rik,

Your email doesn’t give me enough info to help. You ask generally about inferencing, so I assume you have some SHACL inference rules that you want to apply before constraint validation? These inferences are not computed automatically but only if the owl:Ontology of your graph(s) has a statement sh:entailment sh:Rules as in


If this is not the question you asked, please provide the files that you are trying to run and details about what you would expect.

Holger


-- 
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/43e911b0-5264-4d58-a161-9fa09ae6e998n%40googlegroups.com.

Bohms, H.M. (Michel)

unread,
Jun 16, 2022, 4:14:01 AM6/16/22
to topbrai...@googlegroups.com

Wrt qudt shack validation error:

 

Disappears as soon as I make the qudt ontologies (3x) available in workspace.

 

 

 

Michel Böhms
Data Scientist

Unit Buildings, Infrastructure & Maritime


Mobile +31 630381220
E-mail  
michel...@tno.nl

Location

 

This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. TNO accepts no liability for the content of this e-mail, for the manner in which you use it and for damage of any kind resulting from the risks inherent to the electronic transmission of messages.

 

 

Rik - CROW

unread,
Jun 16, 2022, 5:46:47 AM6/16/22
to TopBraid Suite Users
Hi Holger,

Thanks for you reaction. And  I will try to be more clear.

In this repo are three Turtle files (couldn't attach them due to their size):
  1. Ontology(includingShapes).ttl
  2. Dataset.ttl (my instances)
  3. Ontology+Dataset.ttl (combined by hand)
When  I run: $ shaclvalidate -datafile "Dataset.ttl" -shapesfile "Ontology.ttl", I get as output whats in the file "shaclvalidate 2 against 1.txt" (attached). This correct output, but it does not take into account inferencing.
When I combined file 1 and 2 in file 3 and run $ shaclvalidate -datafile "Ontology+Dataset.ttl", I get as output whats in the file "shaclvalidate 3.txt" (attached). This is what I expect when running the first command.

Thanks again for looking at it.

shaclvalidate 2 against 1.txt
shaclvalidate 3.txt

Holger Knublauch

unread,
Jun 16, 2022, 7:20:35 PM6/16/22
to topbrai...@googlegroups.com
Hi Rik,

Sorry but this goes beyond what I can offer on this mailing list. It is quite hard to sift through MBs of Turtle and fully understand what’s going on here. On a quick look I also don’t see usages of sh:rule or sh:values so I am unclear what role you expect inferencing to have. If you can narrow down your problem into a couple of small files that illustrate what you are trying to validate and what inferences you expect, we may be able to have further input.

Holger


--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/d58cdea3-531f-4faa-bb48-c583b4e2656fn%40googlegroups.com.
<shaclvalidate 2 against 1.txt><shaclvalidate 3.txt>

Rik - CROW

unread,
Jun 17, 2022, 3:33:11 AM6/17/22
to TopBraid Suite Users
Hi Holger,

Totally understandable. I will investigate further and come back with it.
That said, the general question that I still have is what could cause the fact that combining my data + ontology&shapes in one file delivers other results compared to keep them separated? Any wild ideas?

Thanks again for you time.

Op vrijdag 17 juni 2022 om 01:20:35 UTC+2 schreef Holger Knublauch:

Holger Knublauch

unread,
Jun 19, 2022, 7:30:59 PM6/19/22
to topbrai...@googlegroups.com


On 2022-06-17 5:33 pm, Rik - CROW wrote:
Hi Holger,

Totally understandable. I will investigate further and come back with it.
That said, the general question that I still have is what could cause the fact that combining my data + ontology&shapes in one file delivers other results compared to keep them separated? Any wild ideas?

In general, some SHACL features such as sh:targetClass and sh:class will walk up the class hierarchy and the rdfs:subClassOf triples are expected to be in the data graph. So if your shapes graph contains the class definitions and the class hierarchy they wouldn't be visible at query time in the data graph.

Maybe that's the case here.

Holger




Thanks again for you time.

Op vrijdag 17 juni 2022 om 01:20:35 UTC+2 schreef Holger Knublauch:
Hi Rik,

Sorry but this goes beyond what I can offer on this mailing list. It is quite hard to sift through MBs of Turtle and fully understand what’s going on here. On a quick look I also don’t see usages of sh:rule or sh:values so I am unclear what role you expect inferencing to have. If you can narrow down your problem into a couple of small files that illustrate what you are trying to validate and what inferences you expect, we may be able to have further input.

Holger


On 16 Jun 2022, at 7:46 pm, Rik - CROW <rik.op...@crow.nl> wrote:

Hi Holger,

Thanks for you reaction. And  I will try to be more clear.

In this repo are three Turtle files (couldn't attach them due to their size):
  1. Ontology(includingShapes).ttl
  2. Dataset.ttl (my instances)
  3. Ontology+Dataset.ttl (combined by hand)
When  I run: $ shaclvalidate -datafile "Dataset.ttl" -shapesfile "Ontology.ttl", I get as output whats in the file "shaclvalidate 2 against 1.txt" (attached). This correct output, but it does not take into account inferencing.
When I combined file 1 and 2 in file 3 and run $ shaclvalidate -datafile "Ontology+Dataset.ttl", I get as output whats in the file "shaclvalidate 3.txt" (attached). This is what I expect when running the first command.

Thanks again for looking at it.


--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/d58cdea3-531f-4faa-bb48-c583b4e2656fn%40googlegroups.com.
<shaclvalidate 2 against 1.txt><shaclvalidate 3.txt>

--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.

Rik - CROW

unread,
Jun 21, 2022, 4:42:42 AM6/21/22
to TopBraid Suite Users
Aha, that's definitely worth investigating! Thanks!

Op maandag 20 juni 2022 om 01:30:59 UTC+2 schreef Holger Knublauch:

Rik - CROW

unread,
Jun 22, 2022, 4:13:51 AM6/22/22
to TopBraid Suite Users
Yep, that did the trick. owl:import the ontology/shapes file solved everything. Thank you for helping!

Op dinsdag 21 juni 2022 om 10:42:42 UTC+2 schreef Rik - CROW:
Reply all
Reply to author
Forward
0 new messages