public class OntologyHelper extends Object
Constructor and Description |
---|
OntologyHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addAxiomAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAxiom axiom,
org.semanticweb.owlapi.model.IRI propertyIRI,
org.semanticweb.owlapi.model.OWLAnnotationValue value)
Given an ontology, an axiom, a property IRI, and a value string, add an annotation to this
ontology with that property and value.
|
static void |
addAxiomAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAxiom axiom,
Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations)
Given an ontology, an axiom, and a set of annotations, annotate the axiom with the annotations
in the ontology.
|
static void |
addAxiomAnnotations(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.IRI propertyIRI,
org.semanticweb.owlapi.model.OWLAnnotationValue value)
Given an ontology, an annotation property IRI, and an annotation value, annotate all axioms in
the ontology with that property and value.
|
static void |
addOntologyAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.IRI propertyIRI,
org.semanticweb.owlapi.model.OWLAnnotationValue value)
Given an ontology, a property IRI, and a value string, add an annotation to this ontology with
that property and value.
|
static void |
addOntologyAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAnnotation annotation)
Annotate the ontology with the annotation.
|
static void |
collapseOntology(org.semanticweb.owlapi.model.OWLOntology ontology,
int threshold,
Set<org.semanticweb.owlapi.model.IRI> precious,
boolean repeat)
Given an ontology, a threshold, and a set of precious IRIs (or empty set), minimize the input
ontology's class hierarchy based on the threshold.
|
static void |
collapseOntology(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.IRI> precious)
Given an ontology and a set of IRIs that must be retained, remove intermediate superclasses
(classes that only have one child) and update the subclass relationships to preserve structure.
|
static void |
copy(org.semanticweb.owlapi.model.OWLOntology inputOntology,
org.semanticweb.owlapi.model.OWLOntology outputOntology,
org.semanticweb.owlapi.model.OWLEntity entity,
Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> annotationProperties)
Given input and output ontologies, a target entity, and a set of annotation properties, copy
the target entity from the input ontology to the output ontology, along with the specified
annotations.
|
static void |
copyAnnotations(org.semanticweb.owlapi.model.OWLOntology inputOntology,
org.semanticweb.owlapi.model.OWLOntology outputOntology,
org.semanticweb.owlapi.model.OWLEntity entity,
Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> annotationProperties)
Given an input ontology, an output ontology, an entity to copy annotations of, and the
annotation properties to copy (or null for all), copy annotations of the entity from the input
to the output ontology.
|
static boolean |
extendsAxiomTypes(Class<? extends org.semanticweb.owlapi.model.OWLAxiom> axiom,
Set<Class<? extends org.semanticweb.owlapi.model.OWLAxiom>> axiomTypes)
Given an OWLAxiom class and a set of OWLAxiom classes, determine if the axiom class provided
extends at least one of the classes in the set.
|
static boolean |
extendsAxiomTypes(org.semanticweb.owlapi.model.OWLAxiom axiom,
Set<Class<? extends org.semanticweb.owlapi.model.OWLAxiom>> axiomTypes)
Given an OWLAxiom and a set of OWLAxiom class, determine if the axiom's class is an extension
of at least one of the given set.
|
static Set<org.semanticweb.owlapi.model.IRI> |
filterExistingTerms(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.IRI> IRIs,
boolean allowEmpty)
Given an ontology and a set of IRIs, filter the set of IRIs to only include those that exist in
the ontology.
|
static Set<org.semanticweb.owlapi.model.IRI> |
filterExistingTerms(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.IRI> IRIs,
boolean allowEmpty,
org.semanticweb.owlapi.model.parameters.Imports imports)
Given an ontology and a set of IRIs, filter the set of IRIs to only include those that exist in
the ontology.
|
static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> |
getAnnotationAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAnnotationProperty property)
Given an ontology, and an optional set of annotation properties, return a set of annotation
assertion axioms for those properties, for all subjects.
|
static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> |
getAnnotationAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAnnotationProperty property,
org.semanticweb.owlapi.model.IRI subject)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return a set of annotation assertion axioms for those subjects and those properties.
|
static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> |
getAnnotationAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties,
Set<org.semanticweb.owlapi.model.IRI> subjects)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return a set of annotation assertion axioms for those subjects and those properties.
|
static String |
getAnnotationString(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAnnotationProperty property,
org.semanticweb.owlapi.model.IRI subject)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return the alphanumerically first annotation value string for those subjects and those
properties.
|
static String |
getAnnotationString(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties,
Set<org.semanticweb.owlapi.model.IRI> subjects)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return the alphanumerically first annotation value string for those subjects and those
properties.
|
static Set<String> |
getAnnotationStrings(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAnnotationProperty property,
org.semanticweb.owlapi.model.IRI subject)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return a set of strings for those subjects and those properties.
|
static Set<String> |
getAnnotationStrings(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties,
Set<org.semanticweb.owlapi.model.IRI> subjects)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return a set of strings for those subjects and those properties.
|
static Set<org.semanticweb.owlapi.model.OWLAnnotationValue> |
getAnnotationValues(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLAnnotationProperty property,
org.semanticweb.owlapi.model.IRI subject)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return a set of annotation values for those subjects and those properties.
|
static Set<org.semanticweb.owlapi.model.OWLAnnotationValue> |
getAnnotationValues(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties,
Set<org.semanticweb.owlapi.model.IRI> subjects)
Given an ontology, an optional set of annotation properties, and an optional set of subject,
return a set of annotation values for those subjects and those properties.
|
static Set<org.semanticweb.owlapi.model.OWLAxiom> |
getAnonymousAncestorAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLEntity entity)
Given an ontology, an entity, and an empty set, fill the set with axioms representing any
anonymous superclasses in the line of ancestors.
|
static Set<org.semanticweb.owlapi.model.OWLAxiom> |
getAnonymousDescendantAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLEntity entity)
Given an ontology and an entity, return a set of axioms containing any anonymous entities
referenced in the descendants of the entity.
|
static Set<org.semanticweb.owlapi.model.OWLAxiom> |
getAnonymousEquivalentAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLEntity entity)
Given an ontology and an entity, return a set of axioms containing any anonymous entities
referenced in equivalent entities.
|
static Set<org.semanticweb.owlapi.model.OWLAxiom> |
getAnonymousParentAxioms(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.OWLEntity entity)
Given an ontology and an entity, return a set of axioms only corresponding to anonymous
parents.
|
static Set<org.semanticweb.owlapi.model.OWLEntity> |
getEntities(org.semanticweb.owlapi.model.OWLOntology ontology)
Given an ontology, return a set of all the entities in its signature.
|
static Set<org.semanticweb.owlapi.model.OWLEntity> |
getEntities(org.semanticweb.owlapi.model.OWLOntology ontology,
Set<org.semanticweb.owlapi.model.IRI> iris)
Given an ontology and a set of term IRIs, return a set of entities for those IRIs.
|
static org.semanticweb.owlapi.model.OWLEntity |
getEntity(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.IRI iri)
Given an ontology and an IRI, get the OWLEntity object represented by the IRI.
|
static org.semanticweb.owlapi.model.OWLEntity |
getEntity(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.IRI iri,
boolean allowNull)
Given an ontology, an IRI, and a boolean specifying if a null return value is allowed, get the
OWLEntity object represented by the IRI.
|
static Set<org.semanticweb.owlapi.model.IRI> |
getIRIs(org.semanticweb.owlapi.model.OWLOntology ontology)
Given an ontology, return a set of IRIs for all the entities in its signature.
|
static Set<org.semanticweb.owlapi.model.IRI> |
getIRIsInSignature(org.semanticweb.owlapi.model.OWLAxiom axiom)
Given an OWLAxiom, return all the IRIs in the signature.
|
static Function<org.semanticweb.owlapi.model.OWLNamedObject,String> |
getLabelFunction(org.semanticweb.owlapi.model.OWLOntology ontology,
boolean useIriAsDefault)
Generates a function that returns a label string for any named object in the ontology
|
static Map<String,org.semanticweb.owlapi.model.IRI> |
getLabelIRIs(org.semanticweb.owlapi.model.OWLOntology ontology)
Given an ontology, return a map from rdfs:label to IRIs.
|
static Map<org.semanticweb.owlapi.model.IRI,String> |
getLabels(org.semanticweb.owlapi.model.OWLOntology ontology)
Given an ontology, return a map from IRIs to rdfs:labels.
|
static Set<org.semanticweb.owlapi.model.OWLObject> |
getNamedObjects(org.semanticweb.owlapi.model.OWLAxiom axiom)
Get all named OWLObjects associated with an axiom.
|
static Set<org.semanticweb.owlapi.model.OWLObject> |
getNamedObjects(org.semanticweb.owlapi.model.OWLOntology ontology)
Get all named OWLObjects from an input ontology.
|
static Set<org.semanticweb.owlapi.model.OWLObject> |
getObjects(org.semanticweb.owlapi.model.OWLAxiom axiom)
Get all OWLObjects associated with an axiom.
|
static Set<org.semanticweb.owlapi.model.OWLObject> |
getObjects(org.semanticweb.owlapi.model.OWLOntology ontology)
Get all OWLObjects from an input ontology.
|
static org.semanticweb.owlapi.model.OWLDatatype |
getType(org.semanticweb.owlapi.model.OWLAnnotationValue value)
Given an annotation value, return its datatype, or null.
|
static org.semanticweb.owlapi.model.IRI |
getTypeIRI(org.semanticweb.owlapi.model.OWLAnnotationValue value)
Given an annotation value, return the IRI of its datatype, or null.
|
static String |
getValue(org.semanticweb.owlapi.model.OWLAnnotation annotation)
Given an OWLAnnotation, return its value as a string.
|
static String |
getValue(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom axiom)
Given an OWLAnnotationAssertionAxiom, return its value as a string.
|
static String |
getValue(org.semanticweb.owlapi.model.OWLAnnotationValue value)
Given an OWLAnnotationValue, return its value as a string.
|
static String |
getValue(Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations)
Given a set of OWLAnnotations, return the first string value as determined by natural string
sorting.
|
static Set<String> |
getValues(Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations)
Given a set of OWLAnnotations, return a set of their value strings.
|
static void |
removeImports(org.semanticweb.owlapi.model.OWLOntology ontology)
Given an ontology, remove the import declarations.
|
static void |
removeOntologyAnnotations(org.semanticweb.owlapi.model.OWLOntology ontology)
Remove all annotations on this ontology.
|
static String |
renderManchester(org.semanticweb.owlapi.model.OWLObject object,
org.semanticweb.owlapi.util.ShortFormProvider provider)
Render a Manchester string for an OWLObject.
|
static String |
renderManchester(org.semanticweb.owlapi.model.OWLObject object,
org.semanticweb.owlapi.util.ShortFormProvider provider,
RendererType rt)
Render a Manchester string for an OWLObject.
|
static void |
setOntologyIRI(org.semanticweb.owlapi.model.OWLOntology ontology,
org.semanticweb.owlapi.model.IRI ontologyIRI,
org.semanticweb.owlapi.model.IRI versionIRI)
Set the ontology IRI and version IRI.
|
static void |
setOntologyIRI(org.semanticweb.owlapi.model.OWLOntology ontology,
String ontologyIRIString,
String versionIRIString)
Set the ontology IRI and version IRI using strings.
|
static void |
trimOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
Given an ontology, remove any dangling entities.
|
public static void addAxiomAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAxiom axiom, org.semanticweb.owlapi.model.IRI propertyIRI, org.semanticweb.owlapi.model.OWLAnnotationValue value)
Note that as axioms are immutable, the axiom is removed and replaced with a new one.
ontology
- the ontology to modifyaxiom
- the axiom to annotatepropertyIRI
- the IRI of the property to addvalue
- the IRI or literal value to addpublic static void addAxiomAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAxiom axiom, Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations)
Note that as axioms are immutable, the axiom is removed and replaced with a new one.
ontology
- the ontology to modifyaxiom
- the axiom to annotateannotations
- the set of annotation to add to the axiompublic static void addAxiomAnnotations(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.IRI propertyIRI, org.semanticweb.owlapi.model.OWLAnnotationValue value)
ontology
- the ontology to modifypropertyIRI
- the IRI of the property to addvalue
- the IRI or literal value to addpublic static void addOntologyAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.IRI propertyIRI, org.semanticweb.owlapi.model.OWLAnnotationValue value)
ontology
- the ontology to modifypropertyIRI
- the IRI of the property to addvalue
- the IRI or literal value to addpublic static void addOntologyAnnotation(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAnnotation annotation)
ontology
- the ontology to modifyannotation
- the annotation to addpublic static void collapseOntology(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.IRI> precious) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
ontology
- ontology to remove intermediates inprecious
- set of OWLEntities that should not be removedorg.semanticweb.owlapi.model.OWLOntologyCreationException
- on problem creating ontologypublic static void collapseOntology(org.semanticweb.owlapi.model.OWLOntology ontology, int threshold, Set<org.semanticweb.owlapi.model.IRI> precious, boolean repeat) throws org.semanticweb.owlapi.model.OWLOntologyCreationException
ontology
- OWLOntology to minimizethreshold
- minimum number of child classesprecious
- set of IRIs to keeprepeat
- if true, repeat collapsing until no intermediate classes remainorg.semanticweb.owlapi.model.OWLOntologyCreationException
- on problem creating copy to span gapspublic static void copy(org.semanticweb.owlapi.model.OWLOntology inputOntology, org.semanticweb.owlapi.model.OWLOntology outputOntology, org.semanticweb.owlapi.model.OWLEntity entity, Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> annotationProperties)
inputOntology
- the ontology to copy fromoutputOntology
- the ontology to copy toentity
- the target entity that will have its ancestors copiedannotationProperties
- the annotations to copypublic static void copyAnnotations(org.semanticweb.owlapi.model.OWLOntology inputOntology, org.semanticweb.owlapi.model.OWLOntology outputOntology, org.semanticweb.owlapi.model.OWLEntity entity, Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> annotationProperties)
inputOntology
- OWLOntology to copy fromoutputOntology
- OWLOntology to copy toentity
- OWLEntity to copy annotations ofannotationProperties
- Set of annotation properties to copy, or null for allpublic static Set<org.semanticweb.owlapi.model.IRI> filterExistingTerms(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.IRI> IRIs, boolean allowEmpty)
ontology
- the ontology to check for IRIsIRIs
- Set of IRIs to filterallowEmpty
- boolean specifying if an empty set can be returnedpublic static Set<org.semanticweb.owlapi.model.IRI> filterExistingTerms(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.IRI> IRIs, boolean allowEmpty, org.semanticweb.owlapi.model.parameters.Imports imports)
ontology
- the ontology to check for IRIsIRIs
- Set of IRIs to filterallowEmpty
- boolean specifying if an empty set can be returnedimports
- Imports INCLUDED or EXCLUDEDpublic static Set<org.semanticweb.owlapi.model.OWLObject> getNamedObjects(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- OWLOntology to retrieve objects frompublic static Set<org.semanticweb.owlapi.model.OWLObject> getNamedObjects(org.semanticweb.owlapi.model.OWLAxiom axiom)
axiom
- The axiom to checkpublic static Set<org.semanticweb.owlapi.model.IRI> getIRIsInSignature(org.semanticweb.owlapi.model.OWLAxiom axiom)
axiom
- OWLAxiom to get signature ofpublic static Set<org.semanticweb.owlapi.model.OWLObject> getObjects(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- OWLOntology to retrieve objects frompublic static Set<org.semanticweb.owlapi.model.OWLObject> getObjects(org.semanticweb.owlapi.model.OWLAxiom axiom)
axiom
- The axiom to checkpublic static Set<org.semanticweb.owlapi.model.OWLAxiom> getAnonymousAncestorAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLEntity entity)
ontology
- the ontology to searchentity
- the entity to search ancestors ofpublic static Set<org.semanticweb.owlapi.model.OWLAxiom> getAnonymousDescendantAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLEntity entity)
ontology
- the ontology to searchentity
- the entity to search descendants ofpublic static Set<org.semanticweb.owlapi.model.OWLAxiom> getAnonymousEquivalentAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLEntity entity)
ontology
- the ontology to searchentity
- the entity to search equivalents ofpublic static Set<org.semanticweb.owlapi.model.OWLAxiom> getAnonymousParentAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLEntity entity)
ontology
- the ontology to searchentity
- the entity to search parents ofpublic static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> getAnnotationAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAnnotationProperty property)
ontology
- the ontology to search (including imports closure)property
- an annotation propertypublic static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> getAnnotationAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAnnotationProperty property, org.semanticweb.owlapi.model.IRI subject)
ontology
- the ontology to search (including imports closure)property
- an annotation propertysubject
- an annotation subject IRIspublic static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> getAnnotationAxioms(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties, Set<org.semanticweb.owlapi.model.IRI> subjects)
ontology
- the ontology to search (including imports closure)properties
- a set of annotation properties, or null if all properties should be includedsubjects
- a set of annotation subject IRIs, or null if all subjects should be includedpublic static String getAnnotationString(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAnnotationProperty property, org.semanticweb.owlapi.model.IRI subject)
ontology
- the ontology to search (including imports closure)property
- an annotation propertysubject
- an annotation subject IRIspublic static String getAnnotationString(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties, Set<org.semanticweb.owlapi.model.IRI> subjects)
ontology
- the ontology to search (including imports closure)properties
- a set of annotation properties, or null if all properties should be includedsubjects
- a set of annotation subject IRIs, or null if all subjects should be includedpublic static Set<String> getAnnotationStrings(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAnnotationProperty property, org.semanticweb.owlapi.model.IRI subject)
ontology
- the ontology to search (including imports closure)property
- an annotation propertysubject
- an annotation subject IRIspublic static Set<String> getAnnotationStrings(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties, Set<org.semanticweb.owlapi.model.IRI> subjects)
ontology
- the ontology to search (including imports closure)properties
- a set of annotation properties, or null if all properties should be includedsubjects
- a set of annotation subject IRIs, or null if all subjects should be includedpublic static Set<org.semanticweb.owlapi.model.OWLAnnotationValue> getAnnotationValues(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.OWLAnnotationProperty property, org.semanticweb.owlapi.model.IRI subject)
ontology
- the ontology to search (including imports closure)property
- an annotation propertysubject
- an annotation subject IRIspublic static Set<org.semanticweb.owlapi.model.OWLAnnotationValue> getAnnotationValues(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> properties, Set<org.semanticweb.owlapi.model.IRI> subjects)
ontology
- the ontology to search (including imports closure)properties
- a set of annotation properties, or null if all properties should be includedsubjects
- a set of annotation subject IRIs, or null if all subjects should be includedpublic static org.semanticweb.owlapi.model.OWLEntity getEntity(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.IRI iri) throws Exception
ontology
- OWLOntology to retrieve fromiri
- IRI to get type ofException
- if IRI is not in ontologypublic static org.semanticweb.owlapi.model.OWLEntity getEntity(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.IRI iri, boolean allowNull) throws Exception
ontology
- OWLOntology to retrieve fromiri
- IRI to get type ofallowNull
- if true, do not throw exception if IRI does not exist in ontologyException
- if allowNull is false and IRI is not in ontologypublic static Set<org.semanticweb.owlapi.model.OWLEntity> getEntities(org.semanticweb.owlapi.model.OWLOntology ontology, Set<org.semanticweb.owlapi.model.IRI> iris)
ontology
- the ontology to searchiris
- the IRIs of the entities to findpublic static Set<org.semanticweb.owlapi.model.OWLEntity> getEntities(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- the ontology to searchpublic static Set<org.semanticweb.owlapi.model.IRI> getIRIs(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- the ontology to searchpublic static Function<org.semanticweb.owlapi.model.OWLNamedObject,String> getLabelFunction(org.semanticweb.owlapi.model.OWLOntology ontology, boolean useIriAsDefault)
ontology
- to useuseIriAsDefault
- if true then label-less classes will return IRIpublic static Map<String,org.semanticweb.owlapi.model.IRI> getLabelIRIs(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- the ontology to usepublic static Map<org.semanticweb.owlapi.model.IRI,String> getLabels(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- the ontology to usepublic static org.semanticweb.owlapi.model.OWLDatatype getType(org.semanticweb.owlapi.model.OWLAnnotationValue value)
value
- the value to checkpublic static org.semanticweb.owlapi.model.IRI getTypeIRI(org.semanticweb.owlapi.model.OWLAnnotationValue value)
value
- the value to checkpublic static String getValue(org.semanticweb.owlapi.model.OWLAnnotationValue value)
value
- the OWLAnnotationValue to get the string value ofpublic static String getValue(org.semanticweb.owlapi.model.OWLAnnotation annotation)
annotation
- the OWLAnnotation to get the string value ofpublic static String getValue(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom axiom)
axiom
- the OWLAnnotationAssertionAxiom to get the string value ofpublic static String getValue(Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations)
annotations
- a set of OWLAnnotations to get the value ofpublic static Set<String> getValues(Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations)
annotations
- a set of OWLAnnotations to get the value ofpublic static boolean extendsAxiomTypes(org.semanticweb.owlapi.model.OWLAxiom axiom, Set<Class<? extends org.semanticweb.owlapi.model.OWLAxiom>> axiomTypes)
axiom
- the OWLAxiom to checkaxiomTypes
- classes of axioms desiredpublic static boolean extendsAxiomTypes(Class<? extends org.semanticweb.owlapi.model.OWLAxiom> axiom, Set<Class<? extends org.semanticweb.owlapi.model.OWLAxiom>> axiomTypes)
axiom
- the OWLAxiom class to checkaxiomTypes
- classes of axioms desiredpublic static void removeImports(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- OWLOntology to remove imports frompublic static void removeOntologyAnnotations(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- the ontology to modifypublic static String renderManchester(org.semanticweb.owlapi.model.OWLObject object, org.semanticweb.owlapi.util.ShortFormProvider provider)
object
- OWLObject to renderprovider
- ShortFormProvider to resolve entitiespublic static String renderManchester(org.semanticweb.owlapi.model.OWLObject object, org.semanticweb.owlapi.util.ShortFormProvider provider, RendererType rt)
object
- OWLObject to renderprovider
- ShortFormProvider to resolve entitiesrt
- RendererType to use to render Manchesterpublic static void setOntologyIRI(org.semanticweb.owlapi.model.OWLOntology ontology, String ontologyIRIString, String versionIRIString)
ontology
- the ontology to changeontologyIRIString
- the ontology IRI string, or null for no changeversionIRIString
- the version IRI string, or null for no changepublic static void setOntologyIRI(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.model.IRI ontologyIRI, org.semanticweb.owlapi.model.IRI versionIRI)
ontology
- the ontology to changeontologyIRI
- the new ontology IRI, or null for no changeversionIRI
- the new version IRI, or null for no changepublic static void trimOntology(org.semanticweb.owlapi.model.OWLOntology ontology)
ontology
- the ontology to trimCopyright © 2015–2020. All rights reserved.