|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.fluxion.utils.OWLUtils
public class OWLUtils
A utility class used to examine OWLDescriptions, and break down the axioms that make up the knowledge about OWLDescriptions into classsplit up an OWL class into smaller, constituent elements (such as the set of a classes superclasses or subclasses). A lot of these utils are very powerful, making extensive calls to a reasoner, when used to examine the relationships between classes and properties in the inferred heirarchy, and as such can use considerable compute resources if used unchecked.
Constructor Summary | |
---|---|
OWLUtils()
|
Method Summary | |
---|---|
static java.util.Set<org.semanticweb.owl.model.OWLDescription> |
deconstruct(org.semanticweb.owl.model.OWLDescription owlDescription)
If the OWLDescription is an OWLObjectUnionOf , it is broken
down into the set of OWLDescriptions that make up the union. |
static java.util.Set<org.semanticweb.owl.model.OWLClass> |
getInferredSubClasses(ReasonerSession session,
org.semanticweb.owl.model.OWLDescription d)
Get the asserted subclasses of a class in the given ontology. |
static java.util.Set<org.semanticweb.owl.model.OWLClass> |
getInferredSuperClasses(ReasonerSession session,
org.semanticweb.owl.model.OWLDescription d)
Get the inferred superclasses of a class in the given ontology. |
static java.util.Set<org.semanticweb.owl.model.OWLClass> |
getReferencedClasses(ReasonerSession session,
org.semanticweb.owl.model.OWLDescription query)
Works out which OWLClasses are referred to by the incoming query description. |
static java.util.Set<org.semanticweb.owl.model.OWLProperty> |
getReferencedProperties(ReasonerSession session,
org.semanticweb.owl.model.OWLDescription query)
Works out which OWLProperties are referred to by the incoming query. |
static java.util.Set<org.semanticweb.owl.model.OWLClass> |
getRelevantClasses(ReasonerSession session,
org.semanticweb.owl.model.OWLOntology ontology,
org.semanticweb.owl.model.OWLDescription query)
Works out which OWL (named, non-anonymous) classes in the supplied ontology intersect with the query OWL description. |
static boolean |
isInteresting(ReasonerSession session,
org.semanticweb.owl.model.OWLOntology ontology,
org.semanticweb.owl.model.OWLRestriction t_r,
org.semanticweb.owl.model.OWLRestriction q_r)
Discover whether a query class restriction is "interesting" with respect to the target restriction. |
static java.util.Set<org.semanticweb.owl.model.OWLRestriction> |
keep(ReasonerSession session,
org.semanticweb.owl.model.OWLOntology ontology,
org.semanticweb.owl.model.OWLDescription owlDescription)
Retains any restrictions that are relevant for a given OWL class. |
static java.util.Set<org.semanticweb.owl.model.OWLRestriction> |
keep(ReasonerSession session,
org.semanticweb.owl.model.OWLOntology ontology,
org.semanticweb.owl.model.OWLDescription owlDescription,
org.semanticweb.owl.model.OWLProperty owlProperty)
Retains any restrictions on the given owlClass which are pertinent to the given owlProperty. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OWLUtils()
Method Detail |
---|
public static java.util.Set<org.semanticweb.owl.model.OWLDescription> deconstruct(org.semanticweb.owl.model.OWLDescription owlDescription)
OWLDescription
is an OWLObjectUnionOf
, it is broken
down into the set of OWLDescriptions that make up the union. Essentially,
this is a convenience method that makes discovering the superclasses of a
union easier.
owlDescription
- the OWLDescription to break down, if possible
public static java.util.Set<org.semanticweb.owl.model.OWLClass> getRelevantClasses(ReasonerSession session, org.semanticweb.owl.model.OWLOntology ontology, org.semanticweb.owl.model.OWLDescription query) throws OWLTransformationException
session
- the ReasonerSession to use to evaluate the resultontology
- the ontology to inspectquery
- the query class
OWLTransformationException
- is there is a problem inspecting the
owlpublic static java.util.Set<org.semanticweb.owl.model.OWLClass> getReferencedClasses(ReasonerSession session, org.semanticweb.owl.model.OWLDescription query) throws OWLTransformationException
getRelevantClasses(ReasonerSession,
org.semanticweb.owl.model.OWLOntology, org.semanticweb.owl.model.OWLDescription)
returns the classes that directly intersect, this method actually collects
all the classes which are alluded to by a description. For example, for
the description "Foo (has_bar Bar)", getRelevantClasses() would return
"Foo". This method returns {Foo, Bar}.
session
- the ReasonerSession to use to evaluate the resultquery
- the query
OWLTransformationException
- if a problem occurspublic static java.util.Set<org.semanticweb.owl.model.OWLProperty> getReferencedProperties(ReasonerSession session, org.semanticweb.owl.model.OWLDescription query) throws OWLTransformationException
session
- the ReasonerSession to use to evaluate the resultquery
- the query
OWLTransformationException
- if a problem occurspublic static java.util.Set<org.semanticweb.owl.model.OWLRestriction> keep(ReasonerSession session, org.semanticweb.owl.model.OWLOntology ontology, org.semanticweb.owl.model.OWLDescription owlDescription) throws OWLTransformationException
keep()
method allows us to build up a valid set of
restrictions on a queriable class type, which can then be used to derive
some filters to perform a query.
session
- the ReasonerSession to use to evaluate the resultontology
- the OWLOntology being queriedowlDescription
- the OWLClass being "broken down"
OWLTransformationException
- is there is a problem with deriving the
query classes superclassespublic static java.util.Set<org.semanticweb.owl.model.OWLRestriction> keep(ReasonerSession session, org.semanticweb.owl.model.OWLOntology ontology, org.semanticweb.owl.model.OWLDescription owlDescription, org.semanticweb.owl.model.OWLProperty owlProperty) throws OWLTransformationException
session
- the ReasonerSession to use to evaluate the resultontology
- the OWLOntology being queriedowlDescription
- the OWLDescription that makes up the queryowlProperty
- the property being inspected for @return a map of
OWLClass to a set of restrictions on this class
OWLTransformationException
- is there is a problem with deriving the
query classes superclassespublic static boolean isInteresting(ReasonerSession session, org.semanticweb.owl.model.OWLOntology ontology, org.semanticweb.owl.model.OWLRestriction t_r, org.semanticweb.owl.model.OWLRestriction q_r) throws OWLTransformationException
session
- the ReasonerSession to use to evaluate the resultontology
- the ontology being inspectedt_r
- the table class restrictionq_r
- the query class restriction
OWLTransformationException
- if there is a problem reasoning over the
ontologypublic static java.util.Set<org.semanticweb.owl.model.OWLClass> getInferredSuperClasses(ReasonerSession session, org.semanticweb.owl.model.OWLDescription d) throws OWLTransformationException
session
- the ReasonerSession to use to evaluate these superclassesd
- the description to check
OWLTransformationException
- if there is a problem getting the
superclassespublic static java.util.Set<org.semanticweb.owl.model.OWLClass> getInferredSubClasses(ReasonerSession session, org.semanticweb.owl.model.OWLDescription d) throws OWLTransformationException
session
- the ReasonerSession to use to evaluate these subclassesd
- the class to check
OWLTransformationException
- if there is a problem getting the
subclasses
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |