inherit property value from parent class

57 views
Skip to first unread message

joakim.s...@blippar.com

unread,
Jul 21, 2017, 11:36:30 AM7/21/17
to TopBraid Suite Users
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?







David Price

unread,
Jul 21, 2017, 11:56:26 AM7/21/17
to topbrai...@googlegroups.com
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
--
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.
For more options, visit https://groups.google.com/d/optout.

Irene Polikoff

unread,
Jul 21, 2017, 12:36:06 PM7/21/17
to topbrai...@googlegroups.com
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. It is very similar to SPIN. In fact, think of SHACL as SPIN 2.0.

Irene


Joakim Soderberg

unread,
Jul 21, 2017, 10:05:56 PM7/21/17
to topbrai...@googlegroups.com
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.



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.
To unsubscribe from this group and all its topics, send an email to topbraid-user...@googlegroups.com.

Irene Polikoff

unread,
Jul 21, 2017, 10:25:15 PM7/21/17
to topbrai...@googlegroups.com
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


Joakim Soderberg

unread,
Jul 21, 2017, 10:56:44 PM7/21/17
to topbrai...@googlegroups.com
I haven’t used SPIN or SHACL rules, but if you say it’s possible to scope a rule for all sub-classes for example, I’ll give it a try.

/J

Joakim Soderberg

unread,
Jul 25, 2017, 2:59:59 PM7/25/17
to topbrai...@googlegroups.com
I remember now, that I was “lured" in to using owl:equivalentClass instead of an ObjectProperty such as skos:exactMatch, because it's subject must be a Class; thinking that I make my mappings on Class level.



On Jul 21, 2017, at 7:25 PM, Irene Polikoff <ir...@topquadrant.com> wrote:

Irene Polikoff

unread,
Jul 25, 2017, 3:12:57 PM7/25/17
to topbrai...@googlegroups.com
As David explained, the semantics of owl:equivalentClass is as follows:

?x owl:equivalentClass ?y

?r1 a ?x

?r2 a ?y

means (infers):

?r1 a ?y
?r2 a ?x

Irene Polikoff
Reply all
Reply to author
Forward
0 new messages