owltools.graph
Class OWLGraphWrapper

java.lang.Object
  extended by owltools.graph.OWLGraphWrapper

public class OWLGraphWrapper
extends Object

Wraps one or more OWLOntology objects providing convenient OBO-like operations

Capabilities

Data model

An instance of an OWLGraphWrapper wraps one or more OWLOntology objects. One of these is designated the sourceOntology, the others are designated support ontologies (see getSourceOntology() and getSupportOntologies()). The source ontology may import the support ontologies, but this is optional. Most OWLGraphWrapper methods operate over the union of the source ontology and support ontologies. This is particularly useful for working with OBO Library ontologies, where axioms connecting ontologies may be available as separate ontologies.

Graph operations

See owltools.graph

Fetching objects

This wrapper provides convenience methods for fetching objects by OBO-Style IDs, IRIs or by labels. Note that unlike the get* calls on OWLDataFactory objects, these only return an object if it has been declared in either the source ontology or a support ontology. See for example

OBO Metadata

OBO-style identifiers

This class accepts the use of OBO-Format style identifiers in some contexts, e.g. GO:0008150 See methods such as

Textual metadata

Documentation to follow....

Author:
cjm
See Also:
OWLGraphUtil

Nested Class Summary
 class OWLGraphWrapper.Config
          Configuration options.
static interface OWLGraphWrapper.ISynonym
           
static class OWLGraphWrapper.Synonym
           
 
Field Summary
static String DEFAULT_IRI_PREFIX
           
 Map<org.semanticweb.owlapi.model.OWLObject,Set<OWLGraphEdge>> inferredEdgeBySource
           
 
Constructor Summary
OWLGraphWrapper(org.semanticweb.owlapi.model.OWLOntology ontology)
          Create a new wrapper for an OWLOntology
OWLGraphWrapper(org.semanticweb.owlapi.model.OWLOntology ontology, boolean isMergeImportClosure)
          Deprecated.  
OWLGraphWrapper(String iri)
          creates a new OWLOntology as the source ontology
 
