How to model a multiple choice possibility in a ontology? - semantic-web

I'm using protege 5 and trying to convert a questionnaire to an ontology. And I cant figure out how to model a multiple choice answer. I have a class (Class1) which has elements and for each element a person can select one or more of allowed values. Eg:
ElementOne : "someStringValue1", "someStringValue2", "someStringValue3", someStringValue4" .
And the user can pick "someStringValue1" and "someStringValue2".
Any ideas how to model this in protege and owl?

You can use enumerated classes to model a fixed set of choices. E.g., you can say things like
Question2Answers ≡ {"choice a", "choice b", "choice c", "none of the above"}
question2 ⊑ ∀ hasAnswer.Question2Answers
Here's an ontology you can download and see examples. In it, I've declared two question individuals, and three answer individuals. I've defined two properties hasObjectAnswer and hasDataAnswer, so you can either use individuals or datatyped literals as answers. I've said that the possible answers for question1 are answerA, answerB, and answerC, by asserting that
question1 ⊑ ∀ hasObjectAnswer.{answerA, answerB, answerC}
I've said that the possible answers for question2 are "answer one", "answer two", "answer three", and "none of the above" by using the axiom:
question2 ⊑ ∀ hasDataAnswer.{"answer one", …, "none of the above"}
#prefix : <urn:ex:> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:answerB a owl:Thing , owl:NamedIndividual .
:question2 a owl:Thing , owl:NamedIndividual ;
a [ a owl:Restriction ;
owl:allValuesFrom [ a rdfs:Datatype ;
owl:oneOf ("answer one" "answer two" "answer three" "none of the above")
] ;
owl:onProperty :hasDataAnswer
] .
:answerA a owl:Thing , owl:NamedIndividual .
:question1 a owl:Thing , owl:NamedIndividual ;
a [ a owl:Restriction ;
owl:allValuesFrom [ a owl:Class ;
owl:oneOf ( :answerC :answerB :answerA )
] ;
owl:onProperty :hasObjectAnswer
] .
:hasObjectAnswer a owl:ObjectProperty .
:hasDataAnswer a owl:DatatypeProperty .
:answerC a owl:Thing , owl:NamedIndividual .

Related

SPARQL selecting unittext (blank nodes)

