Jonny5
Jonny5

Reputation: 1499

RDFS subclass: property redefinition

Toy example:


Consider the following types:

Where

Consider the following property:


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

Answers (2)

William Greenly
William Greenly

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

Michael
Michael

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

Related Questions