The SWRL TBox Built-In Library is one of the SWRLTabBuiltInLibraries. It defines built-ins that be used to query an OWL TBox. It allows users to, for example, find all transitive properties in an ontology. (A3K)
The built-ins in this library are defined by TBox Ontology. The standard alias is tbox. A copy of this file can be found the standard Protege-OWL repositories, and can be imported through the 'Import Ontology' option in the Metadata tab. (8WU)
The built-ins in this library allow direct reasoning about OWL classes and properties, something that it not permitted in OWL or SWRL. Ideally, they should not be used in SWRL rules - they should only be used in SQWRL queries. These methods themselves do not modify the TBox in any way. Also, the built-ins in this library currently operate on the asserted information in an ontology only - they do not pick up inferred knowledge. (A9J)
The following are the built-ins defined by this library: (8NG)
- isClass Determine if a single argument is an OWL named class. If the argument is unbound, bind it to all named classes in the ontology. (99L)
- isProperty Determine if a single argument is a property. If the argument is unbound, bind it to all the properties in the ontology. (99M)
- isObjectProperty Determine if a single argument is an object property. If the argument is unbound, bind it to all the object properties in the ontology. (99N)
- isDataProperty Determine if a single argument is a data property. If the argument is unbound, bind it to all the data properties in the ontology. (99O)
- isTransitiveProperty Determine if a single argument is a transitive property. (8NB)
- isSymmetricProperty Determine if a single argument is a symmetric property. (8NY)
- isFunctionalProperty Determine if a single argument is a functional property. (8ND)
- isInverseFunctionalProperty Determine if a single argument is an inverse functional property. (8NE)
- isAnnotationProperty Determine if a single argument is an annotation property. (8NF)
- isDirectSuperClassOf Check that the first class argument is a direct superclass of the second class argument. If the first argument is unbound, bind it to the direct superclasses of the second argument (if any exist). (8NP)
- isSuperClassOf Check that the first class argument is a superclass of the second class argument. If the first argument is unbound, bind it to the superclasses of the second argument (if any exist). (8NQ)
- isDirectSubClassOf Check that the first class argument is a direct subclass of the second class argument. If the first argument is unbound, bind it to the direct subclasses of the second argument (if any exist). (8NR)
- isSubClassOf Check that the first class argument is a subclass of the second class argument. If the first argument is unbound, bind it to the subclasses of the second argument (if any exist). (8NS)
- isDirectSuperPropertyOf Determine if the first property argument is a direct superproperty of the second property argument. If the first argument is unbound, bind it to the direct super properties of the second argument (if any exist). (8NT)
- isSuperPropertyOf Determine if the first property argument is a superproperty of the second property argument. If the first argument is unbound, bind it to the super properties of the second argument (if any exist). (8NU)
- isDirectSubPropertyOf Determine if the first property argument is a direct subproperty of the second property argument. If the first argument is unbound, bind it to the direct sub properties of the second argument (if any exist). (8NV)
- isSubPropertyOf Determine if the first property argument is a subproperty of the second property argument. If the first argument is unbound, bind it to the sub properties of the second argument (if any exist). (8NW)
- isEquivalentTo Determine if the two class or property arguments represent classes or properties that are equivalent to each other. If the first argument is unbound, bind it to the equivalent properties or classes of the second argument (if any exist). (8NZ)
- isDisjointWith Determine if the two class or property arguments represent classes or properties that are disjoint with each other. If the first argument is unbound, bind it to the disjoint properties or classes of the second argument (if any exist). (8O0)
- isInRangeOf Determine if the first class argument is in the range of the second property argument (including its superproperties). If the first argument is unbound, bind it to the range of the second argument (if any exist). (9EV)
- isInDirectRangeOf Determine if the first class argument is in the range of the second property argument excluding its superproperties. If the first argument is unbound, bind it to the range of the second argument (if any exist). (9EW)
- isInDomainOf Check that the first class argument is in the domain of the second property argument (including its superproperties). If the first argument is unbound and the second argument is bound, bind the first argument to the domain(s) of the second property argument (if any exist). If the first class argument is bound and the second argument is unbound, bind the second argument to the properties that have the class in their domain (if any exist). An error is thrown if both arguments are unbound. (9QV)
- isInDirectDomainOf Check that the first class argument is in the domain of the second property argument (excluding superproperties). If the first argument is unbound and the second argument is bound, bind the first argument to the domain(s) of the second property argument (if any exist). If the first class argument is bound and the second argument is unbound, bind the second argument to the properties that have the class in their domain (if any exist). An error is thrown if both arguments are unbound. (9QW)
- equalTo Check that the two class or property arguments refer to the same class or property. The standard SWRL sameAs construct can be used to determine if two OWL individuals are the same; similarly the swrlb:equal built-in can be used to determine if two OWL data values are the same. (A4D)
- notEqualTo Check that the two class or property arguments do not refer to the same class or property. The standard SWRL differentFrom construct can be used to determine if two OWL individuals are different; similarly the swrlb:notEqual built-in can be used to determine if two OWL data values are different. (A4E)
Examples (99P)
The following examples show how these built-ins can be used in SQWRL queries to examine the structure of an OWL ontology. These queries can be executed using either the SQWRLQueryTab or the SQWRLQueryAPI. (99Z)
List all the classes in an OWL ontology, ordered alphabetically by name: (99R)
- tbox:isClass(?c) -> sqwrl:select(?c) ^ sqwrl:orderBy(?c) (99S)
List the number of individuals in an OWL ontology: (9A0)
- tbox:isClass(?c) -> sqwrl:count(?c) (99S)
List all the transitive properties in an owl ontology: (99T)
- tbox:isProperty(?p) ^ tbox:isTransitve(?p) -> sqwrl:select(?p) (99U)
List all the functional properties together with their direct subproperties: (99V)
- tbox:isProperty(?p) ^ tbox:isFunctional(?p) ^ tbox:isDirectSubPropertyOf(?sp, ?p) -> sqwrl:select(?p, ?sp) (99W)
List all the data properties together with the number of their direct subproperties: (99X)
- tbox:isDataProperty(?p) ^ tbox:isDirectSubPropertyOf(?sp, ?p) -> sqwrl:select(?p) ^ sqwrl:count(?sp) (99Y)
List all data properties together with their ranges: (9EY)
- tbox:isDataProperty(?p) ^ tbox:isInRangeOf(?r, ?p) -> sqwrl:select(?p, ?r) (9EZ)