|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mindswap.pellet.jena.OWLMETReasoner
public class OWLMETReasoner
The main reasoner class designed to support Jena applications. It basically
wraps a KnowledgeBase
object and
does the conversion between Jena structures and ATerms.
Field Summary | |
---|---|
static boolean |
DEBUG
Deprecated. Edit log4j.properties to turn on debugging |
static java.util.List |
SKIP
|
Constructor Summary | |
---|---|
OWLMETReasoner()
|
Method Summary | |
---|---|
void |
classify()
Classify the loaded ontologies by computing all the direct/indirect subclass relations between each named class. |
void |
clear()
Clear the loaded ontologies from reasoner's memory. |
com.hp.hpl.jena.query.ResultSet |
execQuery(com.hp.hpl.jena.query.Query sparql)
|
com.hp.hpl.jena.query.ResultSet |
execQuery(java.lang.String queryStr)
|
com.hp.hpl.jena.rdf.model.Model |
extractClassModel(boolean verbose)
Returns a Jena model that contains the subclass and equivalence relations between named classes. |
com.hp.hpl.jena.rdf.model.Model |
extractIndividualModel(boolean verbose)
Returna a Jena model that contains the type assertions about individuals. |
com.hp.hpl.jena.rdf.model.Model |
extractModel(boolean verbose)
Returns a Jena model that contains the obvious and inferred subclass, subproperty and type assertions. |
com.hp.hpl.jena.rdf.model.Model |
extractPropertyModel(boolean verbose)
Returns a Jena model that contains the information about properties. |
java.util.Set |
getClasses()
Return the set of all named classes. |
java.util.Set |
getEquivalentClasses(com.hp.hpl.jena.rdf.model.Resource c)
Return all the (named) equivalent classes. |
java.util.Set |
getIndividuals()
Return the set of all named individuals. |
java.util.Set |
getIndividualsWithProperty(com.hp.hpl.jena.rdf.model.Property p,
com.hp.hpl.jena.rdf.model.Resource r)
List all subjects with a given property and property value. |
java.util.Set |
getInstances(com.hp.hpl.jena.rdf.model.Resource c)
Get all the instances of the given class. |
java.util.Set |
getInstances(com.hp.hpl.jena.rdf.model.Resource c,
boolean direct)
Returns the instances of class c. |
KnowledgeBase |
getKB()
Return the KnowledgeBase that backs this reasoner. |
java.lang.String |
getLevel()
|
OWLMETLoader |
getLoader()
|
com.hp.hpl.jena.rdf.model.Model |
getModel()
Return the Jena model where all the loaded models are accumulated. |
OWLMETModelExtractor |
getModelExtractor()
Return the associated model extractor |
com.hp.hpl.jena.rdf.model.RDFNode |
getPropertyValue(com.hp.hpl.jena.rdf.model.Property p,
com.hp.hpl.jena.rdf.model.RDFNode r)
|
java.util.Set |
getPropertyValues(com.hp.hpl.jena.rdf.model.Property p,
com.hp.hpl.jena.rdf.model.RDFNode r)
Return all property values for a given property and subject value. |
OWLSpecies |
getSpecies()
Return the species of the model loaded to this reasoner. |
java.util.Set |
getSubClasses(com.hp.hpl.jena.rdf.model.Resource c)
Return all the (named) subclasses of the given class. |
java.util.Set |
getSubClasses(com.hp.hpl.jena.rdf.model.Resource c,
boolean direct)
Returns the (named) subclasses of class c. |
java.util.Set |
getSuperClasses(com.hp.hpl.jena.rdf.model.Resource c)
Return all the (named) super classes of the given class. |
java.util.Set |
getSuperClasses(com.hp.hpl.jena.rdf.model.Resource c,
boolean direct)
Returns the (named) superclasses of class c. |
com.hp.hpl.jena.rdf.model.Resource |
getType(com.hp.hpl.jena.rdf.model.Resource ind)
|
com.hp.hpl.jena.rdf.model.Resource |
getType(com.hp.hpl.jena.rdf.model.Resource ind,
boolean direct)
|
java.util.Set |
getTypes(com.hp.hpl.jena.rdf.model.Resource ind)
Get all the (named) classes individual belongs to. |
java.util.Set |
getTypes(com.hp.hpl.jena.rdf.model.Resource ind,
boolean direct)
Returns the (named) classes individual belongs to. |
boolean |
hasDomain(com.hp.hpl.jena.rdf.model.Resource p,
com.hp.hpl.jena.rdf.model.Resource c)
|
boolean |
hasPropertyValue(com.hp.hpl.jena.rdf.model.Resource s,
com.hp.hpl.jena.rdf.model.Resource p,
com.hp.hpl.jena.rdf.model.RDFNode o)
Checks is a triple (s, p, o) exists in the knowledge base. |
boolean |
hasRange(com.hp.hpl.jena.rdf.model.Resource p,
com.hp.hpl.jena.rdf.model.Resource c)
|
boolean |
isAnnotationProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isClass(com.hp.hpl.jena.rdf.model.Resource c)
Check id the given resource is defined as a class. |
boolean |
isComplement(com.hp.hpl.jena.rdf.model.Resource c1,
com.hp.hpl.jena.rdf.model.Resource c2)
|
boolean |
isConsistent()
Check if the loaded ontologies is consistent. |
boolean |
isDatatypeProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isDifferentFrom(com.hp.hpl.jena.rdf.model.Resource i1,
com.hp.hpl.jena.rdf.model.Resource i2)
|
boolean |
isDiscardJenaGraph()
|
boolean |
isDisjoint(com.hp.hpl.jena.rdf.model.Resource c1,
com.hp.hpl.jena.rdf.model.Resource c2)
|
boolean |
isEconnEnabled()
|
boolean |
isEntailed(com.hp.hpl.jena.rdf.model.Model model)
Check if all the statements in a given model is entailed by the current KB. |
boolean |
isEntailed(com.hp.hpl.jena.rdf.model.Resource s,
com.hp.hpl.jena.rdf.model.Property p,
com.hp.hpl.jena.rdf.model.RDFNode ox)
Chekc if the given subject, property, object triple is entailed by the KB. |
boolean |
isEntailed(com.hp.hpl.jena.rdf.model.Statement stmt)
Check if the given statement is entailed by the KB. |
boolean |
isEquivalentClass(com.hp.hpl.jena.rdf.model.Resource r1,
com.hp.hpl.jena.rdf.model.Resource r2)
|
boolean |
isEquivalentProperty(com.hp.hpl.jena.rdf.model.Resource p1,
com.hp.hpl.jena.rdf.model.Resource p2)
|
boolean |
isFunctionalProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isIndividual(com.hp.hpl.jena.rdf.model.Resource ind)
|
boolean |
isInstanceOf(com.hp.hpl.jena.rdf.model.Resource ind,
com.hp.hpl.jena.rdf.model.Resource c)
Check if the given individual is an instance of the given class. |
boolean |
isInverse(com.hp.hpl.jena.rdf.model.Resource p1,
com.hp.hpl.jena.rdf.model.Resource p2)
|
boolean |
isInverseFunctionalProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isObjectProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isSameAs(com.hp.hpl.jena.rdf.model.Resource i1,
com.hp.hpl.jena.rdf.model.Resource i2)
|
boolean |
isSatisfiable(com.hp.hpl.jena.rdf.model.Resource r)
Check if the given class is satisfiable. |
boolean |
isSubclassOf(com.hp.hpl.jena.rdf.model.Resource r1,
com.hp.hpl.jena.rdf.model.Resource r2)
Deprecated. As of Pellet 1.1.1, replaced by isSubClassOf(Resource,Resource) |
boolean |
isSubClassOf(com.hp.hpl.jena.rdf.model.Resource r1,
com.hp.hpl.jena.rdf.model.Resource r2)
|
boolean |
isSubPropertyOf(com.hp.hpl.jena.rdf.model.Resource p1,
com.hp.hpl.jena.rdf.model.Resource p2)
|
boolean |
isSubTypeOf(com.hp.hpl.jena.datatypes.RDFDatatype d1,
com.hp.hpl.jena.datatypes.RDFDatatype d2)
|
boolean |
isSubTypeOf(java.lang.String d1,
java.lang.String d2)
|
boolean |
isSymmetricProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isTransitiveProperty(com.hp.hpl.jena.rdf.model.Resource p)
|
boolean |
isType(com.hp.hpl.jena.rdf.model.Resource ind,
com.hp.hpl.jena.rdf.model.Resource c)
|
void |
load(DisjointMultiUnion newGraph)
|
void |
load(com.hp.hpl.jena.graph.Graph graph)
Load the Jena graph to the reasoner. |
void |
load(com.hp.hpl.jena.rdf.model.Model newModel)
Load the Jena model to the reasoner. |
void |
load(java.lang.String uri)
Load the ontology from the given URI (with its imports) |
void |
load(java.lang.String uri,
boolean withImports)
Load the ontology from the given URI, with or without its imports. |
aterm.ATermAppl |
node2term(com.hp.hpl.jena.rdf.model.RDFNode r)
Convert the RDFNode to ATerm representation. |
void |
realize()
For each named individual compute all the classes they belong to. |
com.hp.hpl.jena.rdql.QueryResults |
runQuery(com.hp.hpl.jena.rdql.Query rdql)
|
com.hp.hpl.jena.rdql.QueryResults |
runQuery(java.lang.String queryStr)
Run the RDQL query and return the results. |
void |
setDiscardJenaGraph(boolean discardJenaGraph)
|
void |
setEconnEnabled(boolean econnEnabled)
|
com.hp.hpl.jena.rdf.model.RDFNode |
toJenaNode(aterm.ATermAppl term)
Convert an ATerm (or a Literal) to a Jena RDFNode. |
com.hp.hpl.jena.rdf.model.Resource |
toJenaResource(aterm.ATermAppl term)
Convert an ATerm to a Jena resource. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean DEBUG
public static final java.util.List SKIP
Constructor Detail |
---|
public OWLMETReasoner()
Method Detail |
---|
public void clear()
public void load(java.lang.String uri)
uri
- URI of the ontologypublic void load(java.lang.String uri, boolean withImports)
uri
- URI of the ontologywithImports
- If true load imports toopublic void load(com.hp.hpl.jena.rdf.model.Model newModel)
model
- public void load(com.hp.hpl.jena.graph.Graph graph)
graph
- public void load(DisjointMultiUnion newGraph)
public KnowledgeBase getKB()
public com.hp.hpl.jena.rdf.model.Model getModel()
public OWLSpecies getSpecies() throws UnsupportedFeatureException
UnsupportedFeatureException
public java.lang.String getLevel()
public boolean isConsistent()
public void classify()
public void realize()
public OWLMETModelExtractor getModelExtractor()
public com.hp.hpl.jena.rdf.model.Model extractModel(boolean verbose)
verbose
- If this parameter is false only direct subclass, subproperty
and type assertions are included in the result (rest can easily be found
with transitivity). If the parameter is true all the subclass, subproperty
and type assertions are put into the result.
public com.hp.hpl.jena.rdf.model.Model extractClassModel(boolean verbose)
verbose
- If false only direct subclass relations are returned,
otherwise all the subclass relations are put into the result.
public com.hp.hpl.jena.rdf.model.Model extractPropertyModel(boolean verbose)
verbose
- If false only direct subproperty relations are returned,
otherwise all the subproperty relations are put into the result.
public com.hp.hpl.jena.rdf.model.Model extractIndividualModel(boolean verbose)
verbose
- If false only direct type assertions are returned,
otherwise all the type relations are put into the result.
public java.util.Set getClasses()
public java.util.Set getIndividuals()
public aterm.ATermAppl node2term(com.hp.hpl.jena.rdf.model.RDFNode r)
r
-
public boolean isClass(com.hp.hpl.jena.rdf.model.Resource c)
c
-
public boolean isSatisfiable(com.hp.hpl.jena.rdf.model.Resource r)
r
-
public boolean isSubTypeOf(java.lang.String d1, java.lang.String d2)
public boolean isSubTypeOf(com.hp.hpl.jena.datatypes.RDFDatatype d1, com.hp.hpl.jena.datatypes.RDFDatatype d2)
public boolean isSubclassOf(com.hp.hpl.jena.rdf.model.Resource r1, com.hp.hpl.jena.rdf.model.Resource r2)
isSubClassOf(Resource,Resource)
public boolean isSubClassOf(com.hp.hpl.jena.rdf.model.Resource r1, com.hp.hpl.jena.rdf.model.Resource r2)
public boolean isEquivalentClass(com.hp.hpl.jena.rdf.model.Resource r1, com.hp.hpl.jena.rdf.model.Resource r2)
public boolean isDisjoint(com.hp.hpl.jena.rdf.model.Resource c1, com.hp.hpl.jena.rdf.model.Resource c2)
public boolean isComplement(com.hp.hpl.jena.rdf.model.Resource c1, com.hp.hpl.jena.rdf.model.Resource c2)
public boolean isProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isDatatypeProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isObjectProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isAnnotationProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isTransitiveProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isSymmetricProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isFunctionalProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isInverseFunctionalProperty(com.hp.hpl.jena.rdf.model.Resource p)
public boolean isSubPropertyOf(com.hp.hpl.jena.rdf.model.Resource p1, com.hp.hpl.jena.rdf.model.Resource p2)
public boolean isEquivalentProperty(com.hp.hpl.jena.rdf.model.Resource p1, com.hp.hpl.jena.rdf.model.Resource p2)
public boolean isInverse(com.hp.hpl.jena.rdf.model.Resource p1, com.hp.hpl.jena.rdf.model.Resource p2)
public boolean hasDomain(com.hp.hpl.jena.rdf.model.Resource p, com.hp.hpl.jena.rdf.model.Resource c)
public boolean hasRange(com.hp.hpl.jena.rdf.model.Resource p, com.hp.hpl.jena.rdf.model.Resource c)
public boolean isIndividual(com.hp.hpl.jena.rdf.model.Resource ind)
public boolean isSameAs(com.hp.hpl.jena.rdf.model.Resource i1, com.hp.hpl.jena.rdf.model.Resource i2)
public boolean isDifferentFrom(com.hp.hpl.jena.rdf.model.Resource i1, com.hp.hpl.jena.rdf.model.Resource i2)
public boolean isType(com.hp.hpl.jena.rdf.model.Resource ind, com.hp.hpl.jena.rdf.model.Resource c)
public boolean hasPropertyValue(com.hp.hpl.jena.rdf.model.Resource s, com.hp.hpl.jena.rdf.model.Resource p, com.hp.hpl.jena.rdf.model.RDFNode o)
s
- subject of the triplep
- predicate of the tripleo
- object of the triple
public boolean isEntailed(com.hp.hpl.jena.rdf.model.Model model) throws UnsupportedFeatureException
model
-
UnsupportedFeatureException
public boolean isEntailed(com.hp.hpl.jena.rdf.model.Statement stmt) throws UnsupportedFeatureException
stmt
-
UnsupportedFeatureException
public boolean isEntailed(com.hp.hpl.jena.rdf.model.Resource s, com.hp.hpl.jena.rdf.model.Property p, com.hp.hpl.jena.rdf.model.RDFNode ox)
s
- Subjectp
- Predicateox
- Object
public java.util.Set getSuperClasses(com.hp.hpl.jena.rdf.model.Resource c, boolean direct)
*** This function will first classify the whole ontology ***
c
-
public java.util.Set getSuperClasses(com.hp.hpl.jena.rdf.model.Resource c)
*** This function will first classify the whole ontology ***
c
-
public java.util.Set getSubClasses(com.hp.hpl.jena.rdf.model.Resource c)
*** This function will first classify the whole ontology ***
c
-
public java.util.Set getSubClasses(com.hp.hpl.jena.rdf.model.Resource c, boolean direct)
*** This function will first classify the whole ontology ***
c
-
public java.util.Set getEquivalentClasses(com.hp.hpl.jena.rdf.model.Resource c)
*** This function will first classify the whole ontology ***
c
-
public boolean isInstanceOf(com.hp.hpl.jena.rdf.model.Resource ind, com.hp.hpl.jena.rdf.model.Resource c)
c
-
public java.util.Set getInstances(com.hp.hpl.jena.rdf.model.Resource c)
*** This function will first classify the whole ontology ***
c
-
public java.util.Set getInstances(com.hp.hpl.jena.rdf.model.Resource c, boolean direct)
*** This function will first realize the whole ontology ***
c
- Class whose instances are returneddirect
- if true return only the direct instances, otherwise return all the instances
public java.util.Set getTypes(com.hp.hpl.jena.rdf.model.Resource ind)
*** This function will first realize the whole ontology ***
ind
- An individual name
public java.util.Set getTypes(com.hp.hpl.jena.rdf.model.Resource ind, boolean direct)
ind
- An individual namedirect
- If true return only the direct types, otherwise return all types
public com.hp.hpl.jena.rdf.model.Resource getType(com.hp.hpl.jena.rdf.model.Resource ind)
public com.hp.hpl.jena.rdf.model.Resource getType(com.hp.hpl.jena.rdf.model.Resource ind, boolean direct)
public java.util.Set getIndividualsWithProperty(com.hp.hpl.jena.rdf.model.Property p, com.hp.hpl.jena.rdf.model.Resource r)
public java.util.Set getPropertyValues(com.hp.hpl.jena.rdf.model.Property p, com.hp.hpl.jena.rdf.model.RDFNode r)
r
- x
-
public com.hp.hpl.jena.rdf.model.RDFNode getPropertyValue(com.hp.hpl.jena.rdf.model.Property p, com.hp.hpl.jena.rdf.model.RDFNode r)
public com.hp.hpl.jena.rdf.model.RDFNode toJenaNode(aterm.ATermAppl term)
term
-
public com.hp.hpl.jena.rdf.model.Resource toJenaResource(aterm.ATermAppl term)
term
-
public com.hp.hpl.jena.rdql.QueryResults runQuery(java.lang.String queryStr) throws UnsupportedQueryException
queryStr
- The RDQL query
UnsupportedQueryException
public com.hp.hpl.jena.rdql.QueryResults runQuery(com.hp.hpl.jena.rdql.Query rdql) throws UnsupportedQueryException
UnsupportedQueryException
public com.hp.hpl.jena.query.ResultSet execQuery(java.lang.String queryStr) throws UnsupportedQueryException
UnsupportedQueryException
public com.hp.hpl.jena.query.ResultSet execQuery(com.hp.hpl.jena.query.Query sparql) throws UnsupportedQueryException
UnsupportedQueryException
public boolean isEconnEnabled()
public void setEconnEnabled(boolean econnEnabled)
econnEnabled
- The econnEnabled to set.public OWLMETLoader getLoader()
public boolean isDiscardJenaGraph()
public void setDiscardJenaGraph(boolean discardJenaGraph)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |