In the context of OWL ontologies, reasoning is the process of making explicit that which is implicit in an ontology. An OWL ontology consists of a number of statements establishing what types of things may exist and the relationships which may or must exist between them. In addition, an ontology can declare instances of these classes and relations.
Consider the following simple example. An ontology defines two classes, FemalePerson and MalePerson, and three object properties (relations), hasSpouse, hasHusband, and hasWife. The properties hasHusband and hasWife are subProperties of hasSpouse. Properties hasHusband and hasWife are inverses of each other (see Object Properties). In addition, George is an instance of a MalePerson, Martha is an instance of a Female person, and it is asserted that Martha hasHusband George. Relevant portions of the OWL ontology in abbreviated RDF/XML syntax are shown below. The complete file is available at http://crapo.crd.ge.com/SimpleTest.owl.
<rdf:RDF ...> <owl:Class rdf:ID="FemalePerson"/> <owl:Class rdf:ID="MalePerson"/><owl:ObjectProperty rdf:ID="hasWife"> <rdfs:subPropertyOf> <owl:ObjectProperty rdf:ID="hasSpouse"/> </rdfs:subPropertyOf> <owl:inverseOf> <owl:FunctionalProperty rdf:about="#hasHusband"/> </owl:inverseOf> <rdfs:range rdf:resource="#FemalePerson"/> <rdfs:domain rdf:resource="#MalePerson"/> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/> </owl:ObjectProperty><owl:FunctionalProperty rdf:ID="hasHusband"> <rdfs:subPropertyOf rdf:resource="#hasSpouse"/> <rdfs:domain rdf:resource="#FemalePerson"/> <rdfs:range rdf:resource="#MalePerson"/> <owl:inverseOf rdf:resource="#hasWife"/> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/> </owl:FunctionalProperty><FemalePerson rdf:ID="Martha"> <hasHusband> <MalePerson rdf:ID="George"/> </hasHusband> </FemalePerson> </rdf:RDF>
Using a reasoner such as Racer or JTP, we can use our simple ontology to answer questions. Some questions can be answered directly by the assertions in the ontology. For example:
Racer Query Language (RQL) Syntax JTP Query Syntax Question: Are there any instances of MalePerson? (retrieve (?x) (?x |http://crapo.crd.ge.com/SimpleTest#MalePerson|)) (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ?x |http://crapo.crd.ge.com/SimpleTest#|::|MalePerson|) Answer: George. (((?X |http://crapo.crd.ge.com/SimpleTest#George|))) ?x = |http://crapo.crd.ge.com/SimpleTest#|::|George|
Other questions involve "reasoning" to discover the initially implicit answer in the ontology. For example:
Racer Query Language (RQL) Syntax JTP Query Syntax Question: Who is George's wife? (retrieve (?w) (|http://crapo.crd.ge.com/SimpleTest#George| ?w |http://crapo.crd.ge.com/SimpleTest#hasWife|)) (|http://crapo.crd.ge.com/SimpleTest#|::|hasWife| |http://crapo.crd.ge.com/SimpleTest#|::|George| ?w) Answer: Martha. (((?W |http://crapo.crd.ge.com/SimpleTest#Martha|))) ?w = |http://crapo.crd.ge.com/SimpleTest#|::|Martha|
Or, as another example:
Racer Query Language (RQL) Syntax JTP Query Syntax Question: Who has a spouse? (retrieve (?x ?y) (?x ?y |http://crapo.crd.ge.com/SimpleTest#hasSpouse|)) (|http://crapo.crd.ge.com/SimpleTest#|::|hasSpouse| ?x ?y) Answer: Martha has spouse George and George has spouse Martha. (((?X |http://crapo.crd.ge.com/SimpleTest#Martha|) (?Y |http://crapo.crd.ge.com/SimpleTest#George|))
((?X |http://crapo.crd.ge.com/SimpleTest#George|) (?Y |http://crapo.crd.ge.com/SimpleTest#Martha|)))?y = |http://crapo.crd.ge.com/SimpleTest#|::|George|
?x = |http://crapo.crd.ge.com/SimpleTest#|::|Martha|
?y = |http://crapo.crd.ge.com/SimpleTest#|::|Martha|
?x = |http://crapo.crd.ge.com/SimpleTest#|::|George|
In either of these last two examples, the answer was not explicitly given in the ontology. In the first example, the owl:inverseOf relation between hasHusband and hasWife was exploited to deduce that George hasWife Martha. In the second example, the owl:inverseOf relation between hasHusband and hasWife was combined with the rdfs:subPropertyOf relation of hasHusband and hasWife with hasSpouse to deduce that George and Martha have each other as spouse.
Note: Jena includes an OWL reasoner which returns similar answers. A Jena model can be interrogated with an SQL-like query language called RDQL. For example, to ask the question "Who has a spouse?", the query would be:
SELECT ?s, ?o WHERE (?s, <http://crapo.crd.ge.com/Acuity/SimpleTest.owl#hasSpouse>, ?o)
Suppose that we have the SimpleTest.owl ontology shown above but with some additional information:
<Person rdf:ID="Jane">
<hasHusband>
<Person rdf:ID="Harry"/>
</hasHusband>
</Person>
From this, the inferences of an OWL reasoner would include the following:
In other words, stating that the rdfs:domain of hasHusband is FemalePerson and the rdfs:range of hasHusband is MalePerson allows us to infer the owl:Class of individuals participating in a hasHusband relation.
It is possible to state axioms in OWL such as the following. "The color of furniture made of wood is brown."
Consider the following OWL representation .
<owl:Class rdf:ID="Color"/> <owl:Class rdf:ID="Material"/> <owl:Class rdf:ID="Furniture"/><owl:Class rdf:ID="WoodFurniture"> <rdfs:subClassOf rdf:resource="#Furniture"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty> <owl:ObjectProperty rdf:about="#hasColor"/> </owl:onProperty> <owl:hasValue> <Color rdf:ID="Brown"/> </owl:hasValue> </owl:Restriction> </rdfs:subClassOf> <owl:equivalentClass> <owl:Restriction> <owl:onProperty> <owl:ObjectProperty rdf:ID="madeFrom"/> </owl:onProperty> <owl:hasValue> <Material rdf:ID="Wood"/> </owl:hasValue> </owl:Restriction> </owl:equivalentClass> </owl:Class> <owl:ObjectProperty rdf:ID="hasColor"> <rdfs:domain rdf:resource="#Furniture"/> </owl:ObjectProperty><Furniture rdf:ID="MyPlasticTable"> <hasColor rdf:resource="#Brown"/> </Furniture> <WoodFurniture rdf:ID="MyWoodenTable"/>
If an OWL reasoner is asked for the properties of MyWoodenTable, the answers will include:
On the other hand, if a reasoner is asked for the properties of MyPlasticTable, the only similar inference will be that it is of rdf:type owl:Thing.
Suppose that we have an ontology similar to the example above but which defines Wood as an owl:Class and which uses a slightly altered definition of WoodFurniture. (This is approximately the content of axiomtest2.owl.)
<owl:Class rdf:ID="Color"/> <owl:Class rdf:ID="Wood"/> <owl:Class rdf:ID="Furniture"/>
<owl:Class rdf:ID="WoodFurniture"> <owl:equivalientClass> <owl:Class> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Furniture"/> <owl:Restriction> <owl:onProperty> <owl:ObjectProperty rdf:ID="#madeFrom"/> </owl:onProperty> <owl:someValuesFrom> <owl:Class rdf:ID="Wood"/> </owl:someValuesFrom> </owl:Restriction> </owl:intersectionOf> </owl:Class> </owl:equivalientClass> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty> <owl:ObjectProperty rdf:about="#hasColor"/> </owl:onProperty> <owl:hasValue> <Color rdf:ID="Brown"/> </owl:hasValue> </owl:Restriction> </rdfs:subClassOf> </owl:Class>
<owl:ObjectProperty rdf:ID="hasColor"> <rdfs:domain rdf:resource="#Furniture"/> </owl:ObjectProperty>
<Color rdf:ID="Brown"/> <Wood rdf:ID="Maple"/> <Wood rdf:ID="Oak"/> <Wood rdf:ID="Walnut"/> <Wood rdf:ID="Pine"/>
<Furniture rdf:ID="MyPlasticTable"> <hasColor rdf:resource="#Brown"/> </Furniture> <Furniture rdf:ID="MyTable"> <madeFrom rdf:resource="#Walnut"/> </Furniture>
The essential difference between this ontology and the previous one is that WoodFurniture has been defined as Furniture that has some values of the madeFrom property for which the object of the property is a member of the owl:Class Wood. These two requirements are necessary and sufficient conditions. In addition, WoodFurniture has the necessary condition that the hasColor property has as value the Color Brown (an individual).
The results of running a reasoner on this ontology include the two inferences:
From the perspective of modeling for Acuity, there is another kind of inference which we might wish to draw from necessary conditions. Suppose we have the ontology immediately above (with the necessary and sufficient condition that WoodFurniture must have someValuesFrom the owl:Class Wood for the property madeFrom) but with slightly different instance data, e.g. (see axiomtest3.owl):
<WoodFurniture rdf:ID="MyWoodenTable"/>
We might like to reason that since MyWoodenTable is a member of the owl:Class WoodFurniture, it is necessary that it have at least one property madeFrom whose object is a member of the owl:Class Wood. This necessary property is missing from the ontology. Given an open world assumption, we cannot positively assert that MyWoodTable is madeFrom one of {Maple, Oak, Walnut, Pine}. We know, however, that these are possible values. We might wish a reasoner used in the Acuity model of Work Centered Support to tell us that we are lacking the relevant information of what instance of Wood MyWoodTable is make of. Of course we can easily query our ontology to find out all the instances of Wood as a potential list of values.
This kind of reasoning is possible with the Jena OWL reasoner. The inferred model (graph) will have a blank node, identified here as "<bNode>", which will appear in two triples:
MyWoodenTable madeFrom <bNode>
<bNode> rdf:type Wood
This blank node represents an unidentified instance of the owl:Class Wood, and so represents a missing piece of information--the instance of the owl:Class Wood which is the object of the property madeFrom on instance MyWoodenTable.
Another approach to the missing information inference task is to identify the direct class of the instance MyWoodenTable, which is WoodFurniture, and to then find all the declared Properties of that owl:Class. The existence and cardinality associated with the declared Properties can be used to determine if there is missing information.
Reasoning with time is important to many problem domains. Demands of temporal reasoning can range from determining whether one even preceded another to understanding the time-dependent properties of an ontological entity. For example, drawing on the ontology above, Martha had husband George for a time duration extending from 1759 to 1799. During a prior time period Martha had husband Daniel [Park Custis].
Interesting work in-progress on a relatively simple time ontology in OWL, time-entry.owl, for use in Web services is reported by Pan and Hobbs. This ontology defines concepts such as Instant, Interval, CalendarClockDescription, and DurationDescription. It provides considerable promise for the future, but is lacking supporting reasoners at present.
JTP has a similar built-in representation of time with concepts of instant, interval, before, after, temporally-contained-by, etc.
An important capability required to implement the vision of inheritance to support adaptive interfaces is some type of default reasoning. This can be illustrated with the following example. Suppose a new user, jdoe, is identified to the system. Initially there is no observation of jdoe's interactions upon which to base the decisions inherent in creating an information environment for this user. However, based on known characteristics of jdoe, e.g., a mechanical engineer with 5 years of experience, we might wish to use certain kinds of defaults which can then be further refined through interactions with the user.
One approach to this kind of reasoning is to have a "prototypical" instance. Like the DBInstancesDescriptor and DBStatementsDescriptor class instances, the AcuityController would know that these are not "real" instances but special cases. The prototypical instance could then have specific properties, both Datatype and Objecttype, which would be "inherited" by other real instances with unknown properties of the same type. Other approaches are also possible. The approach should be consistent with the expressive capability and implemented reasoners for OWL.
Reasoners are software components which determine information implicit in an ontology. In the example above, the reasoners (Racer or JTP) were able to answer questions, expressed in a query language. The term "reasoner" is sometimes applied at two different levels, as it is by JTP. The higher-level definition applies to applications such as JTP or Racer, and denotes a general reasoning capability bundled to provide services such as loading ontologies or knowledge bases, receiving additional assertions, and answering queries.
At the lower level definition of JTP, a software module which knows how to handle a certain class of problem can be called a reasoner. When defined at this level, reasoners may be forward-chaining or backward-chaining. Backward-chaining reasoners process queries and usually provide proofs for the answers which they generate. Forward-chaining reasoners process the assertions (class, property, and instance information in an OWL ontology) and draw conclusions.
Quoting from the Jena web site, "Jena is a Java framework for building Semantic Web applications. It provides a programmatic environment for RDF, RDFS and OWL, including a rule-based inference engine." It is a Java application programmers interface (API) for the Resource Description Framework (RDF). As such, Jena is used by most other tools including the Protege OWL plugin and JTP. Jena handles reading and writing RDF/XML serializations for file-based ontology storage, and provides a relational database persistent storage alternative for large ontologies. Whether the persistent storage is in files or a database is transparent to the application code, e.g., the reasoners.
JTP's main strengths are that it is an object-oriented, modular reasoning system implemented in Java. It is relatively easy to extend JTP by adding specialty reasoning modules to handle application-specific needs. It is also easy to embed a JTP reasoner into a Java application.
The JTP OWLQueryAnswerer class has an ask method which takes a KIF-formatted query as a String. The query must be a conjunction or disjunction of positive literals, usually triples. A triple is of the form:
(predicate subject object) , e.g., (type James Person) states that James is of type Person.
Here are three example queries.
The first query has a single variable and the answers will be all values of x for which x is of type ("|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type") Person ("|http://www.daml.org/2001/03/daml+oil-ex#|::|Person|").
The second query has two variables and the answers will be ordered pairs showing all of the properties ("|http://www.daml.org/2001/03/daml+oil#|::|onProperty|") of all subclasses of MarriedPerson ("|http://www.daml.org/2001/03/daml+oil-ex#|::|MarriedPerson|").
The third query has a single variable and because of the disjunction will return all values of x for which either x is a (if of type) TallThing or x is a Person.
It is also possible to let the value of the predicate or relation be a variable to be bound. In JTP query answerers, this requires use of the "holds" keyword. For example,
(holds ?prop |http://www.daml.org/2001/03/daml+oil-ex#|::|HumanBeing| |http://www.daml.org/2001/03/daml+oil-ex#|::|Person|)
asks, "What relations exist between HumanBeing (as subject) and Person (as object)?"
Racer is a knowledge representation system that uses a highly optimized tableau calculus for description logic reasoning. OWL support is somewhat new in Racer, and while the Protege OWL plug-in uses Racer as a classifier, there are significant compatibility issues mainly centering around the Unique Name Assumption (UNA), which Racer embraces but the OWL does not.