Method Summary
 void addImport(org.semanticweb.owlapi.model.OWLOntology extOnt)
          adds an imports declaration between the source ontology and extOnt
 void addQueryOntology(org.semanticweb.owlapi.model.OWLOntology extOnt)
          Deprecated. 
 void addSupportOntologiesFromImportsClosure()
          Each ontology in the import closure of the source ontology is added to the list of support ontologies
 void addSupportOntology(org.semanticweb.owlapi.model.OWLOntology o)
           
 void cacheEdges()
          caches full outgoing and incoming edges in general you should not need to call this directly; used internally by this class.
 OWLGraphEdge combineEdgePair(org.semanticweb.owlapi.model.OWLObject s, OWLGraphEdge ne, OWLGraphEdge extEdge, int nextDist)
          Composes two graph edges into a new edge, using axioms in the ontology to determine the correct composition For examole, Edge(x,SUBCLASS_OF,y) * Edge(y,SUBCLASS_OF,z) yields Edge(x,SUBCLASS_OF,z) Note that property chains of length>2 are currently ignored
 org.semanticweb.owlapi.model.OWLObject edgeToTargetExpression(OWLGraphEdge e)
          pack/translate an edge (either asserted or a graph closure edge) into an OWL class expression according to the OWLGraph to OWLOntology translation rules.
 Set<org.semanticweb.owlapi.model.OWLOntology> getAllOntologies()
          in general application code need not call this - it is mostly used internally
 Set<org.semanticweb.owlapi.model.OWLObject> getAllOWLObjects()
          fetches all classes, individuals and object properties in all ontologies
 Set<String> getAllUsedSubsets()
          fetches all subset names that are used
 List<String> getAltIds(org.semanticweb.owlapi.model.OWLObject c)
          It returns the values of the alt_id tag
 Set<org.semanticweb.owlapi.model.OWLObject> getAncestors(org.semanticweb.owlapi.model.OWLObject x)
          returns all ancestors of an object.
 Set<org.semanticweb.owlapi.model.OWLObject> getAncestors(org.semanticweb.owlapi.model.OWLObject x, Set<org.semanticweb.owlapi.model.OWLPropertyExpression> overProps)
          returns all ancestors that can be reached over subclass or the specified set of relations
 Set<org.semanticweb.owlapi.model.OWLObject> getAncestorsReflexive(org.semanticweb.owlapi.model.OWLObject x)
           
 Set<org.semanticweb.owlapi.model.OWLObject> getAncestorsReflexive(org.semanticweb.owlapi.model.OWLObject x, Set<org.semanticweb.owlapi.model.OWLPropertyExpression> overProps)
           
 org.semanticweb.owlapi.model.OWLAnnotationProperty getAnnotationProperty(String tag)
          It translates a oboformat tag into an OWL annotation property
 String getAnnotationValue(org.semanticweb.owlapi.model.OWLObject c, org.semanticweb.owlapi.model.OWLAnnotationProperty lap)
          fetches the value of a single-valued annotation property for an OWLObject TODO: provide a flag that determines behavior in the case of >1 value
 List<String> getAnnotationValues(org.semanticweb.owlapi.model.OWLObject c, org.semanticweb.owlapi.model.OWLAnnotationProperty lap)
          gets the values of all annotation assertions to an OWLObject for a particular annotation property
 boolean getBuiltin(org.semanticweb.owlapi.model.OWLObject c)
          Deprecated. 
 String getComment(org.semanticweb.owlapi.model.OWLObject c)
          gets the value of rdfs:comment for an OWLObject
 OWLGraphWrapper.Config getConfig()
           
 String getConsider(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the consider tag.
 String getCreatedBy(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the created_by tag
 org.semanticweb.owlapi.model.OWLDataFactory getDataFactory()
           
 String getDef(org.semanticweb.owlapi.model.OWLObject c)
          Gets the textual definition of an OWLObject assumes zero or one def It returns the definition text (encoded as def in obo format and IAO_0000115 annotation property in OWL format) of a class
 List<String> getDefXref(org.semanticweb.owlapi.model.OWLObject c)
          Get the definition xrefs (IAO_0000115)
 Set<org.semanticweb.owlapi.model.OWLObject> getDescendants(org.semanticweb.owlapi.model.OWLObject x)
          gets all descendants d of x, where d is reachable by any path.
 Set<org.semanticweb.owlapi.model.OWLObject> getDescendantsReflexive(org.semanticweb.owlapi.model.OWLObject x)
          gets all reflexive descendants d of x, where d is reachable by any path.
 String getDomain(org.semanticweb.owlapi.model.OWLObjectProperty prop)
          It returns the value of the domain tag
 Set<OWLGraphEdge> getEdgesBetween(org.semanticweb.owlapi.model.OWLObject s, org.semanticweb.owlapi.model.OWLObject t)
           
 String getIdentifier(org.semanticweb.owlapi.model.IRI iriId)
          gets the OBO-style ID of the specified object.
 String getIdentifier(org.semanticweb.owlapi.model.OWLObject owlObject)
          gets the OBO-style ID of the specified object.
 Set<OWLGraphEdge> getIncomingEdges(org.semanticweb.owlapi.model.OWLObject t)
           
 Set<OWLGraphEdge> getIncomingEdgesClosure(org.semanticweb.owlapi.model.OWLObject t)
          gets all inferred edges coming in to the target edge for every s, if t is reachable from s, then include the inferred edge between s and t.
 Set<org.semanticweb.owlapi.model.OWLObject> getIndividualDescendants(org.semanticweb.owlapi.model.OWLObject x)
          return all individuals i where x is reachable from i
 Set<OWLGraphEdge> getInstanceChainsFromClosure(org.semanticweb.owlapi.model.OWLClass c)
          Finds all edges between an instance i and he given class c.
 Set<org.semanticweb.owlapi.model.OWLIndividual> getInstancesFromClosure(org.semanticweb.owlapi.model.OWLClass c)
          Find all edges of the form [i INST c] in the graph closure.
 org.semanticweb.owlapi.model.IRI getIRIByIdentifier(String id)
           
 org.semanticweb.owlapi.model.IRI getIRIByLabel(String label)
          fetches an OWL IRI by rdfs:label
 org.semanticweb.owlapi.model.IRI getIRIByLabel(String label, boolean isEnforceUnivocal)
          fetches an OWL IRI by rdfs:label, optionally testing for uniqueness TODO: index labels.
 boolean getIsAnonymous(org.semanticweb.owlapi.model.OWLObject c)
          Deprecated. 
 boolean getIsAntiSymmetric(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the is_anti_symmetric tag or IAO_0000427 annotation
 boolean getIsCyclic(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the is_cyclic tag
 boolean getIsFunctional(org.semanticweb.owlapi.model.OWLObjectProperty c)
          true if c is functional in the source ontology
 boolean getIsInverseFunctional(org.semanticweb.owlapi.model.OWLObjectProperty c)
           
 boolean getIsMetaTag(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the is_metadata_tag tag.
 boolean getIsObsolete(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the is-obsolete tag.
 boolean getIsReflexive(org.semanticweb.owlapi.model.OWLObjectProperty c)
           
 boolean getIsSymmetric(org.semanticweb.owlapi.model.OWLObjectProperty c)
           
 boolean getIsTransitive(org.semanticweb.owlapi.model.OWLObjectProperty c)
          true if c is transitive in the source ontology
 String getLabel(org.semanticweb.owlapi.model.OWLObject c)
          fetches the rdfs:label for an OWLObject assumes zero or one rdfs:label
 String getLabelOrDisplayId(org.semanticweb.owlapi.model.OWLObject c)
           
 org.semanticweb.owlapi.model.OWLOntologyManager getManager()
           
 Set<org.semanticweb.owlapi.model.OWLObject> getNamedAncestors(org.semanticweb.owlapi.model.OWLObject x)
          Gets all ancestors that are OWLNamedObjects i.e.
 Set<org.semanticweb.owlapi.model.OWLObject> getNamedAncestorsReflexive(org.semanticweb.owlapi.model.OWLObject x)
           
 String getNamespace(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the OBO-namespace tag Example: if the OWLObject is the GO class GO:0008150, this would return "biological_process"
 List<OWLGraphWrapper.ISynonym> getOBOSynonyms(org.semanticweb.owlapi.model.OWLObject c)
          It returns array of synonyms as encoded by OBO2OWL.
 org.semanticweb.owlapi.model.OWLOntology getOntology()
          Deprecated. 
 String getOntologyId()
          gets the OBO-style ID of the source ontology IRI.
 Set<OWLGraphEdge> getOutgoingEdges(org.semanticweb.owlapi.model.OWLObject cls)
          retrieves direct edges from a source to the direct **named** target e.g.
 Set<OWLGraphEdge> getOutgoingEdges(org.semanticweb.owlapi.model.OWLObject obj, boolean isClosure, boolean isReflexive)
           
 Set<OWLGraphEdge> getOutgoingEdgesClosure(org.semanticweb.owlapi.model.OWLObject s)
          Retrieves the graph closure originating from source.
 Set<OWLGraphEdge> getOutgoingEdgesClosureReflexive(org.semanticweb.owlapi.model.OWLObject s)
          as getOutgoingEdgesClosure(s), but also includes an identity edge
 org.semanticweb.owlapi.model.OWLClass getOWLClass(org.semanticweb.owlapi.model.IRI iri)
          Returns an OWLClass given an IRI the class must be declared in either the source ontology, or in a support ontology, otherwise null is returned
 org.semanticweb.owlapi.model.OWLClass getOWLClass(org.semanticweb.owlapi.model.OWLObject x)
           
 org.semanticweb.owlapi.model.OWLClass getOWLClass(String s)
          Returns an OWLClass given an IRI string the class must be declared in either the source ontology, or in a support ontology, otherwise null is returned
 org.semanticweb.owlapi.model.OWLClass getOWLClassByIdentifier(String id)
          Given an OBO-style ID, return the corresponding OWLClass, if it is declared - otherwise null
 Set<org.semanticweb.owlapi.model.OWLClass> getOWLClassesInSubset(String subset)
          given a subset name, find all OWLClasses assigned to that subset
 org.semanticweb.owlapi.model.OWLNamedIndividual getOWLIndividual(org.semanticweb.owlapi.model.IRI iri)
          Returns an OWLNamedIndividual with this IRI if it has been declared in the source or support ontologies.
 org.semanticweb.owlapi.model.OWLNamedIndividual getOWLIndividual(String s)
           
 org.semanticweb.owlapi.model.OWLNamedIndividual getOWLIndividualByIdentifier(String id)
          Given an OBO-style ID, return the corresponding OWLNamedIndividual, if it is declared - otherwise null
 org.semanticweb.owlapi.model.OWLObject getOWLObject(String s)
          Returns the OWLObject with this IRI (where IRI is specified as a string - e.g http://purl.obolibrary.org/obo/GO_0008150)
 org.semanticweb.owlapi.model.OWLObject getOWLObjectByIdentifier(String id)
          Given an OBO-style ID, return the corresponding OWLObject, if it is declared - otherwise null
 org.semanticweb.owlapi.model.OWLObject getOWLObjectByLabel(String label)
          fetches an OWL Object by rdfs:label if there is >1 match, return the first one encountered
 org.semanticweb.owlapi.model.OWLObjectProperty getOWLObjectProperty(org.semanticweb.owlapi.model.IRI iri)
           
 org.semanticweb.owlapi.model.OWLObjectProperty getOWLObjectProperty(String iri)
          Returns the OWLObjectProperty with this IRI Must have been declared in one of the ontologies
 org.semanticweb.owlapi.model.OWLObjectProperty getOWLObjectPropertyByIdentifier(String id)
          Given an OBO-style ID, return the corresponding OWLObjectProperty, if it is declared - otherwise null
 Set<org.semanticweb.owlapi.model.OWLObject> getOWLObjectsInSubset(String subset)
          given a subset name, find all OWLObjects (typically OWLClasses) assigned to that subset
 Set<OWLGraphEdge> getPrimitiveOutgoingEdges(org.semanticweb.owlapi.model.OWLObject s)
          primitive edges connect any combination of named objects and expressions e.g.
 Profiler getProfiler()
           
 String getRange(org.semanticweb.owlapi.model.OWLObjectProperty prop)
          It returns the value of the range tag
 org.semanticweb.owlapi.reasoner.OWLReasoner getReasoner()
           
 List<String> getReplacedBy(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the replaced_by tag or IAO_0100001 annotation.
 org.semanticweb.owlapi.model.OWLOntology getSourceOntology()
          Every OWLGraphWrapper objects wraps zero or one source ontologies.
 String[] getSubClassesNames(org.semanticweb.owlapi.model.OWLClass cls)
          Deprecated. 
 List<String> getSubsets(org.semanticweb.owlapi.model.OWLObject c)
          It returns the value of the subset tag.
 Set<org.semanticweb.owlapi.model.OWLObject> getSubsumersFromClosure(org.semanticweb.owlapi.model.OWLObject s)
          find the set of classes or class expressions subsuming source, using the graph closure.
 Set<org.semanticweb.owlapi.model.OWLObjectPropertyExpression> getSuperPropertiesOf(org.semanticweb.owlapi.model.OWLObjectPropertyExpression p)
          returns parent properties of p in all ontologies
 Set<org.semanticweb.owlapi.model.OWLOntology> getSupportOntologySet()
          all operations are over a set of ontologies - the source ontology plus any number of supporting ontologies.
 String[] getSynonymStrings(org.semanticweb.owlapi.model.OWLObject c)
          Deprecated. 
 List<String> getXref(org.semanticweb.owlapi.model.OWLObject c)
          get the values of of the obo xref tag
 boolean isObsolete(org.semanticweb.owlapi.model.OWLObject c)
          tests if an OWLObject has been declared obsolete in the source ontology
 void mergeOntology(org.semanticweb.owlapi.model.OWLOntology extOnt)
          Adds all axioms from extOnt into source ontology
 Set<org.semanticweb.owlapi.model.OWLObject> queryDescendants(org.semanticweb.owlapi.model.OWLClassExpression t)
          Performs a closed-world query using a DL expression as a set of boolean database-style constraints.
 Set<org.semanticweb.owlapi.model.OWLObject> queryDescendants(org.semanticweb.owlapi.model.OWLClassExpression t, boolean isInstances, boolean isClasses)
           
 Set<org.semanticweb.owlapi.model.OWLObject> queryDescendants(OWLGraphEdge e)
           
 void removeSupportOntology(org.semanticweb.owlapi.model.OWLOntology o)
           
 void setConfig(OWLGraphWrapper.Config config)
           
 void setDataFactory(org.semanticweb.owlapi.model.OWLDataFactory dataFactory)
           
 void setManager(org.semanticweb.owlapi.model.OWLOntologyManager manager)
           
 void setOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
          Deprecated. 
 void setProfiler(Profiler profiler)
           
 void setReasoner(org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
           
 void setSourceOntology(org.semanticweb.owlapi.model.OWLOntology sourceOntology)
           
 void setSupportOntologySet(Set<org.semanticweb.owlapi.model.OWLOntology> supportOntologySet)
           
 void useImportClosureForQueries()
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IRI_PREFIX

public static final String DEFAULT_IRI_PREFIX
See Also:
Constant Field Values

inferredEdgeBySource

public Map<org.semanticweb.owlapi.model.OWLObject,Set<OWLGraphEdge>> inferredEdgeBySource
Constructor Detail

OWLGraphWrapper

public OWLGraphWrapper(org.semanticweb.owlapi.model.OWLOntology ontology)
                throws org.semanticweb.owlapi.model.UnknownOWLOntologyException,
                       org.semanticweb.owlapi.model.OWLOntologyCreationException
Create a new wrapper for an OWLOntology

Parameters:
ontology -
Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException
org.semanticweb.owlapi.model.UnknownOWLOntologyException

OWLGraphWrapper

@Deprecated
public OWLGraphWrapper(org.semanticweb.owlapi.model.OWLOntology ontology,
                                  boolean isMergeImportClosure)
                throws org.semanticweb.owlapi.model.UnknownOWLOntologyException,
                       org.semanticweb.owlapi.model.OWLOntologyCreationException
Deprecated. 

Create a new wrapper for an OWLOntology

Parameters:
ontology -
isMergeImportClosure -
Throws:
org.semanticweb.owlapi.model.UnknownOWLOntologyException
org.semanticweb.owlapi.model.OWLOntologyCreationException

OWLGraphWrapper

public OWLGraphWrapper(String iri)
                throws org.semanticweb.owlapi.model.OWLOntologyCreationException
creates a new OWLOntology as the source ontology

Parameters:
iri -
Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException
Method Detail

addImport

public void addImport(org.semanticweb.owlapi.model.OWLOntology extOnt)
adds an imports declaration between the source ontology and extOnt

Parameters:
extOnt -

useImportClosureForQueries

@Deprecated
public void useImportClosureForQueries()
                                throws org.semanticweb.owlapi.model.UnknownOWLOntologyException,
                                       org.semanticweb.owlapi.model.OWLOntologyCreationException
Deprecated. 

if called, copies all axioms from import closure into query ontology.

Throws:
org.semanticweb.owlapi.model.UnknownOWLOntologyException
org.semanticweb.owlapi.model.OWLOntologyCreationException

addQueryOntology

@Deprecated
public void addQueryOntology(org.semanticweb.owlapi.model.OWLOntology extOnt)
                      throws org.semanticweb.owlapi.model.OWLOntologyCreationException
Deprecated. 

Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException

mergeOntology

public void mergeOntology(org.semanticweb.owlapi.model.OWLOntology extOnt)
                   throws org.semanticweb.owlapi.model.OWLOntologyCreationException
Adds all axioms from extOnt into source ontology

Parameters:
extOnt -
Throws:
org.semanticweb.owlapi.model.OWLOntologyCreationException

getOntology

@Deprecated
public org.semanticweb.owlapi.model.OWLOntology getOntology()
Deprecated. 


setOntology

@Deprecated
public void setOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
Deprecated. 


getSourceOntology

public org.semanticweb.owlapi.model.OWLOntology getSourceOntology()
Every OWLGraphWrapper objects wraps zero or one source ontologies.

Returns:

setSourceOntology

public void setSourceOntology(org.semanticweb.owlapi.model.OWLOntology sourceOntology)

getProfiler

public Profiler getProfiler()

setProfiler

public void setProfiler(Profiler profiler)

getReasoner

public org.semanticweb.owlapi.reasoner.OWLReasoner getReasoner()

setReasoner

public void setReasoner(org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
Parameters:
reasoner -

getSupportOntologySet

public Set<org.semanticweb.owlapi.model.OWLOntology> getSupportOntologySet()
all operations are over a set of ontologies - the source ontology plus any number of supporting ontologies. The supporting ontologies may be drawn from the imports closure of the source ontology, although this need not be the case.

Returns:

setSupportOntologySet

public void setSupportOntologySet(Set<org.semanticweb.owlapi.model.OWLOntology> supportOntologySet)

addSupportOntology

public void addSupportOntology(org.semanticweb.owlapi.model.OWLOntology o)

removeSupportOntology

public void removeSupportOntology(org.semanticweb.owlapi.model.OWLOntology o)

addSupportOntologiesFromImportsClosure

public void addSupportOntologiesFromImportsClosure()
Each ontology in the import closure of the source ontology is added to the list of support ontologies


getAllOntologies

public Set<org.semanticweb.owlapi.model.OWLOntology> getAllOntologies()
in general application code need not call this - it is mostly used internally

Returns:
union of source ontology plus all supporting ontologies

getDataFactory

public org.semanticweb.owlapi.model.OWLDataFactory getDataFactory()

setDataFactory

public void setDataFactory(org.semanticweb.owlapi.model.OWLDataFactory dataFactory)

getManager

public org.semanticweb.owlapi.model.OWLOntologyManager getManager()

setManager

public void setManager(org.semanticweb.owlapi.model.OWLOntologyManager manager)

getConfig

public OWLGraphWrapper.Config getConfig()

setConfig

public void setConfig(OWLGraphWrapper.Config config)

getOutgoingEdges

public Set<OWLGraphEdge> getOutgoingEdges(org.semanticweb.owlapi.model.OWLObject cls)
retrieves direct edges from a source to the direct **named** target e.g. if (A SubClassOf B) then outgoing(A) = { } e.g. if (A SubClassOf R some B) then outgoing(A) = { } e.g. if (A SubClassOf R some (R2 some B)) then outgoing(A) = { }

Parameters:
cls - source
Returns:
all edges that originate from source to nearest named object target

getOutgoingEdges

public Set<OWLGraphEdge> getOutgoingEdges(org.semanticweb.owlapi.model.OWLObject obj,
                                          boolean isClosure,
                                          boolean isReflexive)

getPrimitiveOutgoingEdges

public Set<OWLGraphEdge> getPrimitiveOutgoingEdges(org.semanticweb.owlapi.model.OWLObject s)
primitive edges connect any combination of named objects and expressions e.g. (A SubClassOf R some B) => ,

Parameters:
s - source
Returns:
set of OWLGraphEdge

cacheEdges

public void cacheEdges()
caches full outgoing and incoming edges in general you should not need to call this directly; used internally by this class.


getIncomingEdges

public Set<OWLGraphEdge> getIncomingEdges(org.semanticweb.owlapi.model.OWLObject t)
Parameters:
t -
Returns:
all edges that have t as a direct target

edgeToTargetExpression

public org.semanticweb.owlapi.model.OWLObject edgeToTargetExpression(OWLGraphEdge e)
pack/translate an edge (either asserted or a graph closure edge) into an OWL class expression according to the OWLGraph to OWLOntology translation rules. (this is the reverse translation of the one from an OWLOntology to an OWLGraph) e.g. after calling for the graph closure of an OWLClass a, we may get back an edge . after feeding this edge into this method we obtain the expression part_of some (adjacent_to some (has_part some b))

Parameters:
e - edge
Returns:
class expression equivalent to edge

getOutgoingEdgesClosure

public Set<OWLGraphEdge> getOutgoingEdgesClosure(org.semanticweb.owlapi.model.OWLObject s)
Retrieves the graph closure originating from source. E.g. if A SubClassOf R some B & B SubClassOf S some C, then closure(A) = { , . Composition rules are used to compact the list of connecting edge labels (e.g. transitivity). The resulting edges can be translated into class expressions using method edgeToTargetExpression(e). E.g. in the above the expression would be R some (S some C)

Parameters:
s - source
Returns:
closure of edges originating from source

getOutgoingEdgesClosureReflexive

public Set<OWLGraphEdge> getOutgoingEdgesClosureReflexive(org.semanticweb.owlapi.model.OWLObject s)
as getOutgoingEdgesClosure(s), but also includes an identity edge

Parameters:
s -
Returns:

getSubsumersFromClosure

public Set<org.semanticweb.owlapi.model.OWLObject> getSubsumersFromClosure(org.semanticweb.owlapi.model.OWLObject s)
find the set of classes or class expressions subsuming source, using the graph closure. this is just the composition of getOutgoingEdgesClosure and edgeToTargetExpression -- the latter method "packs" a chain of edges into a class expression only "linear" expressions are found, corresponding to a path in the graph. e.g. [sub,part_of-some,develops_from-some] ==> part_of some (develops_from some t) if the edge consists entirely of subclass links, the the subsumers will be all named classes.

Parameters:
s - source
Returns:
set of OWLObject

queryDescendants

public Set<org.semanticweb.owlapi.model.OWLObject> queryDescendants(OWLGraphEdge e)

queryDescendants

public Set<org.semanticweb.owlapi.model.OWLObject> queryDescendants(org.semanticweb.owlapi.model.OWLClassExpression t)
Performs a closed-world query using a DL expression as a set of boolean database-style constraints. No attempt is made to optimize the query. The engine is incomplete and currently ontology implements queries for constructs that use AND, OR, SOME

Parameters:
t - classExpression
Returns:
set of descendants

queryDescendants

public Set<org.semanticweb.owlapi.model.OWLObject> queryDescendants(org.semanticweb.owlapi.model.OWLClassExpression t,
                                                                    boolean isInstances,
                                                                    boolean isClasses)

getEdgesBetween

public Set<OWLGraphEdge> getEdgesBetween(org.semanticweb.owlapi.model.OWLObject s,
                                         org.semanticweb.owlapi.model.OWLObject t)
Parameters:
s - source
t - target
Returns:
all edges connecting source and target in the graph closure

getAncestors

public Set<org.semanticweb.owlapi.model.OWLObject> getAncestors(org.semanticweb.owlapi.model.OWLObject x)
returns all ancestors of an object. Here, ancestors is defined as any named object that can be reached from x over some path of asserted edges. relations are ignored.

Parameters:
x - source
Returns:
all reachable target nodes, regardless of edges

getAncestors

public Set<org.semanticweb.owlapi.model.OWLObject> getAncestors(org.semanticweb.owlapi.model.OWLObject x,
                                                                Set<org.semanticweb.owlapi.model.OWLPropertyExpression> overProps)
returns all ancestors that can be reached over subclass or the specified set of relations

Parameters:
sourceObject -
overProps -
Returns:

getAncestorsReflexive

public Set<org.semanticweb.owlapi.model.OWLObject> getAncestorsReflexive(org.semanticweb.owlapi.model.OWLObject x)

getAncestorsReflexive

public Set<org.semanticweb.owlapi.model.OWLObject> getAncestorsReflexive(org.semanticweb.owlapi.model.OWLObject x,
                                                                         Set<org.semanticweb.owlapi.model.OWLPropertyExpression> overProps)

getNamedAncestors

public Set<org.semanticweb.owlapi.model.OWLObject> getNamedAncestors(org.semanticweb.owlapi.model.OWLObject x)
Gets all ancestors that are OWLNamedObjects i.e. excludes anonymous class expressions

Parameters:
x -
Returns:

getNamedAncestorsReflexive

public Set<org.semanticweb.owlapi.model.OWLObject> getNamedAncestorsReflexive(org.semanticweb.owlapi.model.OWLObject x)

getDescendants

public Set<org.semanticweb.owlapi.model.OWLObject> getDescendants(org.semanticweb.owlapi.model.OWLObject x)
gets all descendants d of x, where d is reachable by any path. Excludes self

Parameters:
x -
Returns:
descendant objects
See Also:
getAncestors(), owltools.graph

getDescendantsReflexive

public Set<org.semanticweb.owlapi.model.OWLObject> getDescendantsReflexive(org.semanticweb.owlapi.model.OWLObject x)
gets all reflexive descendants d of x, where d is reachable by any path. Includes self

Parameters:
x -
Returns:
descendant objects plus x
See Also:
getAncestors(), owltools.graph

getIndividualDescendants

public Set<org.semanticweb.owlapi.model.OWLObject> getIndividualDescendants(org.semanticweb.owlapi.model.OWLObject x)
return all individuals i where x is reachable from i

Parameters:
x -
Returns:
set of individual OWLObjects

getIncomingEdgesClosure

public Set<OWLGraphEdge> getIncomingEdgesClosure(org.semanticweb.owlapi.model.OWLObject t)
gets all inferred edges coming in to the target edge for every s, if t is reachable from s, then include the inferred edge between s and t.

Parameters:
t - target
Returns:
all edges connecting all descendants of target to target
See Also:
getOutgoingEdgesClosure

combineEdgePair

public OWLGraphEdge combineEdgePair(org.semanticweb.owlapi.model.OWLObject s,
                                    OWLGraphEdge ne,
                                    OWLGraphEdge extEdge,
                                    int nextDist)
Composes two graph edges into a new edge, using axioms in the ontology to determine the correct composition For examole, Edge(x,SUBCLASS_OF,y) * Edge(y,SUBCLASS_OF,z) yields Edge(x,SUBCLASS_OF,z) Note that property chains of length>2 are currently ignored

Parameters:
s - - source node
ne - - edge 1
extEdge - - edge 2
nextDist - - new distance
Returns:

getInstancesFromClosure

public Set<org.semanticweb.owlapi.model.OWLIndividual> getInstancesFromClosure(org.semanticweb.owlapi.model.OWLClass c)
Find all edges of the form [i INST c] in the graph closure. (this includes both direct assertions, plus assertions to objects that link to c via a chain of SubClassOf assertions) the semantics are the same as inferred ClassAssertion axioms

Parameters:
c - owlClass
Returns:
all individuals classified here via basic graph traversal

getInstanceChainsFromClosure

public Set<OWLGraphEdge> getInstanceChainsFromClosure(org.semanticweb.owlapi.model.OWLClass c)
Finds all edges between an instance i and he given class c. this includes inferred class assertions, as well as chains such as i has_part j, j inst_of k, k part_of some c

Parameters:
c - owlClass
Returns:
all edges in closure between an instance and owlClass

getAllOWLObjects

public Set<org.semanticweb.owlapi.model.OWLObject> getAllOWLObjects()
fetches all classes, individuals and object properties in all ontologies

Returns:
all named objects

getLabel

public String getLabel(org.semanticweb.owlapi.model.OWLObject c)
fetches the rdfs:label for an OWLObject assumes zero or one rdfs:label

Parameters:
c -
Returns:

getLabelOrDisplayId

public String getLabelOrDisplayId(org.semanticweb.owlapi.model.OWLObject c)

isObsolete

public boolean isObsolete(org.semanticweb.owlapi.model.OWLObject c)
tests if an OWLObject has been declared obsolete in the source ontology

Parameters:
c -
Returns:

getComment

public String getComment(org.semanticweb.owlapi.model.OWLObject c)
gets the value of rdfs:comment for an OWLObject

Parameters:
c -
Returns:

getAnnotationValue

public String getAnnotationValue(org.semanticweb.owlapi.model.OWLObject c,
                                 org.semanticweb.owlapi.model.OWLAnnotationProperty lap)
fetches the value of a single-valued annotation property for an OWLObject TODO: provide a flag that determines behavior in the case of >1 value

Parameters:
c -
lap -
Returns:

getAnnotationValues

public List<String> getAnnotationValues(org.semanticweb.owlapi.model.OWLObject c,
                                        org.semanticweb.owlapi.model.OWLAnnotationProperty lap)
gets the values of all annotation assertions to an OWLObject for a particular annotation property

Parameters:
c -
lap -
Returns:

getDef

public String getDef(org.semanticweb.owlapi.model.OWLObject c)
Gets the textual definition of an OWLObject assumes zero or one def It returns the definition text (encoded as def in obo format and IAO_0000115 annotation property in OWL format) of a class

Parameters:
c -
Returns:

getIsMetaTag

public boolean getIsMetaTag(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the is_metadata_tag tag.

Parameters:
c - could OWLClass or OWLObjectProperty
Returns:

getSubsets

public List<String> getSubsets(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the subset tag.

Parameters:
c - could OWLClass or OWLObjectProperty
Returns:

getAllUsedSubsets

public Set<String> getAllUsedSubsets()
fetches all subset names that are used

Returns:
all subsets used in source ontology

getOWLObjectsInSubset

public Set<org.semanticweb.owlapi.model.OWLObject> getOWLObjectsInSubset(String subset)
given a subset name, find all OWLObjects (typically OWLClasses) assigned to that subset

Parameters:
subset -
Returns:

getOWLClassesInSubset

public Set<org.semanticweb.owlapi.model.OWLClass> getOWLClassesInSubset(String subset)
given a subset name, find all OWLClasses assigned to that subset

Parameters:
subset -
Returns:

getDomain

public String getDomain(org.semanticweb.owlapi.model.OWLObjectProperty prop)
It returns the value of the domain tag

Parameters:
prop -
Returns:

getRange

public String getRange(org.semanticweb.owlapi.model.OWLObjectProperty prop)
It returns the value of the range tag

Parameters:
prop -
Returns:

getReplacedBy

public List<String> getReplacedBy(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the replaced_by tag or IAO_0100001 annotation.

Parameters:
c - could OWLClass or OWLObjectProperty
Returns:

getConsider

public String getConsider(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the consider tag. TODO - needs to be multivalued - this will change in the future

Parameters:
c - could OWLClass or OWLObjectProperty
Returns:

getIsObsolete

public boolean getIsObsolete(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the is-obsolete tag.

Parameters:
c - could OWLClass or OWLObjectProperty
Returns:

getAltIds

public List<String> getAltIds(org.semanticweb.owlapi.model.OWLObject c)
It returns the values of the alt_id tag

Parameters:
c -
Returns:

getBuiltin

@Deprecated
public boolean getBuiltin(org.semanticweb.owlapi.model.OWLObject c)
Deprecated. 

It returns the value of the builtin tag

Parameters:
c -
Returns:

getIsAnonymous

@Deprecated
public boolean getIsAnonymous(org.semanticweb.owlapi.model.OWLObject c)
Deprecated. 

It returns the value of the is_anonymous tag

Parameters:
c -
Returns:

getAnnotationProperty

public org.semanticweb.owlapi.model.OWLAnnotationProperty getAnnotationProperty(String tag)
It translates a oboformat tag into an OWL annotation property

Parameters:
tag -
Returns:

getNamespace

public String getNamespace(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the OBO-namespace tag Example: if the OWLObject is the GO class GO:0008150, this would return "biological_process"

Parameters:
c -
Returns:

getCreatedBy

public String getCreatedBy(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the created_by tag

Parameters:
c -
Returns:

getIsAntiSymmetric

public boolean getIsAntiSymmetric(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the is_anti_symmetric tag or IAO_0000427 annotation

Parameters:
c -
Returns:

getIsCyclic

public boolean getIsCyclic(org.semanticweb.owlapi.model.OWLObject c)
It returns the value of the is_cyclic tag

Parameters:
c -
Returns:

getIsTransitive

public boolean getIsTransitive(org.semanticweb.owlapi.model.OWLObjectProperty c)
true if c is transitive in the source ontology

Parameters:
c -
Returns:

getIsFunctional

public boolean getIsFunctional(org.semanticweb.owlapi.model.OWLObjectProperty c)
true if c is functional in the source ontology

Parameters:
c -
Returns:

getIsInverseFunctional

public boolean getIsInverseFunctional(org.semanticweb.owlapi.model.OWLObjectProperty c)

getIsReflexive

public boolean getIsReflexive(org.semanticweb.owlapi.model.OWLObjectProperty c)

getIsSymmetric

public boolean getIsSymmetric(org.semanticweb.owlapi.model.OWLObjectProperty c)

getSuperPropertiesOf

public Set<org.semanticweb.owlapi.model.OWLObjectPropertyExpression> getSuperPropertiesOf(org.semanticweb.owlapi.model.OWLObjectPropertyExpression p)
returns parent properties of p in all ontologies

Parameters:
p -
Returns:

getXref

public List<String> getXref(org.semanticweb.owlapi.model.OWLObject c)
get the values of of the obo xref tag

Parameters:
c -
Returns:
It returns null if no xref annotation is found.

getDefXref

public List<String> getDefXref(org.semanticweb.owlapi.model.OWLObject c)
Get the definition xrefs (IAO_0000115)

Parameters:
c -
Returns:

getSubClassesNames

@Deprecated
public String[] getSubClassesNames(org.semanticweb.owlapi.model.OWLClass cls)
Deprecated. 

Return the names of the asserted subClasses of the cls (Class) passed in the argument

Parameters:
cls -
Returns:

getSynonymStrings

@Deprecated
public String[] getSynonymStrings(org.semanticweb.owlapi.model.OWLObject c)
Deprecated. 

It returns array of synonyms (is encoded as synonym in obo format and IAO_0000118 annotation property in OWL format) of a class

Parameters:
c -
Returns:

getOBOSynonyms

public List<OWLGraphWrapper.ISynonym> getOBOSynonyms(org.semanticweb.owlapi.model.OWLObject c)
It returns array of synonyms as encoded by OBO2OWL.

Parameters:
c -
Returns:
list of synonyms

getOntologyId

public String getOntologyId()
gets the OBO-style ID of the source ontology IRI. E.g. "go"

Returns:
id of source ontology

getIdentifier

public String getIdentifier(org.semanticweb.owlapi.model.OWLObject owlObject)
gets the OBO-style ID of the specified object. E.g. "GO:0008150"

Parameters:
owlObject -
Returns:
OBO-style identifier, using obo2owl mapping

getIdentifier

public String getIdentifier(org.semanticweb.owlapi.model.IRI iriId)
gets the OBO-style ID of the specified object. E.g. "GO:0008150"

Parameters:
iriId -
Returns:
OBO-style identifier, using obo2owl mapping

getIRIByIdentifier

public org.semanticweb.owlapi.model.IRI getIRIByIdentifier(String id)

getOWLObjectByIdentifier

public org.semanticweb.owlapi.model.OWLObject getOWLObjectByIdentifier(String id)
Given an OBO-style ID, return the corresponding OWLObject, if it is declared - otherwise null

Parameters:
id - - e.g. GO:0008150
Returns:
object with id or null

getOWLObjectPropertyByIdentifier

public org.semanticweb.owlapi.model.OWLObjectProperty getOWLObjectPropertyByIdentifier(String id)
Given an OBO-style ID, return the corresponding OWLObjectProperty, if it is declared - otherwise null

Parameters:
id - - e.g. GO:0008150
Returns:
OWLObjectProperty with id or null

getOWLIndividualByIdentifier

public org.semanticweb.owlapi.model.OWLNamedIndividual getOWLIndividualByIdentifier(String id)
Given an OBO-style ID, return the corresponding OWLNamedIndividual, if it is declared - otherwise null

Parameters:
id - - e.g. GO:0008150
Returns:
OWLNamedIndividual with id or null

getOWLClassByIdentifier

public org.semanticweb.owlapi.model.OWLClass getOWLClassByIdentifier(String id)
Given an OBO-style ID, return the corresponding OWLClass, if it is declared - otherwise null

Parameters:
id - - e.g. GO:0008150
Returns:
OWLClass with id or null

getOWLObjectByLabel

public org.semanticweb.owlapi.model.OWLObject getOWLObjectByLabel(String label)
fetches an OWL Object by rdfs:label if there is >1 match, return the first one encountered

Parameters:
label -
Returns:

getIRIByLabel

public org.semanticweb.owlapi.model.IRI getIRIByLabel(String label)
fetches an OWL IRI by rdfs:label

Parameters:
label -
Returns:

getIRIByLabel

public org.semanticweb.owlapi.model.IRI getIRIByLabel(String label,
                                                      boolean isEnforceUnivocal)
                                               throws SharedLabelException
fetches an OWL IRI by rdfs:label, optionally testing for uniqueness TODO: index labels. This currently scans all labels in the ontology, which is expensive

Parameters:
label -
isEnforceUnivocal -
Returns:
Throws:
SharedLabelException - if >1 IRI shares input label

getOWLClass

public org.semanticweb.owlapi.model.OWLClass getOWLClass(String s)
Returns an OWLClass given an IRI string the class must be declared in either the source ontology, or in a support ontology, otherwise null is returned

Parameters:
s - IRI string
Returns:
OWLClass

getOWLClass

public org.semanticweb.owlapi.model.OWLClass getOWLClass(org.semanticweb.owlapi.model.IRI iri)
Returns an OWLClass given an IRI the class must be declared in either the source ontology, or in a support ontology, otherwise null is returned

Parameters:
iri -
Returns:
OWLClass

getOWLClass

public org.semanticweb.owlapi.model.OWLClass getOWLClass(org.semanticweb.owlapi.model.OWLObject x)
Parameters:
x -
Returns:
OWLClass

getOWLIndividual

public org.semanticweb.owlapi.model.OWLNamedIndividual getOWLIndividual(org.semanticweb.owlapi.model.IRI iri)
Returns an OWLNamedIndividual with this IRI if it has been declared in the source or support ontologies. Returns null otherwise.

Parameters:
iri -
Returns:
OWLNamedIndividual

getOWLIndividual

public org.semanticweb.owlapi.model.OWLNamedIndividual getOWLIndividual(String s)
Parameters:
s -
Returns:
OWLNamedIndividual
See Also:
getOWLIndividual(IRI)

getOWLObjectProperty

public org.semanticweb.owlapi.model.OWLObjectProperty getOWLObjectProperty(String iri)
Returns the OWLObjectProperty with this IRI Must have been declared in one of the ontologies

Parameters:
iri -
Returns:
OWLObjectProperty

getOWLObjectProperty

public org.semanticweb.owlapi.model.OWLObjectProperty getOWLObjectProperty(org.semanticweb.owlapi.model.IRI iri)

getOWLObject

public org.semanticweb.owlapi.model.OWLObject getOWLObject(String s)
Returns the OWLObject with this IRI (where IRI is specified as a string - e.g http://purl.obolibrary.org/obo/GO_0008150)

Parameters:
s - IRI string
Returns:
OWLObject
See Also:
getOWLObject(IRI iri)


Copyright © 2010-2011. All Rights Reserved.