I recently started working with Linked Data and SPARQL.
I've a dataset which contains unittext, indicating what kind of unit the property has (meters, kilograms and so on).
The unit is a values which is inserted on the relationship between object and its quantitative property.
In my RDF dataset the units are included in a blank node and indicated by https://schema.org/unitText.
An example of the data set is included below.
], [
a owl:Restriction ;
owl:minCardinality "0"^^xsd:nonNegativeInteger ;
owl:onProperty <https://someuri> ;
ns1:unitText "kg"
How can I select this property?
The query so far is:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
select distinct ?label ?aspect ?datatype where {
?s rdfs:subClassOf/owl:onProperty ?aspect .
?aspect rdf:type owl:ObjectProperty.
?aspect skos:prefLabel ?label .
?aspect rdfs:range ?datatype .
FILTER EXISTS{ ?aspect rdfs:range ?datatype. }
VALUES ?datatype {
xsd:string
xsd:gYear
xsd:boolean
xsd:decimal
xsd:integer
xsd:date
}
}
The RDF dataset looks actually like this:
rdfs:subClassOf [ a owl:Restriction ;
owl:minCardinality "0"^^xsd:nonNegativeInteger ;
owl:onProperty <someuri> ;
<https://schema.org/unitText> "kg"
] ;

Inferencing in Protege does not infer types based on `subClassOf`

We are developing an ontology, where we need to infer the type of each node, based on some mappings defined in # Test mapping file section. We tried rdfs:subClassOf, as in the below snippet, but it doesn't infer types. Ideally we want to infer Person 1 and Person 2 to NodeTypePerson, also sydney and canberra to NodeTypeCity.
I tried owl:equivalentClass instead but no luck. rdfs:range and rdfs:domain infer types as expected, but having trouble inferring with rdfs:subClassOf. Any advice is highly appreciated.
UPDATE:
owl:equivalentClass works in Protege. (If infers the type). But can't we use rdfs:subClassOf similarly? Actually I want a way to get this done with RDFS inferencing, where owl:equivalentClass doesn't work obviously. Is there any other RDFS property we can use here?
# baseURI: http://www.Test-app.com/ns
#prefix : <http://www.Test-app.com/ns#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
#prefix acl: <http://www.w3.org/ns/auth/acl#> .
#prefix cc: <http://creativecommons.org/ns#> .
#prefix cert: <http://www.w3.org/ns/auth/cert#> .
#prefix csvw: <http://www.w3.org/ns/csvw#> .
#prefix dc: <http://purl.org/dc/terms/> .
#prefix dcam: <http://purl.org/dc/dcam/> .
#prefix dcat: <http://www.w3.org/ns/dcat#> .
#prefix dctype: <http://purl.org/dc/dcmitype/> .
#prefix foaf: <http://xmlns.com/foaf/0.1/> .
#prefix ldp: <http://www.w3.org/ns/ldp#> .
#prefix posixstat: <http://www.w3.org/ns/posix/stat#> .
#prefix schema: <https://schema.org/> .
#prefix shacl: <http://www.w3.org/ns/shacl#> .
#prefix skos: <http://www.w3.org/2004/02/skos/core#> .
#prefix skosxl: <http://www.w3.org/2008/05/skos-xl#> .
#prefix solid: <http://www.w3.org/ns/solid/terms#> .
#prefix swapdoc: <http://www.w3.org/2000/10/swap/pim/doc#> .
#prefix ui: <http://www.w3.org/ns/ui#> .
#prefix vann: <http://purl.org/vocab/vann/> .
#prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
#prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
#prefix ws: <http://www.w3.org/ns/pim/space#> .
#base <http://www.Test-app.com/ns> .
<http://www.Test-app.com/ns>
rdf:type owl:Ontology ;
dc:title "Test Ontology"#en ;
owl:versionIRI <http://www.Test-app.com/ns/0.1> .
# Test mapping file
#prefix test: <http://www.Test-app.com/ns#> .
:Person
a rdfs:Class ;
owl:equivalentClass :NodeTypePerson .
:locatedNear
a rdf:Property ;
rdfs:subClassOf :NodeCustomAttribute ;
rdfs:label "Located Near" .
:Location
a rdfs:Class ;
rdfs:label "Location" ;
rdfs:subClassOf :NodeTypeCity ;
rdfs:comment "This represents a geolocation." .
:City
a rdfs:Class ;
rdfs:label "City" ;
rdfs:comment "This represents a city." ;
rdfs:subClassOf :Location .
# Some graph instances data
:sydney
a :City ;
rdfs:label "Sydney" ;
rdfs:comment "Australia's largest city." .
:canberra
a :City ;
rdfs:label "Canberra" ;
rdfs:comment "Australia's national capital." .
:person1
a :Person ;
rdfs:label "Person 1" ;
rdfs:comment "First vertex." ;
:locatedNear :sydney .
:person2
a :Person ;
rdfs:label "Person 2" ;
rdfs:comment "Second vertex." ;
:locatedNear :canberra .
# Types
:NodeTypePerson
rdf:type rdfs:Class ;
rdfs:label "NodeTypePerson" ;
rdfs:comment "" ;
vs:term_status "stable" ;
rdfs:isDefinedBy <http://www.Test-app.com/ns> .
:NodeTypeCity
rdf:type rdfs:Class ;
rdfs:label "NodeTypeCity" ;
rdfs:comment "" ;
vs:term_status "stable" ;
rdfs:isDefinedBy <http://www.Test-app.com/ns> .```

Unsuccessful team-employs-player property chain

I am intrigued by Using Property Chains to get inferred Knowledge in an OWL Ontology(Protege)
The accepted answer has two solutions: two OWL expressions, or a SWRL rule. I get the sense that the OP found the all-OWL (property chain) solution confusing but was satisfied with the SWRL answer.
I am trying to implement the all-OWL solution. So far, I don't see an inference that Steven_Gerrard is employed by England when reasoning with Pellet.
I do see the inference
Steven_Gerrard R_NationalPlayer Steven_Gerrard
Is that an error?
Should I use a different reasoner? The OP got an error from FaCT++.
Is my substitution of some for values breaking the reasoning?
The answerer suggested a General Class Axiom of
hasNationalStatus value National_Player EquivalentTo R_NationalPlayer some Self
but Protege compalined about my use of vlaue. It does accept the following:
hasNationalStatus some ({National_Player}) EquivalentTo R_NationalPlayer some Self
Have I made some mistake in modelling Club, Country and Nationality?
My implementation:
#prefix : <http://example.com/> .
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://example.com/playerEmployment.owl> rdf:type owl:Ontology .
<http://example.com/R_NationalPlayer> rdf:type owl:ObjectProperty .
<http://example.com/employs> rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf owl:topObjectProperty ;
owl:propertyChainAxiom ( [ owl:inverseOf <http://example.com/hasNationality>
]
<http://example.com/R_NationalPlayer>
) .
<http://example.com/hasNationalStatus> rdf:type owl:ObjectProperty .
<http://example.com/hasNationality> rdf:type owl:ObjectProperty .
<http://example.com/Club> rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty <http://example.com/employs> ;
owl:someValuesFrom <http://example.com/Player>
] .
<http://example.com/NationalStatus> rdf:type owl:Class .
<http://example.com/Nationality> rdf:type owl:Class .
<http://example.com/Player> rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty <http://example.com/hasNationalStatus> ;
owl:someValuesFrom <http://example.com/NationalStatus>
] ,
[ rdf:type owl:Restriction ;
owl:onProperty <http://example.com/hasNationality> ;
owl:someValuesFrom <http://example.com/Nationality>
] .
<http://example.com/England> rdf:type owl:NamedIndividual ,
<http://example.com/Club> ,
<http://example.com/Nationality> .
<http://example.com/National_Player> rdf:type owl:NamedIndividual ,
<http://example.com/NationalStatus> .
<http://example.com/Steven_Gerrard> rdf:type owl:NamedIndividual ,
<http://example.com/Player> ;
<http://example.com/hasNationalStatus> <http://example.com/National_Player> ;
<http://example.com/hasNationality> <http://example.com/England> .
[ rdf:type owl:Restriction ;
owl:onProperty <http://example.com/hasNationalStatus> ;
owl:someValuesFrom [ rdf:type owl:Class ;
owl:oneOf ( <http://example.com/National_Player>
)
] ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty <http://example.com/R_NationalPlayer> ;
owl:hasSelf "true"^^xsd:boolean
]
] .
Ugh. Pellet can make the desired inference from the ontology included in my question.
I was looking on Steven's Individual page. I should have been looking on England's individual page.

