I have looked at and run the ValidationExample from the github archive and have looked carefully at the SHACL archive ModelConstraintValidator. These are very helpful and I encourage anyone playing with SHACL to look at them. This said, I have run into a bit of a problem trying to extend the example. Here is a code fragment from a modified version of the Validation Example in the archive:
// Load the main data modelModel dataModel = JenaUtil.createMemoryModel();dataModel.read(EDDLValidation.class.getResourceAsStream("/sh/project/vocab/Data.ttl"), "urn:dummy", FileUtils.langTurtle);Model schemaModel = JenaUtil.createMemoryModel();schemaModel.read(ValidationExample.class.getResourceAsStream("/sh/project/schema/Schema.ttl"), "urn:dummy", FileUtils.langTurtle);
// Load the shapes Model (here, includes the dataModel because that has shape definitions too)Model shaclModel = SHACLSystemModel.getSHACLModel();MultiUnion unionGraph = new MultiUnion(new Graph[] {shaclModel.getGraph(),schemaModel.getGraph()});Model shapesModel = ModelFactory.createModelForGraph(unionGraph);
// Make sure all sh:Functions are registeredSHACLFunctions.registerFunctions(shapesModel);// Create Dataset that contains both the main query model and the shapes model// (here, using a temporary URI for the shapes graph)URI shapesGraphURI = URI.create("uri_path_to_schema_graph");Dataset dataset = ARQFactory.get().getDataset(dataModel);dataset.addNamedModel(shapesGraphURI.toString(), shapesModel);
So the questions here are as follows:
(1) does the schemaModel graph need to be a combined graph that includes any imports (such as separate SPIN graphs) within it or is it ok to be just the graph that has SHACL validation functions defined within it? I suspect that it must include the SPIN graph, and would that be done with a jena export from TBC of the related graphs?
(2) in the ValidationExample a MultiUnion graph was used because there were some SHACL definitions in the dataset. This would generally not be the case so this extra layer wouldn't be necessary, right?
Is this the kind of result to expect if there are no constraint violations or have I done something wrong in the code fragment?
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To post to this group, send email to topbraid-users@googlegroups.com
---
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
>>> To post to this group, send email to topbraid-users@googlegroups.com
>>> --- You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to topbraid-users@googlegroups.com
> --- You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
>>> To post to this group, send email to topbrai...@googlegroups.com
>>> --- You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to topbrai...@googlegroups.com
> --- You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
---
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I removed the SPIN content from my validation.I removed the instances from my graphs to a new graph.I changed the validateShapes flag to false.
Locally in TBC I am still seeing different response (albeit a bit different now that validateShapes is set to false. For one file I get no response at all, but that file, when run in TBC, produces 64K results. The other file, which produces about 200 results in TBC, produces 1 in the project. Attached is a screen shot of the TBC results for the latter file.
To post to this group, send email to topbrai...@googlegroups.com
---
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 post to this group, send email to topbrai...@googlegroups.com
>>> --- You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to topbrai...@googlegroups.com
> --- You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
---
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-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
---
You received this message because you are subscribed to a topic in the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/topbraid-users/4suqs8RewM0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to topbraid-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.