I am not sure what you mean. You only need one rule because it would be totally generic: if there is no value for property x, find the nearest parent class that has a value for this property and infer it.
You then, need to scope the applicability of the rule. In SPIN, scope (target of the rule) is defined by attaching the rule to some class. It means that the rule will apply to all class members. In this case, you are wanting to make the inference about classes, so you would attach the rule to owl:Class. It will then apply to all classes in your graph. If you do not want it to apply to all classes, then you should create a meta-class, make it a subclass of owl:Class (or rdfs:Class) and make all classes the rule should apply to instances of the meta class (in addition or instead of being instances of owl:Class). With SHACL, you have additional ways to define targets. There are built-in constructs for saying that the rule applies to members of a certain class or to all subjects of a triple with a predicate you specify or to all objects of a triple with a predicate you specify or you can list all resources it applies to by their URI. Finally, if none of these fit, there are SPARQL-based targets. You can define your own target using a SPARQL query that will, somehow, identify classes you want the rule to apply to. For example, all classes that are subclasses of a class you specify or all classes that do not have a value for a property you specify, etc. I really do not know what could be more data-driven than these solutions. Irene Polikoff > On Jul 21, 2017, at 10:05 PM, 'Joakim Soderberg' via TopBraid Suite Users > <[email protected]> wrote: > > Thanks, > It clarifies, though it doesn’t solve my problem. I was hoping to have a data > driven solution, but writing SPIN classes for every class it applies to is > not manageble. > > > >> On Jul 21, 2017, at 9:36 AM, Irene Polikoff <[email protected] >> <mailto:[email protected]>> wrote: >> >> David is correct. I would highly recommend that you don't use >> owl:equivalentClass because you are changing semantic of owl:equivalentClass >> by implementing such rule. Just create your own custom property or you can >> use skos:exactMatch. And then create the inference rule. >> >> SHACL just officially became a standard. With this, you may want to consider >> using SHACL for the rule https://www.w3.org/TR/shacl-af/#rules >> <https://www.w3.org/TR/shacl-af/#rules>. It is very similar to SPIN. In >> fact, think of SHACL as SPIN 2.0. >> >> Irene >> >> >> >>> On Jul 21, 2017, at 11:56 AM, David Price <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> Hi, >>> >>> OWL class hierarchies are super-sub class hierarchies, not inheritance, so >>> you have to think in more terms of set theory. >>> >>> In the case you describe, the logic is wrong. Equivalent class means “has >>> exactly the same set of members”. A superclass may have more members that >>> its subclass, and based on that I hope it’s clear that the inference you’ve >>> described is actually not valid. >>> >>> FWIW with SPIN rules you can generate whatever you want, regardless of >>> their logic being valid (i.e. if you are “perverting” the meaning of >>> equivalentClass for another purpose you can generate whatever you want with >>> SPIN, just don’t use a reasoner over that same data). >>> >>> Hope that helps, >>> David >>> >>> UK +44 7788 561308 >>> US +1 336 283 0606 >>> >>> >>> >>> >>>> On 21 Jul 2017, at 16:36, joakim.soderberg via TopBraid Suite Users >>>> <[email protected] <mailto:[email protected]>> >>>> wrote: >>>> >>>> Hi, >>>> I wonder if it's possible in Topbraid to automatically (perhaps by >>>> inference) inherit the value of a property from a parent class to its >>>> subclass? >>>> >>>> For example, say you have the following class hierarchy >>>> >>>> ex:Vehicle >>>> ex:Car >>>> ex:Sedan >>>> >>>> Some classes have the property owl:equivalenClass set to some value, for >>>> example: >>>> >>>> ex:Vehicle >>>> owl:equivalentClass wd:MeanOfTransportation >>>> ex:Sedan >>>> owl:equivalentClass wd:Sedan >>>> >>>> >>>> In the case owl:equivalentClass is not set to a value, it should take the >>>> value of it's parent class. In the above example: >>>> >>>> >>>> >>>> ex:Car >>>> owl:equivalentClass wd:MeanOfTransportation >>>> >>>> >>>> Can this be accomplished automatically (i.e. an assertion generated) in >>>> TopBraid? >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> 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] >>>> <mailto:[email protected]>. >>>> For more options, visit https://groups.google.com/d/optout >>>> <https://groups.google.com/d/optout>. >>> >>> >>> -- >>> 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] >>> <mailto:[email protected]>. >>> For more options, visit https://groups.google.com/d/optout >>> <https://groups.google.com/d/optout>. >> >> >> -- >> 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/NXiyXqsrrsU/unsubscribe >> <https://groups.google.com/d/topic/topbraid-users/NXiyXqsrrsU/unsubscribe>. >> To unsubscribe from this group and all its topics, send an email to >> [email protected] >> <mailto:[email protected]>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > 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] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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.
