Skip to content

Commit

Permalink
Use builtin OWLAxiom.getSignature function
Browse files Browse the repository at this point in the history
Remove deprecated functions
Fix javadoc
  • Loading branch information
evren committed Aug 13, 2015
1 parent e6d90cc commit 205ec42
Showing 1 changed file with 9 additions and 44 deletions.
53 changes: 9 additions & 44 deletions owlapi/src/main/java/com/clarkparsia/owlapiv3/OntologyUtils.java
Expand Up @@ -66,40 +66,10 @@ public static boolean containsClass(Set<Set<OWLClass>> classes, OWLClass cls) {
}

/**
* Given a set of OWL-API axiom, return its signature.
* Given an axiom, return its signature.
*/
public static Set<OWLEntity> getSignature(OWLAxiom axiom) {
Set<OWLEntity> entities = new HashSet<OWLEntity>();
DeprecatedOWLEntityCollector collector = new DeprecatedOWLEntityCollector(
entities);
collector.setCollectDatatypes( false );
axiom.accept(collector);

return entities;
}

/**
* @deprecated Use {@link #createOntology(Collection)} instead
*/
@Deprecated
public static OWLOntology getOntologyFromAxioms(Collection<OWLAxiom> axioms) {
return OWL.Ontology( axioms );
}

/**
* @deprecated Use {@link #createOntology(Collection, IRI)} instead
*/
@Deprecated
public static OWLOntology getOntologyFromAxioms(Collection<OWLAxiom> axioms, IRI iri) {
return OWL.Ontology( axioms, iri );
}

/**
* @deprecated Use {@link #createOntology(OWLAxiom...)} instead
*/
@Deprecated
public static OWLOntology getOntologyFromAxioms(OWLAxiom... axioms) {
return OWL.Ontology( Arrays.asList( axioms ) );
return axiom.getSignature();
}

public static OWLOntologyManager getOWLOntologyManager() {
Expand Down Expand Up @@ -129,7 +99,7 @@ public static OWLOntology loadOntology( String uri ) {
/**
* Loads the ontology with given URI.
*
* @param uri the ontology uri
* @param inputStream input ontology
* @return the ontology
*/
public static OWLOntology loadOntology( InputStream inputStream ) {
Expand Down Expand Up @@ -167,8 +137,8 @@ public static OWLOntology loadOntology( String uri, boolean withAnnotations ) {
* leaving only logical axioms.
*
* @see #removeAllAnnotations(OWLOntology, OWLOntologyManager)
* @param uri
* the ontology uri
* @param inputStream
* input stream
* @param withAnnotations
* if <code>false</code> removes all annotation axioms from the
* ontology, otherwise leaves the ontology intact
Expand All @@ -186,8 +156,6 @@ public static OWLOntology loadOntology( InputStream inputStream, boolean withAnn

/**
* Prints a set of axioms to console
*
* @param args
*/
public static void printAxioms(Collection<? extends OWLAxiom> axioms) {
for( OWLAxiom axiom : axioms ) {
Expand All @@ -197,8 +165,6 @@ public static void printAxioms(Collection<? extends OWLAxiom> axioms) {

/**
* Prints an ontology to console
*
* @param args
*/
public static void printOntology(OWLOntology ont) {
printAxioms( ont.getAxioms() );
Expand All @@ -218,11 +184,10 @@ public static void save(OWLOntology ont, String path) throws OWLOntologyStorageE

/**
* Update the ontology by adding or removing the given set of axioms
*
* @param OWLObject
* axiom - the axiom to add/remove
* @param boolean
* add - true - add; false - delete
*
* @param ontology target ontology
* @param axioms the axiom to add/remove
* @param add true - add; false - delete
*/
public static void updateOntology(OWLOntology ontology, Collection<? extends OWLAxiom> axioms, boolean add) {
List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
Expand Down

0 comments on commit 205ec42

Please sign in to comment.