The SPINModuleRegistry.get().init() problem was a Siemens security issue which I got rid of but it didn't change the result I posted, which suggests that the SPIN functions are not available in the SPARQL queries in my SHACL templates.
On Mon, Aug 15, 2016 at 5:07 PM, Jack Hodges <[email protected]> wrote: > 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. > > Looking at these results they appear very different, for several reasons. > The most notable now is that only the sh: validations are being run in my > jena case. Perhaps this is related to the fact that I can no longer run > SPINModuleRegistry.get().init(); because connection is refused. Since > many of my SHACL templates are defined in my SPIN graph, if I cannot get > them registered they may not be available. > > Here is my initializeSPIN method, glomed together from various examples, > which is called first in my main for the ModelConstraintValidator: > > /** > * initializeSPIN: Get all of the related SPIN modules and our SPIN > stuff and load > * them into the SPINModuleRegistry > */ > > private static void initializeSPIN() { > SPINModuleRegistry.get().init(); > > // Create an empty OntModel importing SP > System.out.println("Loading EDDL SPIN ontology..."); > Model eddlSPINModel = JenaUtil.createMemoryModel(); > eddlSPINModel.read(ValidationExample.class. > getResourceAsStream("/sh/eddl/spin/SPIN_SSF_eddl-v1.0.spin.ttl"), null, > FileUtils.langTurtle); > > // Load OWL RL library from the web > System.out.println("Loading OWL RL ontology..."); > OntModel owlrlModel = loadModelWithImports("http:// > topbraid.org/spin/owlrl-all"); > > // Register any new functions defined in OWL RL > SPINModuleRegistry.get().registerAll(owlrlModel, null); > // Build one big union Model of everything > System.out.println("Creating MultiUnion model from eddlSPIN, > owlrlModel, SPL, SPIN, and SP..."); > MultiUnion multiUnion = JenaUtil.createMultiUnion(new Graph[] { > eddlSPINModel.getGraph(), > owlrlModel.getGraph(), > SPL.getModel().getGraph(), > SPIN.getModel().getGraph(), > SP.getModel().getGraph() > }); > > System.out.println("Assigning into spinModel the MultiUnion > model..."); > spinModel = ModelFactory.createModelForGraph(multiUnion); > > // Register locally defined functions (none exist, but may in the future) > System.out.println("Registering everything in spinModel into the > SPIN Module Registry..."); > SPINModuleRegistry.get().registerAll(spinModel, null); > return; > } > > > On Wednesday, August 10, 2016 at 6:47:46 AM UTC-7, Jack Hodges wrote: >> >> Right, I forgot about that. I always hit the blue button. I'll try >> setting validateShapes to false. Thank you! >> >> Jack >> >> Sent from my iPad >> >> > On Aug 10, 2016, at 12:34 AM, Holger Knublauch <[email protected]> >> wrote: >> > >> > >> > >> >> On 10/08/2016 12:53, Jack Hodges wrote: >> >> That is what I am saying. The validation example is reporting >> violations on classes (focus nodes are all classes) while TBC is reporting >> violations on instances. I am trying to reproduce the results that TBC >> shows. >> > >> > TBC has a green and a blue button in the SHACL Validation view. The >> green will validate everything including the shapes and classes. The blue >> only the instances. In the API this corresponds roughly to the >> validateShapes boolean flag. >> > >> > I cannot tell more since I don't know your shapes file, and which >> violations you expected. >> > >> > Holger >> > >> > >> > >> >> >> >> Jack >> >> >> >> Sent from my iPad >> >> >> >>> On Aug 9, 2016, at 6:17 PM, Holger Knublauch <[email protected]> >> wrote: >> >>> >> >>> >> >>> >> >>>> On 10/08/2016 2:51, Jack Hodges wrote: >> >>>> I need SPIN because my SHACL sh:constraint sh:sparql SPARQL query >> calls SPIN functions (some stock and some custom). >> >>> The SPIN functions can be registered with the SPARQL engine >> separately and do not need to be in the same graph as the SHACL data. The >> two worlds interact only via the ARQ SPARQL engine's functions registry. >> >>> >> >>>> I flattened as suggested into a single turtle file. >> >>>> >> >>>> I had some test values in the schema so I piped the schema back in >> as the test data and got some results (yay!). >> >>>> >> >>>> Now the issue is that the results don't match what I am seeing in >> the TBC SHACL Validation tab. In TBC the SHACL Validation tab shows: Shape, >> Constraint, Message, Focus Node, Subject, Predicate, and Object. The Shape >> data is similar to the result in the test case, but none of the other SHACL >> property values are the same, most notably the Message and Focus Node >> values. In TBC the Focus Node (which seems to be the same as sh:subject) is >> bound to instances, and the Message (sh:message) value is bound to the >> message I defined and bound to the values my SPARQL query returns. And >> example of the results I am seeing from the test case is: >> >>>> >> >>>> [ a sh:ValidationResult ; >> >>>> sh:focusNode eddl:BlockB ; >> >>>> sh:message "Value does not have class >> sh:PropertyConstraint" ; >> >>>> sh:path sh:property ; >> >>>> sh:severity sh:Violation ; >> >>>> sh:sourceConstraint _:b0 ; >> >>>> sh:sourceConstraintComponent sh:ClassConstraintComponent ; >> >>>> sh:sourceShape sh:Shape ; >> >>>> sh:value [] >> >>>> ] . >> >>>> >> >>>> So now I am thinking that maybe I am using the wrong validator. Is >> it possible that I should be using the ResourceConstraintValidator instead >> of the ModelConstraintValidator? And if so, it takes a resource as the >> first argument unlike TBC which traverses the current graph. >> >>> So are you saying the result instances are different, i.e. they >> report different violations? Or is just the format (e.g. sh:focusNode vs. >> sh:subject) different? The latter is easy to explain: the SHACL API is >> ahead of the TBC release cycle, and only the API follows the very latest >> syntax changes to SHACL. >> >>> >> >>> Holger >> >>> >> >>> -- >> >>> 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 [email protected] >> >>> --- 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/to >> pic/topbraid-users/4suqs8RewM0/unsubscribe. >> >>> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> >>> 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 [email protected] >> > --- 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/to >> pic/topbraid-users/4suqs8RewM0/unsubscribe. >> > To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> > 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 [email protected] > --- > 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 > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Jack -- 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 [email protected] --- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
