es.ucm.fdi.disia.ontobridge
Class OntoBridge

java.lang.Object
  extended by es.ucm.fdi.disia.ontobridge.OntoBridge

public class OntoBridge
extends java.lang.Object

Main OntoBridge Class
This class provides a simple wrapper for JENA.
It allows connecting to PELLET reasoner or any other that supports the DIG protocol. Instead of using JENA classes this class returns strings containing the URIs of the elements in the ontology. Input parameters of the methods use URIs (or the qualified short representation) for pointing to the ontology elements.
Conversion between URIs and JENA objects is managed automatically

Author:
Juan A. Recio García

Constructor Summary
OntoBridge()
          Creates an OntoBridge object.
 
Method Summary
 java.lang.String getShortName(java.lang.String URI)
          Returns the short form of an URI.
 java.lang.String getURI(java.lang.String shortName)
          Returns the long URI form of a short name
 void initWithDIGReasoner(java.lang.String reasonerHost, int reasonerPort)
          Inits the OntoBridge with a DIG reasoner.
 void initWithOutReasoner()
          Inits the OntoBridge without reasoner.
 void initWithPelletReasoner()
          Inits the OntoBridge with the PELLET Reasoner
 boolean isInstanceOf(java.lang.String instance, java.lang.String ontclass)
          Checks if an instance belongs to a class
 boolean isSubClassOf(java.lang.String subclass, java.lang.String superclass)
          Checks if a class is subclass of other
 java.util.Iterator<java.lang.String> listAllandAnonClasses()
          Lists all the classes of the framework including anonymous classes
 java.util.Iterator<java.lang.String> listAllClasses()
          Lists all the no anonymous classes of the ontology
 java.util.Iterator<java.lang.String> listBelongingClasses(java.lang.String instance)
          Lists the classes that an instance belongs to
 java.util.Iterator<java.lang.String> listComplementClasses()
          Lists the complement classes of the ontology
 java.util.Iterator<java.lang.String> listEnumeratedClasses()
          Lists the enumerated classes of the ontology
 java.util.Iterator<java.lang.String> listInstances(java.lang.String ontClass)
          List the instances of a class
 java.util.Iterator<java.lang.String> listIntersectionClasses()
          Lists the intersection classes of the ontology
 java.util.Iterator<java.lang.String> listProperties(java.lang.String ontClass)
           
 java.util.Iterator<java.lang.String> listPropertyRange(java.lang.String property)
          Lists the classes on the range of a property
 java.util.Iterator<java.lang.String> listPropertyValue(java.lang.String instance, java.lang.String property)
          Lists the instances that are the values of a property of an instance.
 java.util.Iterator<java.lang.String> listRestrictions()
          Lists the restrictions of the ontology
 java.util.Iterator<java.lang.String> listRootClasses()
          Lists the hierarchy root classes of the ontology
 java.util.Iterator<java.lang.String> listSpecificProperties(java.lang.String ontClass)
          Lists the specific properties of class.
 java.util.Iterator<java.lang.String> listSubClasses(java.lang.String ontClass, boolean direct)
          Lists the subclasses of a class.
 java.util.Iterator<java.lang.String> listSuperClasses(java.lang.String ontClass, boolean direct)
          Lists the superclasses (parents) of a class.
 java.util.Iterator<java.lang.String> listUnionClasses()
          Lists the union classes of the ontology
 void loadOntology(es.ucm.fdi.disia.ontobridge.OntologyDocument mainOntology, java.util.Collection<es.ucm.fdi.disia.ontobridge.OntologyDocument> subOntologies, boolean loadSubOntologies)
          Loads an ontology using the initialized reasoner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntoBridge

public OntoBridge()
Creates an OntoBridge object. Currentlly it does nothing.

Method Detail

initWithPelletReasoner

public void initWithPelletReasoner()
Inits the OntoBridge with the PELLET Reasoner


initWithDIGReasoner

public void initWithDIGReasoner(java.lang.String reasonerHost,
                                int reasonerPort)
Inits the OntoBridge with a DIG reasoner. Dig is a protocol (working over http) that allows conecting with any reasoner.

