org.semanticweb.owl.model.helper
Class OntologyHelper

java.lang.Object
  |
  +--org.semanticweb.owl.model.helper.OntologyHelper

public class OntologyHelper
extends Object

Helper functions for things like accessing the classes and properties of an ontology.

Version:
$Id: OntologyHelper.java,v 1.4 2004/03/08 17:27:00 sean_bechhofer Exp $

Constructor Summary
OntologyHelper()
           
 
Method Summary
static Set allDefinitionsAsAxioms(OWLOntology ontology)
          Returns a collection of OWLClassAxioms that represent all the assertions made about classes in the ontology.
static Set allPropertyDefinitionsAsAxioms(OWLOntology ontology)
          Returns a collection of OWLPropertyAxioms that represent all the assertions made about classes in the ontology.
static Set allSuperProperties(OWLProperty prop, Set ontologies)
           
static Set allURIs(OWLOntology ontology)
          Returns all the uris of all the entities in the ontology.
static List getAnnotations(OWLOntology ontology, OWLObject oo, OWLAnnotationProperty oap)
          Return the objects which are the fillers in the annotations applied to the given object using the given annotation property.
static OWLClass getClassNamed(OWLOntology ontology, URI uri)
           
static OWLDataProperty getDataPropertyNamed(OWLOntology ontology, URI uri)
           
static OWLIndividual getIndividualNamed(OWLOntology ontology, URI uri)
           
static OWLObjectProperty getObjectPropertyNamed(OWLOntology ontology, URI uri)
           
static OWLOntology getOntology(URI uri)
          Returns an ontology from the given URI.
static Set getRDFLabels(OWLOntology ontology, OWLObject oo)
          Returns all annotations on the object using the rdfs:label annotation property using any language.
static Set getRDFLabels(OWLOntology ontology, OWLObject oo, String language)
          Returns all annotations on the object using the rdfs:label annotation property using the given language.
static Set importClosure(OWLOntology ontology)
          Returns the (unordered) closure of the imports from the given ontology.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyHelper

public OntologyHelper()
Method Detail

importClosure

public static Set importClosure(OWLOntology ontology)
                         throws OWLException
Returns the (unordered) closure of the imports from the given ontology. Thus if Ontology A imports B and B imports C, then the closure of A is {A, B, C}, while the closure of B is {B, C}. If A imports B and B imports A, the closure is {A,B}

OWLException

getClassNamed

public static OWLClass getClassNamed(OWLOntology ontology,
                                     URI uri)
                              throws OWLException
OWLException

getIndividualNamed

public static OWLIndividual getIndividualNamed(OWLOntology ontology,
                                               URI uri)
                                        throws OWLException
OWLException

getObjectPropertyNamed

public static OWLObjectProperty getObjectPropertyNamed(OWLOntology ontology,
                                                       URI uri)
                                                throws OWLException
OWLException

getDataPropertyNamed

public static OWLDataProperty getDataPropertyNamed(OWLOntology ontology,
                                                   URI uri)
                                            throws OWLException
OWLException

allURIs

public static Set allURIs(OWLOntology ontology)
                   throws OWLException
Returns all the uris of all the entities in the ontology.

OWLException

allDefinitionsAsAxioms

public static Set allDefinitionsAsAxioms(OWLOntology ontology)
                                  throws OWLException
Returns a collection of OWLClassAxioms that represent all the assertions made about classes in the ontology. This includes all the axioms that are in the ontology, along with additional axioms representing any of the class definitions that are in the ontology. Provides a "uniform" view of the assertions that can be useful for rendering, or in the case where a simple representation of the asserted information is required.

OWLException

allPropertyDefinitionsAsAxioms

public static Set allPropertyDefinitionsAsAxioms(OWLOntology ontology)
                                          throws OWLException
Returns a collection of OWLPropertyAxioms that represent all the assertions made about classes in the ontology. This includes all the axioms that are in the ontology, along with additional axioms representing any of the class definitions that are in the ontology. Provides a "uniform" view of the assertions that can be useful for rendering, or in the case where a simple representation of the asserted information is required.

OWLException

allSuperProperties

public static Set allSuperProperties(OWLProperty prop,
                                     Set ontologies)
                              throws OWLException
OWLException

getAnnotations

public static List getAnnotations(OWLOntology ontology,
                                  OWLObject oo,
                                  OWLAnnotationProperty oap)
                           throws OWLException
Return the objects which are the fillers in the annotations applied to the given object using the given annotation property.

OWLException

getOntology

public static OWLOntology getOntology(URI uri)
                               throws OWLException
Returns an ontology from the given URI. This will attempt to use the default implementation (as provided by the org.semanticweb.owl.util.OWLConnection system property. This method is provided primarily for testing purposes — for example it allows one to write main methods that access ontologies without introducing compile time dependencies on particular implementations.
This perhaps shouldn't be here, but it is useful for the time being.

OWLException

getRDFLabels

public static Set getRDFLabels(OWLOntology ontology,
                               OWLObject oo,
                               String language)
                        throws OWLException
Returns all annotations on the object using the rdfs:label annotation property using the given language.

Parameters:
ontology - an Ontology value
language - a String value. If null, returns all labels.
Returns:
a Set of Strings.
OWLException

getRDFLabels

public static Set getRDFLabels(OWLOntology ontology,
                               OWLObject oo)
                        throws OWLException
Returns all annotations on the object using the rdfs:label annotation property using any language.

Parameters:
ontology - an Ontology value
Returns:
a Set of Strings.
OWLException


WonderWeb