myDataMapping.ontology
Class OntoLoader

java.lang.Object
  extended by myDataMapping.ontology.OntoLoader

public class OntoLoader
extends java.lang.Object

This class is used to load OWL files or URL's into memory. Clients of this class must handle the following classes from the OWLAPI: OWLClass, OWLDataProperty and OWLObjectProperty.


Constructor Summary
OntoLoader(java.lang.String url)
          Construct an ontology loader by obtaining a copy of an OWLOntologyManager, which, as the name suggests, manages a set of ontologies.
 
Method Summary
 boolean areIntersecting(org.semanticweb.owl.model.OWLClass class1, org.semanticweb.owl.model.OWLClass class2)
          Get the OWL classes intersect each other .
 java.util.Set<org.semanticweb.owl.model.OWLClass> getClasses()
          Get the OWL classes in the ontology.
 java.util.Set<org.semanticweb.owl.model.OWLDataProperty> getDataProperties(org.semanticweb.owl.model.OWLClass cls)
          Get the data properties of the class cls.
 java.util.Set<org.semanticweb.owl.model.OWLClass> getEquivalentClasses(org.semanticweb.owl.model.OWLClass cls)
          Get the classes equivalent to the class cls.
 java.util.Set<org.semanticweb.owl.model.OWLObjectProperty> getObjectProperties(org.semanticweb.owl.model.OWLClass cls)
          Get the object properties of the class cls.
 java.util.Set<org.semanticweb.owl.model.OWLClass> getSuperClasses(org.semanticweb.owl.model.OWLClass cls)
          Get the super classes of the class cls.
static void main(java.lang.String[] args)
          Main method.
 void printClasses()
          Print out all of the classes which are referenced in the ontology along with their data and object properties.
 void removeOnto()
          Remove the ontology from the manager.
 void saveOnto(java.lang.String furl)
          Save a copy to another location in OWL/XML format (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntoLoader

public OntoLoader(java.lang.String url)
Construct an ontology loader by obtaining a copy of an OWLOntologyManager, which, as the name suggests, manages a set of ontologies. An ontology is unique within an ontology manager. To load multiple copies of an ontology, multiple managers would have to be used. Then load the ontology at the given URL. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
url - The URL for the ontology.
Method Detail

areIntersecting

public boolean areIntersecting(org.semanticweb.owl.model.OWLClass class1,
                               org.semanticweb.owl.model.OWLClass class2)
Get the OWL classes intersect each other . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:
if the classes intersect if it is not an owl nothing

getClasses

public java.util.Set<org.semanticweb.owl.model.OWLClass> getClasses()
Get the OWL classes in the ontology. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:
The OWL classes in the ontology.

getEquivalentClasses

public java.util.Set<org.semanticweb.owl.model.OWLClass> getEquivalentClasses(org.semanticweb.owl.model.OWLClass cls)
Get the classes equivalent to the class cls. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
cls - Get the classes equivalent to this class.
Returns:
The classes equivalent to the class cls.

getSuperClasses

public java.util.Set<org.semanticweb.owl.model.OWLClass> getSuperClasses(org.semanticweb.owl.model.OWLClass cls)
Get the super classes of the class cls. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
cls - Get the super classes of this class.
Returns:
The super classes of the class cls.

getDataProperties

public java.util.Set<org.semanticweb.owl.model.OWLDataProperty> getDataProperties(org.semanticweb.owl.model.OWLClass cls)
Get the data properties of the class cls. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
cls - Get the data properties of this class.
Returns:
The data properties of the class cls.

getObjectProperties

public java.util.Set<org.semanticweb.owl.model.OWLObjectProperty> getObjectProperties(org.semanticweb.owl.model.OWLClass cls)
Get the object properties of the class cls. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
cls - Get the object properties of this class.
Returns:
The object properties of the class cls.

printClasses

public void printClasses()
Print out all of the classes which are referenced in the ontology along with their data and object properties. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


saveOnto

public void saveOnto(java.lang.String furl)
Save a copy to another location in OWL/XML format (i.e. disregard the format that the ontology was loaded in). To save the file on windows use a URL such as "file:/C:\\windows\\temp\\MyOnt.owl". ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
furl - The file URL into which the ontology is to be saved.

removeOnto

public void removeOnto()
Remove the ontology from the manager. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


main

public static void main(java.lang.String[] args)
Main method. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Parameters:
args - The command-line arguments.