Parameters:
reasonerHost - Host where the reasoner is running.
reasonerPort - Port that the reasoner listens to.

initWithOutReasoner

public void initWithOutReasoner()
Inits the OntoBridge without reasoner. That way, this class doesn't use any inferred knowledge of the ontology


loadOntology

public void loadOntology(es.ucm.fdi.disia.ontobridge.OntologyDocument mainOntology,
                         java.util.Collection<es.ucm.fdi.disia.ontobridge.OntologyDocument> subOntologies,
                         boolean loadSubOntologies)
Loads an ontology using the initialized reasoner

Parameters:
mainOntology - Main ontology document
subOntologies - Collection of ontology documents used by the main ontology
loadSubOntologies - Indicates if the reasoner must load the subOntologies. If loaded, their content is included in the reasoning graph of the main ontology graph.

listAllClasses

public java.util.Iterator<java.lang.String> listAllClasses()
Lists all the no anonymous classes of the ontology


listAllandAnonClasses

public java.util.Iterator<java.lang.String> listAllandAnonClasses()
Lists all the classes of the framework including anonymous classes


listEnumeratedClasses

public java.util.Iterator<java.lang.String> listEnumeratedClasses()
Lists the enumerated classes of the ontology


listUnionClasses

public java.util.Iterator<java.lang.String> listUnionClasses()
Lists the union classes of the ontology


listComplementClasses

public java.util.Iterator<java.lang.String> listComplementClasses()
Lists the complement classes of the ontology


listIntersectionClasses

public java.util.Iterator<java.lang.String> listIntersectionClasses()
Lists the intersection classes of the ontology


listRestrictions

public java.util.Iterator<java.lang.String> listRestrictions()
Lists the restrictions of the ontology


listRootClasses

public java.util.Iterator<java.lang.String> listRootClasses()
Lists the hierarchy root classes of the ontology


listSubClasses

public java.util.Iterator<java.lang.String> listSubClasses(java.lang.String ontClass,
                                                           boolean direct)
Lists the subclasses of a class.

Parameters:
ontClass - class parent of the classes user is asking for
direct - return only direct subclasses

listSuperClasses

public java.util.Iterator<java.lang.String> listSuperClasses(java.lang.String ontClass,
                                                             boolean direct)
Lists the superclasses (parents) of a class.

Parameters:
ontClass - subclass of the classes user is asking for
direct - return only direct subclasses

listInstances

public java.util.Iterator<java.lang.String> listInstances(java.lang.String ontClass)
List the instances of a class

Parameters:
ontClass - class that instances belong to

listBelongingClasses

public java.util.Iterator<java.lang.String> listBelongingClasses(java.lang.String instance)
Lists the classes that an instance belongs to

Parameters:
instance - instance asked for belonging classes

isSubClassOf

public boolean isSubClassOf(java.lang.String subclass,
                            java.lang.String superclass)
Checks if a class is subclass of other

Parameters:
subclass - subclasss
superclass - superclass

isInstanceOf

public boolean isInstanceOf(java.lang.String instance,
                            java.lang.String ontclass)
Checks if an instance belongs to a class

Parameters:
instance - instance
ontclass - class
Returns:

listProperties

public java.util.Iterator<java.lang.String> listProperties(java.lang.String ontClass)

listSpecificProperties

public java.util.Iterator<java.lang.String> listSpecificProperties(java.lang.String ontClass)
Lists the specific properties of class. This method only returns the properties that has the specified class in the domain

Parameters:
ontClass - class in the domain of the listed properties

listPropertyRange

public java.util.Iterator<java.lang.String> listPropertyRange(java.lang.String property)
Lists the classes on the range of a property

Parameters:
property - property user is asking for its range

listPropertyValue

public java.util.Iterator<java.lang.String> listPropertyValue(java.lang.String instance,
                                                              java.lang.String property)
Lists the instances that are the values of a property of an instance.

Parameters:
instance - instance origin of the property
property - property
Returns:

getShortName

public java.lang.String getShortName(java.lang.String URI)
Returns the short form of an URI.


getURI

public java.lang.String getURI(java.lang.String shortName)
Returns the long URI form of a short name