Submitting an if-then clause using OWL?

I work with basic OWL, and it’s fairly easy to present some simple sentences, such as “Songoku is a lecturer, he teaches mathematics”.

eg:.

<owl:Class rdf:ID="Lecturer"></owl:Class> <owl:Class rdf:ID="Subject"></owl:Class> <owl:Property rdf:ID="teach"> <rdfs:domain rdf:resource="#Lecturer"/> <rdfs:range rdf:resource="#Subject"/> </owl:Property> <Subject rdf:ID="Maths"></Subject> <Lecturer rdf:ID="Songoku"> <teach> <Subject rdf:about="#Maths"></Subject> </teach> </Lecturer> 

But I ran into a problem when I tried to present this proposal: Bob is a student, if Bob has 5 dogs, then he has at least 1 cat. .

Can you tell me some suggestion?

+6
source share
2 answers

You can present some fairly complex conditional sentences in OWL using the general axioms of a subclass. Let's look at a few examples. If you are trying to make something a little easier, say

 Students with at least five dogs have at least one cat. 

which is an abbreviation for the quantified conditional expression "For all x, if x is a student with at least five dogs, then x has at least one cat, you can do this in OWL with

 (Student and hasPet min 5 Dog) subClassOf (hasPet some Cat) 

These are both expressions of an anonymous class, but you can define some equivalent classes to simplify some things:

 StudentWithAtLeastFiveDogs equivalentClass (Student and hasPet min 5 Dogs) CatOwner equivalentClass (hasPet some Cat) StudentWithAtLeastFiveDogs subClassOf CatOwner 

Now your example was Bob - a student, if Bob has 5 dogs, then he has at least 1 cat. There are two sentences. The first is easy to code

 Bob a Student 

The second is a bit more complicated. You say that Bob is a member of a class of things that, if they have at least five dogs, they have at least one cat. A (material) conditional "If P, then Q" is logically equivalent to a disjunction "(not P) or Q". Therefore, we say that Bob is a member of the class of things that either do not have at least five points or have at least one cat. For this class expression

 (not (hasPet min 5 Dog)) or (hasPet some Cat) 

Now our knowledge of Bob is such that

 Bob a Student Bob a (not (hasPet min 5 Dog)) or (hasPet some Cat) 

You can define an equivalent class for this anonymous class expression, but I doubt it will display very naturally in most languages. Here is the ontology containing this knowledge about Bob (in N3 format):

 @prefix : <http://www.example.com/example#> . @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#> . <http://www.example.com/example> a owl:Ontology . :Cat a owl:Class . :Student a owl:Class . :Dog a owl:Class . :hasPet a owl:ObjectProperty . :Bob a :Student , owl:NamedIndividual ; a [ a owl:Class ; owl:unionOf ([ a owl:Class ; owl:complementOf [ a owl:Restriction ; owl:minQualifiedCardinality "5"^^xsd:nonNegativeInteger ; owl:onClass :Dog ; owl:onProperty :hasPet ] ] [ a owl:Restriction ; owl:onProperty :hasPet ; owl:someValuesFrom :Cat ]) ] . 

The same approach can be used for data type properties and their value restrictions. For example, to say that "if Bob weighs at least 60 kg, then he is at least 180 cm high," we can say that Bob is an element of the class of things, which if they weigh at least 60 kg, then they, by at least 180 cm in height or, equivalently, a class of things that either have no weight of at least 60 kg or a height of at least 180 cm. In Manchester syntax, the class expression looks like

 (not (hasWeight some int[>= 60])) or (hasHeight some int[>= 180]) 

The corresponding part of the N3 ontology serialization:

 :Bob a [ a owl:Class ; owl:unionOf ([ a owl:Class ; owl:complementOf [ a owl:Restriction ; owl:onProperty :hasWeight ; owl:someValuesFrom [ a rdfs:Datatype ; owl:onDatatype xsd:int ; owl:withRestrictions ([ xsd:minInclusive 60 ]) ] ] ] [ a owl:Restriction ; owl:onProperty :hasHeight ; owl:someValuesFrom [ a rdfs:Datatype ; owl:onDatatype xsd:int ; owl:withRestrictions ([ xsd:minInclusive 180 ]) ] ]) ] . 
+13
source

This is the text in Attempto Controlled English (ACE) :

 Bob is a student. If Bob has 5 dogs then Bob has at least 1 cat. 

and has this view in OWL:

 ClassAssertion( :student :Bob ) SubClassOf( ObjectIntersectionOf( ObjectOneOf( :Bob ) ObjectMinCardinality( 5 :have :dog ) ) ObjectSomeValuesFrom( :have :cat ) ) 

which can be calculated automatically using the ACE analyzer (APE) . So, if you were able to conceptualize your expression in English, it is worth checking if the ACE parser can automatically match it with OWL, see the ACE analyzer online demo .

+3
source

Source: https://habr.com/ru/post/944761/


All Articles