owl: property domain restriction on property value

I am studying the inference in OWL, currently the restriction in domain definition:
#prefix : <http://www.test.org/2015/4/ontology#> .
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#base <http://www.test.org/2015/4/ontology> .
<http://www.test.org/2015/4/ontology> rdf:type owl:Ontology .
:Class1 rdf:type owl:Class .
:Prop1 rdf:type owl:DatatypeProperty ;
rdfs:domain [ rdf:type owl:Class ;
owl:intersectionOf ( :Class1
[ rdf:type owl:Restriction ;
owl:onProperty :Prop1 ;
owl:hasValue "class1"
]
)
] .
:Ind1 rdf:type owl:NamedIndividual ;
:Prop1 "p" .
I've expected that the reasoner (Pellet) infers
:Ind1 rdf:type :Class1
only if there is
:Ind1 :Prop1 "class1"
but it seems to ignore the restriction in the domain definition.
Is it correct to define restrictions in damain definitions? The reasoner (Pellet) does not forbid me to do that.

How to relate each instance of class with each instance of another class?

The general problem
I'm working on a simple ontology, using Protégé 4.3 and trying to create a model such that every instance of a class C has some particular value v, which is an instance of a class V, for a given property p. I can get this inference using an axiom
C subClassOf (p value v)
but I think I want to be able to state this more along the lines of a
C subClassOf (p some V)
because I'd actually like each instance of C to be related to every instance of V.
A specific example
My example is automobiles and actions — I want to create a set of actions for automobiles. When I create new instances of automobiles I want each to have a set of actions. If I add new instances of actions I want all the instances of automobiles to reflect all their related actions.
To add further detail, I have defined the Auto class and two subclasses: Car and Truck. I have also defined an Action class and a subclass, TruckAction. I have defined a hasAction property with domain Auto and range Action to relate autos and actions. I have further created several individuals of different types:
Auto
Truck {F150}
Car {ChevyMalibu}
Action {Accelerate}
TruckAction {LoadCargo}
When I make Car a subclass of (hasAction value Accelerate), I can see that ChevyMalibu has the inferred object property hasAction Accelerate, but this seems akin to hard-coding the object property assertion. I would like to have all car actions inferred for the ChevyMalibu and likewise all TruckActions inferred for F150. I'm not quite sure why doing something like making Car a subclass of (hasAction some Action) won't get me there.
I think that the eloquent answer to OWL type inference with a restriction is related to my question, but I can't quite add this up.
Encoding the rules
You correctly note that if an individual x is an instance of p value y, then you'll infer the assertion p(x,y). However, simply saying that x is an instance of p some Y doesn't (without some more information) won't let you infer that p(x,yi) for any particular yi, even if yi is the only particular instance of Y that you've declared. This is because OWL makes the open world assumption; just because you haven't said something is true (or false) yet doesn't mean that it couldn't be true (or false). (Of course, you might have already said other things that would let you figure out whether something is true or false.) This is described in more detail in another question, Why is this DL-Query not returning any individuals?
If I've understood it correctly, what you're trying to do is say something like:
every Vehicle is related by hasAction to every Action
every Car is related by hasAction to every CarAction
every Truck is related by hasAction to every TruckAction
There are a couple of ways that you could do this. The easiest is to simply use some SWRL rules, and the other is called rolification.
Using SWRL Rules
You can write SWRL rule counterparts of the rules above, and the they're pretty easy to write:
Vehicle(?v) &wedge; Action(?a) &rightarrow; hasAction(?v,?a)
Car(?v) &wedge; CarAction(?a) &rightarrow; hasAction(?v,?a)
Truck(?v) &wedge; TruckAction(?a) &rightarrow; hasAction(?v,?a)
If you use all of these rules, you'll find that each of your vehicles has more actions than you want it to, because, by the first rule, each vehicle is related to each action. E.g., since each TruckAction is also an Action, and since each Car is a Vehicle, the first rule will relate each TruckAction to each Car, and you didn't really want that. Even so, using some rules may well be the easiest option here.
Using Rolification
If you don't want to use SWRL rules, then another option is rolification. I've described rolification and how to do it in answers to a few questions, so you should have a look at:
OWL 2 rolification
OWL 2 reasoning with SWRL rules
How to infer isBrotherOf property between two individuals
Equal relationship between ontology properties
Those will give you more details about rolification. The main point, though, is that we get new properties, e.g., RCar, that have a special behavior: they only relate instances of a particular class to that same instance. E.g., RCar relates each instance of Car
to itself, and doesn't do anything else. It's effectively an equivalence relation on a particular class.
How is rolification useful here? It means that we can use subproperty chain axioms to infer some hasAction properties. E.g.,
hasAction &sqsubseteq; RCar &bullet; topObjectProperty &bullet; RCarAction
That's essentially equivalent to the SWRL rule (topObjectProperty is a built in property of OWL that relates everything to everything):
RCar(?c,?c) &wedge; topObjectProperty(?c,?a) &wedge; RCarAction(?a,?a) &rightarrow; hasAction(?c,?a)
There are two advantages, though:
the subproperty chain axiom doesn't require a reasoner to have SWRL support; and
the subproperty chain axiom works on all individuals, but the SWRL rule works only on named individuals, so you get somewhat better coverage.
You'll still have the same issue that you did with the specificity of the SWRL rules, though; if you say that every Vehicle is related to every Action by hasAction, then that subproperty chain will also apply to subclasses of vehicle and subclasses of action.
There's a significant disadvantage, though: for each class that you want to use in one of these "rules," you need a new property and an equivalent class axiom, and that gets to be sort of tedious.
A different hierarchy for actions
Because both the SWRL rule approach and the subproperty chain with rolification approaches have the problem that the generic rule that relates each vehicle to each action will capture all the actions from subclasses of Action and vehicles from subclasses of Vehicles, you may need to restructure one of your hierarchies a bit. I'd suggest that rather than
Action
CarAction
TruckAction
that you use
Action
VehicleAction
CarAction
TruckAction
and not mirror the hierarchy that you have under Vehicle. This way you can write rules of the form:
every Vehicle is related to every GenericAction by hasAction
every Car is related to every CarAction by hasAction
every Truck is related to every TruckAction by hasAction
With SWRL rules
If you do this with SWRL rules, it looks like this:
(The default layout for Protégé might not include a place to edit SWRL rules though. See my answer to Ontology property definition in Protégé-OWL / SWRL for instructions on getting one. It's just a minor interface tweak; you don't need to download or install anything.) This produces results like this:
You can copy and paste this ontology:
#prefix : <https://stackoverflow.com/q/21512765/1281433/cars#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix swrl: <http://www.w3.org/2003/11/swrl#> .
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
#prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:Action a owl:Class .
<urn:swrl#a> a swrl:Variable .
:DodgeRam a owl:NamedIndividual , :Truck .
:Truck a owl:Class ;
rdfs:subClassOf :Vehicle .
:Car a owl:Class ;
rdfs:subClassOf :Vehicle .
<urn:swrl#v> a swrl:Variable .
:LoadCargo a owl:NamedIndividual , :TruckAction .
[ a swrl:Imp ;
swrl:body [ a swrl:AtomList ;
rdf:first [ a swrl:ClassAtom ;
swrl:argument1 <urn:swrl#a> ;
swrl:classPredicate :GenericAction
] ;
rdf:rest [ a swrl:AtomList ;
rdf:first [ a swrl:ClassAtom ;
swrl:argument1 <urn:swrl#v> ;
swrl:classPredicate :Vehicle
] ;
rdf:rest ()
]
] ;
swrl:head [ a swrl:AtomList ;
rdf:first [ a swrl:IndividualPropertyAtom ;
swrl:argument1 <urn:swrl#v> ;
swrl:argument2 <urn:swrl#a> ;
swrl:propertyPredicate :hasAction
] ;
rdf:rest ()
]
] .
:Accelerate a owl:NamedIndividual , :GenericAction .
:F150 a owl:NamedIndividual , :Truck .
:FordFocusZX5 a owl:NamedIndividual , :Car .
[ a swrl:Imp ;
swrl:body [ a swrl:AtomList ;
rdf:first [ a swrl:ClassAtom ;
swrl:argument1 <urn:swrl#c> ;
swrl:classPredicate :Car
] ;
rdf:rest [ a swrl:AtomList ;
rdf:first [ a swrl:ClassAtom ;
swrl:argument1 <urn:swrl#a> ;
swrl:classPredicate :CarAction
] ;
rdf:rest ()
]
] ;
swrl:head [ a swrl:AtomList ;
rdf:first [ a swrl:IndividualPropertyAtom ;
swrl:argument1 <urn:swrl#c> ;
swrl:argument2 <urn:swrl#a> ;
swrl:propertyPredicate :hasAction
] ;
rdf:rest ()
]
] .
:Brake a owl:NamedIndividual , :GenericAction .
:hasAction a owl:ObjectProperty .
:GenericAction a owl:Class ;
rdfs:subClassOf :Action .
<https://stackoverflow.com/q/21512765/1281433/cars>
a owl:Ontology .
:Vehicle a owl:Class .
<urn:swrl#c> a swrl:Variable .
:ChevyMalibu a owl:NamedIndividual , :Car .
<urn:swrl#t> a swrl:Variable .
:CarAction a owl:Class ;
rdfs:subClassOf :Action .
[ a swrl:Imp ;
swrl:body [ a swrl:AtomList ;
rdf:first [ a swrl:ClassAtom ;
swrl:argument1 <urn:swrl#t> ;
swrl:classPredicate :Truck
] ;
rdf:rest [ a swrl:AtomList ;
rdf:first [ a swrl:ClassAtom ;
swrl:argument1 <urn:swrl#a> ;
swrl:classPredicate :TruckAction
] ;
rdf:rest ()
]
] ;
swrl:head [ a swrl:AtomList ;
rdf:first [ a swrl:IndividualPropertyAtom ;
swrl:argument1 <urn:swrl#t> ;
swrl:argument2 <urn:swrl#a> ;
swrl:propertyPredicate :hasAction
] ;
rdf:rest ()
]
] .
:TruckAction a owl:Class ;
rdfs:subClassOf :Action .
With rolification
If you do this with rolification, it looks like this:
and you get the results you'd expect:
You can copy and paste this ontology:
#prefix : <https://stackoverflow.com/q/21512765/1281433/cars#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:GenericAction a owl:Class ;
rdfs:subClassOf :Action ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_GenericAction
] .
:Car a owl:Class ;
rdfs:subClassOf :Vehicle ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_Car
] .
:CarAction a owl:Class ;
rdfs:subClassOf :Action ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_CarAction
] .
:R_TruckAction a owl:ObjectProperty .
:R_Car a owl:ObjectProperty .
:Truck a owl:Class ;
rdfs:subClassOf :Vehicle ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_Truck
] .
:Brake a owl:NamedIndividual , :GenericAction .
:hasAction a owl:ObjectProperty ;
owl:propertyChainAxiom ( :R_Vehicle owl:topObjectProperty :R_GenericAction ) ;
owl:propertyChainAxiom ( :R_Car owl:topObjectProperty :R_CarAction ) ;
owl:propertyChainAxiom ( :R_Truck owl:topObjectProperty :R_TruckAction ) .
:R_CarAction a owl:ObjectProperty .
:R_Truck a owl:ObjectProperty .
:F150 a owl:NamedIndividual , :Truck .
:Accelerate a owl:NamedIndividual , :GenericAction .
:Action a owl:Class .
:ChevyMalibu a owl:NamedIndividual , :Car .
:R_Vehicle a owl:ObjectProperty .
:FordFocusZX5 a owl:NamedIndividual , :Car .
:R_GenericAction a owl:ObjectProperty .
:TruckAction a owl:Class ;
rdfs:subClassOf :Action ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_TruckAction
] .
:DodgeRam a owl:NamedIndividual , :Truck .
<https://stackoverflow.com/q/21512765/1281433/cars>
a owl:Ontology .
:LoadCargo a owl:NamedIndividual , :TruckAction .
:Vehicle a owl:Class ;
owl:equivalentClass [ a owl:Restriction ;
owl:hasSelf true ;
owl:onProperty :R_Vehicle
] .