public class Mooncat extends Object
OWLGraphWrapper
object being created, in which
the the source ontology is the primary ontology of interest, and the
support ontologies are the set of ontologies from which references are
drawn. For example, src=CL, sup={PRO,GO,CHEBI,UBERON}
The owltools.graph
algorithm is used to find the reference closure -
i.e. all classes in the support ontologies referenced in the main ontology,
together with their ancestors over subclass, equivalence and someValuesFrom.
As a first step, previously merged classes are removed. These are marked
out by an annotation assertion using IAO_0000412. Any classes merged in
get this assigned automatically.
In the future, owl imports will be supported.Constructor and Description |
---|
Mooncat(OWLGraphWrapper g) |
Mooncat(org.semanticweb.owlapi.model.OWLOntologyManager manager,
org.semanticweb.owlapi.model.OWLDataFactory dataFactory,
org.semanticweb.owlapi.model.OWLOntology ontology) |
Modifier and Type | Method and Description |
---|---|
void |
addImport(String importedIRIString)
Deprecated.
|
void |
addReferencedOntology(org.semanticweb.owlapi.model.OWLOntology refOnt) |
void |
addSourceOntologyPrefix(String prefix)
Add a source ontology prefix to the internal set.
|
boolean |
belongsToSource(org.semanticweb.owlapi.model.OWLEntity obj) |
Map<org.semanticweb.owlapi.model.OWLObject,Set<org.semanticweb.owlapi.model.OWLObject>> |
createSubsetMap(Set<org.semanticweb.owlapi.model.OWLObject> subset)
Note: this assumes you have already filtered any relations not to be
propagated over from the graph
|
Map<org.semanticweb.owlapi.model.OWLObject,Set<org.semanticweb.owlapi.model.OWLObject>> |
createSubsetMap(String ss) |
void |
extractModules() |
void |
extractModules(org.semanticweb.owlapi.model.OWLOntology ont) |
void |
extractModules(Set<org.semanticweb.owlapi.model.OWLClass> classesInSignature,
Set<org.semanticweb.owlapi.model.OWLClass> iclasses) |
static List<org.semanticweb.owlapi.model.RemoveAxiom> |
findRelatedAxioms(Set<org.semanticweb.owlapi.model.OWLObject> entities,
OWLGraphWrapper graph) |
static Set<org.semanticweb.owlapi.model.OWLObject> |
findTaggedEntities(org.semanticweb.owlapi.model.OWLAnnotationProperty p,
Set<org.semanticweb.owlapi.model.OWLAnnotationValue> values,
OWLGraphWrapper graph) |
Set<org.semanticweb.owlapi.model.OWLOntology> |
getAllOntologies() |
Set<org.semanticweb.owlapi.model.OWLAxiom> |
getAxiomsForSubset(Set<org.semanticweb.owlapi.model.OWLObject> objs)
Given a set of objects (e.g.
|
Set<org.semanticweb.owlapi.model.OWLAxiom> |
getClosureAxiomsOfExternalReferencedEntities()
find all axioms in closure of external referenced entities.
|
Set<org.semanticweb.owlapi.model.OWLObject> |
getClosureOfExternalReferencedEntities()
finds the full closure of all external referenced entities.
|
Set<org.semanticweb.owlapi.model.OWLAxiom> |
getDanglingAxioms(org.semanticweb.owlapi.model.OWLOntology ont) |
Set<org.semanticweb.owlapi.model.OWLClass> |
getDanglingClasses() |
Set<org.semanticweb.owlapi.model.OWLClass> |
getDanglingClasses(org.semanticweb.owlapi.model.OWLOntology ont)
finds all classes for which
isDangling(OWLOntology, OWLEntity) is true |
Set<org.semanticweb.owlapi.model.OWLEntity> |
getExternalReferencedEntities()
returns set of entities that belong to a referenced ontology that are referenced in the source ontology.
|
OWLGraphWrapper |
getGraph() |
org.semanticweb.owlapi.model.OWLOntologyManager |
getManager() |
org.semanticweb.owlapi.model.OWLOntology |
getOntology() |
Set<org.semanticweb.owlapi.model.OWLOntology> |
getReferencedOntologies()
delegates to OWLGraphWrapper support ontologies
|
Set<String> |
getSourceOntologyPrefixes()
E.g.
|
boolean |
isDangling(org.semanticweb.owlapi.model.OWLOntology ont,
org.semanticweb.owlapi.model.OWLEntity obj)
Here a dangling entity is one that has no annotation assertions;
this is not a perfect test, as conceivable a class could lack
assertions; however, this would not be the case for any ontology
following obo library principles.
|
static boolean |
isImportMarkedEntity(org.semanticweb.owlapi.model.OWLNamedObject named,
org.semanticweb.owlapi.model.OWLOntology ontology)
Check, if the named object has the annotation property IAO:0000412,
declaring the object as imported.
|
org.semanticweb.owlapi.model.OWLOntology |
makeClosureSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset,
org.semanticweb.owlapi.model.IRI subOntIRI) |
org.semanticweb.owlapi.model.OWLOntology |
makeMinimalSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset,
org.semanticweb.owlapi.model.IRI subOntIRI) |
org.semanticweb.owlapi.model.OWLOntology |
makeMinimalSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset,
org.semanticweb.owlapi.model.IRI subOntIRI,
boolean isFillGaps) |
org.semanticweb.owlapi.model.OWLOntology |
makeMinimalSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset,
org.semanticweb.owlapi.model.IRI subOntIRI,
boolean isFillGaps,
Boolean isSpanGaps)
Given a set of classes (e.g.
|
void |
mergeIntoReferenceOntology(org.semanticweb.owlapi.model.OWLOntology ont) |
void |
mergeOntologies()
merge minimal subset of referenced ontologies into the source ontology.
|
void |
removeClassesNotInIDSpace(String idspace,
boolean removeDangling) |
void |
removeDanglingAxioms() |
void |
removeDanglingAxioms(org.semanticweb.owlapi.model.OWLOntology ont)
Removes any axiom from ont if that axiom contains a dangling
reference - i.e.
|
void |
removeExternalEntities() |
void |
removeExternalEntities(boolean isMain,
org.semanticweb.owlapi.model.OWLOntology ont)
removes external entities:
- anything marked with IAO_0000412 is removed
- if isMain is true then anything that is also present in an external ontology is removed
|
void |
removeExternalEntities(org.semanticweb.owlapi.model.OWLOntology ont)
Removes all classes, individuals and object properties that are marked with
IAO_0000412
|
void |
removeExternalOntologyClasses(boolean removeDangling)
Removes all classes that have IAO_0000412 'imported from' set to another ontology.
|
void |
removeRedundant(Set<org.semanticweb.owlapi.model.OWLObject> ancs) |
void |
removeSubsetClasses(Set<org.semanticweb.owlapi.model.OWLClass> rmSet,
boolean removeDangling)
Remove a set of classes from the ontology
|
void |
removeSubsetComplementClasses(Set<org.semanticweb.owlapi.model.OWLClass> subset,
boolean removeDangling)
Remove all classes *not* in subset.
|
static void |
retainAxiomsInPropertySubset(org.semanticweb.owlapi.model.OWLOntology ont,
Set<org.semanticweb.owlapi.model.OWLObjectProperty> filterProps) |
static void |
retainAxiomsInPropertySubset(org.semanticweb.owlapi.model.OWLOntology ont,
Set<org.semanticweb.owlapi.model.OWLObjectProperty> filterProps,
org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
given an ontology *ont* and a set of object properties *filterProps*, remove all axioms from ontology that
have an object property P in their signature where P is not in *filterProps*
|
void |
retainAxiomsInPropertySubset(Set<org.semanticweb.owlapi.model.OWLObjectProperty> props) |
void |
setGraph(OWLGraphWrapper graph) |
void |
setManager(org.semanticweb.owlapi.model.OWLOntologyManager manager) |
void |
setOntology(org.semanticweb.owlapi.model.OWLOntology ontology) |
void |
setReferencedOntologies(Set<org.semanticweb.owlapi.model.OWLOntology> referencedOntologies)
Deprecated.
|
void |
setSourceOntologyPrefixes(Set<String> sourceOntologyPrefixes)
Set the source ontology prefixes.
|
void |
transferAxiomsUsingIdSpace(String idspace,
org.semanticweb.owlapi.model.OWLOntology subOnt)
Assumes OBO-style IDspaces; specifically URI contains "..../IDSPACE_..."
|
void |
translateDisjointsToEquivalents()
For every pair X DisjointWith Y, generate an axiom
A and Y = Nothing
(may become deprecated after Elk supports disjoints)
|
static void |
translateDisjointsToEquivalents(org.semanticweb.owlapi.model.OWLOntology ont,
org.semanticweb.owlapi.model.OWLOntologyManager manager,
org.semanticweb.owlapi.model.OWLDataFactory dataFactory)
For every pair X DisjointWith Y, generate an axiom
A and Y = Nothing
(may become deprecated after Elk supports disjoints)
|
public Mooncat(org.semanticweb.owlapi.model.OWLOntologyManager manager, org.semanticweb.owlapi.model.OWLDataFactory dataFactory, org.semanticweb.owlapi.model.OWLOntology ontology)
public Mooncat(OWLGraphWrapper g)
public Set<String> getSourceOntologyPrefixes()
public void setSourceOntologyPrefixes(Set<String> sourceOntologyPrefixes)
sourceOntologyPrefixes
- public void addSourceOntologyPrefix(String prefix)
prefix
- public Set<org.semanticweb.owlapi.model.OWLOntology> getReferencedOntologies()
public Set<org.semanticweb.owlapi.model.OWLOntology> getAllOntologies()
@Deprecated public void setReferencedOntologies(Set<org.semanticweb.owlapi.model.OWLOntology> referencedOntologies)
public void addReferencedOntology(org.semanticweb.owlapi.model.OWLOntology refOnt) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
refOnt
- org.semanticweb.owlapi.model.OWLOntologyCreationException
public void mergeIntoReferenceOntology(org.semanticweb.owlapi.model.OWLOntology ont) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
org.semanticweb.owlapi.model.OWLOntologyCreationException
public org.semanticweb.owlapi.model.OWLOntologyManager getManager()
public void setManager(org.semanticweb.owlapi.model.OWLOntologyManager manager)
public OWLGraphWrapper getGraph()
public void setGraph(OWLGraphWrapper graph)
public org.semanticweb.owlapi.model.OWLOntology getOntology()
public void setOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
@Deprecated public void addImport(String importedIRIString)
public void mergeOntologies()
public Set<org.semanticweb.owlapi.model.OWLEntity> getExternalReferencedEntities()
getClosureOfExternalReferencedEntities()
for closure of referencespublic Set<org.semanticweb.owlapi.model.OWLObject> getClosureOfExternalReferencedEntities()
getExternalReferencedEntities()
and then finds all reflexive ancestors of this set.
to configure the traversal, see OWLGraphWrapper
public Set<org.semanticweb.owlapi.model.OWLAxiom> getClosureAxiomsOfExternalReferencedEntities()
getClosureOfExternalReferencedEntities()
The second and third steps by getAxiomsForSubset(Set)
Example: if the source is cl, and cl references go classes, and go is in the set of referenced
ontologies, then this will return a collection of axioms constituting a sub-ontology of go
such that the graph closure of cl is complete.public Set<org.semanticweb.owlapi.model.OWLAxiom> getAxiomsForSubset(Set<org.semanticweb.owlapi.model.OWLObject> objs)
objs
- public boolean belongsToSource(org.semanticweb.owlapi.model.OWLEntity obj)
public boolean isDangling(org.semanticweb.owlapi.model.OWLOntology ont, org.semanticweb.owlapi.model.OWLEntity obj)
ont
- obj
- public Set<org.semanticweb.owlapi.model.OWLClass> getDanglingClasses()
public Set<org.semanticweb.owlapi.model.OWLClass> getDanglingClasses(org.semanticweb.owlapi.model.OWLOntology ont)
isDangling(OWLOntology, OWLEntity)
is trueont
- public void removeDanglingAxioms(org.semanticweb.owlapi.model.OWLOntology ont)
ont
- public void removeDanglingAxioms()
removeDanglingAxioms(OWLOntology)
public Set<org.semanticweb.owlapi.model.OWLAxiom> getDanglingAxioms(org.semanticweb.owlapi.model.OWLOntology ont)
public void removeSubsetComplementClasses(Set<org.semanticweb.owlapi.model.OWLClass> subset, boolean removeDangling)
subset
- removeDangling
- public void removeClassesNotInIDSpace(String idspace, boolean removeDangling)
public void removeSubsetClasses(Set<org.semanticweb.owlapi.model.OWLClass> rmSet, boolean removeDangling)
rmSet
- removeDangling
- public org.semanticweb.owlapi.model.OWLOntology makeClosureSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset, org.semanticweb.owlapi.model.IRI subOntIRI) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
org.semanticweb.owlapi.model.OWLOntologyCreationException
public org.semanticweb.owlapi.model.OWLOntology makeMinimalSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset, org.semanticweb.owlapi.model.IRI subOntIRI) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
subset
- subOntIRI
- org.semanticweb.owlapi.model.OWLOntologyCreationException
public org.semanticweb.owlapi.model.OWLOntology makeMinimalSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset, org.semanticweb.owlapi.model.IRI subOntIRI, boolean isFillGaps) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
org.semanticweb.owlapi.model.OWLOntologyCreationException
public org.semanticweb.owlapi.model.OWLOntology makeMinimalSubsetOntology(Set<org.semanticweb.owlapi.model.OWLClass> subset, org.semanticweb.owlapi.model.IRI subOntIRI, boolean isFillGaps, Boolean isSpanGaps) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
subset
- subOntIRI
- isFillGaps
- - if true, subset will be extended to include intermediates termsisSpanGaps
- - if true, subset classes will be unaltered, but inferred relationships will span gapsorg.semanticweb.owlapi.model.OWLOntologyCreationException
public static boolean isImportMarkedEntity(org.semanticweb.owlapi.model.OWLNamedObject named, org.semanticweb.owlapi.model.OWLOntology ontology)
named
- ontology
- public void removeExternalOntologyClasses(boolean removeDangling)
removeDangling
- public void removeExternalEntities()
public void removeExternalEntities(org.semanticweb.owlapi.model.OWLOntology ont)
ont
- public void removeExternalEntities(boolean isMain, org.semanticweb.owlapi.model.OWLOntology ont)
isMain
- ont
- public static Set<org.semanticweb.owlapi.model.OWLObject> findTaggedEntities(org.semanticweb.owlapi.model.OWLAnnotationProperty p, Set<org.semanticweb.owlapi.model.OWLAnnotationValue> values, OWLGraphWrapper graph)
public static List<org.semanticweb.owlapi.model.RemoveAxiom> findRelatedAxioms(Set<org.semanticweb.owlapi.model.OWLObject> entities, OWLGraphWrapper graph)
public void translateDisjointsToEquivalents()
public static void translateDisjointsToEquivalents(org.semanticweb.owlapi.model.OWLOntology ont, org.semanticweb.owlapi.model.OWLOntologyManager manager, org.semanticweb.owlapi.model.OWLDataFactory dataFactory)
ont
- manager
- dataFactory
- public void retainAxiomsInPropertySubset(Set<org.semanticweb.owlapi.model.OWLObjectProperty> props)
props
- public static void retainAxiomsInPropertySubset(org.semanticweb.owlapi.model.OWLOntology ont, Set<org.semanticweb.owlapi.model.OWLObjectProperty> filterProps)
ont
- filterProps
- public static void retainAxiomsInPropertySubset(org.semanticweb.owlapi.model.OWLOntology ont, Set<org.semanticweb.owlapi.model.OWLObjectProperty> filterProps, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
ont
- filterProps
- reasoner
- public Map<org.semanticweb.owlapi.model.OWLObject,Set<org.semanticweb.owlapi.model.OWLObject>> createSubsetMap(String ss)
public Map<org.semanticweb.owlapi.model.OWLObject,Set<org.semanticweb.owlapi.model.OWLObject>> createSubsetMap(Set<org.semanticweb.owlapi.model.OWLObject> subset)
subset
- public void removeRedundant(Set<org.semanticweb.owlapi.model.OWLObject> ancs)
public void extractModules()
public void extractModules(org.semanticweb.owlapi.model.OWLOntology ont)
public void extractModules(Set<org.semanticweb.owlapi.model.OWLClass> classesInSignature, Set<org.semanticweb.owlapi.model.OWLClass> iclasses)
public void transferAxiomsUsingIdSpace(String idspace, org.semanticweb.owlapi.model.OWLOntology subOnt)
idspace
- subOnt
- Copyright © 2010–2016. All rights reserved.