5d37863c16 Declaration( Class( :Child ) ) Declaration( NamedIndividual( :BigBoy ) ) Declaration( NamedIndividual( :BigGirl ) ) Declaration( NamedIndividual( :SmallBoy ) ) Declaration( NamedIndividual( :SmallGirl ) ) ClassAssertion( :Child :BigBoy ) ClassAssertion( :Child :BigGirl ) ClassAssertion( :Child :SmallBoy ) ClassAssertion( :Child :SmallGirl ) DifferentIndividuals( :BigBoy :BigGirl :SmallBoy :SmallGirl ) . The rule can be used in a Java program: package cz.makub; import aterm.ATermAppl; import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; import com.clarkparsia.pellet.rules.builtins.BuiltInRegistry; import com.clarkparsia.pellet.rules.builtins.GeneralFunction; import com.clarkparsia.pellet.rules.builtins.GeneralFunctionBuiltIn; import org.mindswap.pellet.ABox; import org.mindswap.pellet.Literal; import org.mindswap.pellet.utils.ATermUtils; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.io.OWLObjectRenderer; import org.semanticweb.owlapi.model.*; import org.semanticweb.owlapi.reasoner.OWLReasoner; import org.semanticweb.owlapi.reasoner.OWLReasonerFactory; import org.semanticweb.owlapi.reasoner.SimpleConfiguration; import org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat; import uk.ac.manchester.cs.owlapi.dlsyntax.DLSyntaxObjectRenderer; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Map; import java.util.Set; import static org.mindswap.pellet.utils.Namespaces.XSD; /** * Example of Pellet custom SWRL built-in. Propositional logic is sound (only deriving correct results), complete (able to derive any logically valid formula) and decidable (the algorithms for deciding whether a formula is valid end in finite time). Again, using a reasoner we may infer the complete relations: ObjectPropertyAssertion( :isEmployedAt :Martin :ICS ) ObjectPropertyAssertion( :isEmployedAt :Martin :MU ) Class expressions . Every person has at most two parents. In OWL 2 and SWRL, the limits are imposed mainly by the underlaying logic.
SWRL rules with class expressions . However arbitrary SWRL rules would lead to undecidability, so only so-called DL-safe rules are implemented in reasoners. Universal Quantification. By using a piece of software called a reasoner we can infer other facts which are implicitly contained in the ontology, for example if an individual Martin is in class Student, and the class Student is a subclass of the class Person, a reasoner will infer that Martin is a Person. Please note that you can always create a new named class equivalent to a class expression, and use the named class instead of the class expression. OWL API is the Java API used by the Protege OWL editor Pellet 2.2 reasoner, which has support for SWRL rules. that every individual in the range of a :hasWife property must be a woman. A class expression can say that the class contains only individuals that are connected by a given property with individuals from a given class.
Phylbelit replied
485 weeks ago