Reputation: 1499
Toy example:
Consider the following types:
Hamburger, Veggieburger, Component, Vegetable, Meat
Where
Veggieburger
is subclass_of
Hamburger
Vegetable
and meat
are
subclasses of Component
Consider the following property:
Has_component
: domain = Hamburger
, range = Component
Now, I want to redefine Has_component
on the Veggieburger
and indicate that is can only contain vegetable Components
.
Is there a way to redefine (i.e. override) the property Has_component
?
Upvotes: 1
Views: 344
Reputation: 3989
If you are only willing to use RDFS, then might I suggest the following:
@prefix menu: <http://yourdomain/menu#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
menu:Burger rdf:type rdfs:Class.
menu:Veggieburger rdf:type rdfs:Class;
rdfs:subClassOf menu:Burger.
menu:Hamburger rdf:type rdfs:Class;
rdfs:subClassOf menu:Burger.
menu:Component rdf:type rdfs:Class.
menu:VeggieComponent rdf:type rdfs:Class;
rdfs:subClassOf menu:Component.
menu:MeatComponent rdf:type rdfs:Class;
rdfs:subClassOf menu:Component.
#use camel casing for property names
menu:hasComponent rdf:type rdf:Property;
rdfs:domain menu:Burger;
rdfs:range menu:Component.
menu:hasMeatComponent rdf:type rdf:Property;
rdfs:subPropertyOf menu:hasComponent;
rdfs:domain menu:MeatBurger;
rdfs:range menu:MeatComponent.
menu:hasVeggieComponent rdf:type rdf:Property;
rdfs:domain menu:VeggieBurger;
rdfs:subPropertyOf menu:hasComponent;
rdfs:range menu:VeggieComponent.
Upvotes: 3
Reputation: 4886
You can add another pair domain/range axioms in RDFS, a reasoner will interpret the actual range as the intersection of the two classes, Component & VeggieComponent, which in this instance is ok. In some cases, that'd be undesirable, so keep that in mind.
You could also do this with OWL & a restriction to get what you want, ala
VeggieBurger subClassOf some(HasComponent, VeggieComponent)
Upvotes: 2