com.bbn.swede.editor.visualeditors.restriction
Class RestrictionEditorInspector

java.lang.Object
  extended bycom.bbn.swede.editor.visualeditors.restriction.RestrictionEditorInspector

public class RestrictionEditorInspector
extends Object

This class supports various queries upon a Jena model which are required for the proper functioning of the Restriction Editor.

Author:
aperezlo

Constructor Summary
RestrictionEditorInspector()
           
 
Method Summary
 List getAllClasses()
          Returns a List of the URIs (as java.net.URI) of all of the Classes in all of the namespaces of this document.
 List getAllInstances()
          Gathers all the available instances in the set of known namespaces (i.e.
 List getAllProperties()
          Returns URIs (in String form) of all the available properties in known namespaces (i.e.
 List getClasses(IOWLAbstractSyntaxTree oast)
          Gets all classes with local restrictions (that is, restrictions that are defined within this OAST's document).
 QueryJob getClassesAsQueryJob(IOWLAbstractSyntaxTree oast)
          Returns a QueryJob set to execute the given request w/ the given parameters.
 List getDescriptions(String aboutURI, IOWLAbstractSyntaxTree oast)
          Retrieves all the rdf:Description tags relating to a URI.
 List getKlasses(IOWLAbstractSyntaxTree oast)
          Returns all of the named Classes defined within this OAST's document.
protected  List getLocalRestrictions(IOWLAbstractSyntaxTree oast)
          Retrieves the local restrictions from an OWL abstract syntax tree.
 OntModel getModel()
          Returns the Jena model used by this inspector.
(package private)  Object getObjectFromRestriction(Restriction rest, int column)
          Returns an object representing a portion of a restriction.
 String getOrigin(com.hp.hpl.jena.ontology.Restriction restriction)
          Retrieves the URI of the class on which a restriction is defined.
 List getRestrictions(String sUri, IOWLAbstractSyntaxTree oast)
          Retrieves the restrictions on a class from an OWL abstract syntax tree.
 QueryJob getRestrictionsAsQueryJob(String sUri, IOWLAbstractSyntaxTree oast)
          Returns a QueryJob to retrieve the restrictions on a class from an OAST.
 void oastChanged(OASTEvent event)
          Reacts to an change in the document's OAST.
 String oastGetRDF(IOWLAbstractSyntaxTree iOast, TagNode node, String sRdf)
          Convenience method to request the value of an attribute in the RDF namespace.
 void setModel(OntModel model)
          This method sets the Jena model to be used by this inspector, and notifies any waiting threads that a value has been set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestrictionEditorInspector

public RestrictionEditorInspector()
Method Detail

getLocalRestrictions

protected List getLocalRestrictions(IOWLAbstractSyntaxTree oast)
Retrieves the local restrictions from an OWL abstract syntax tree.

Parameters:
oast - the OAST of the current document
Returns:
a List of all the Restriction nodes in the document

getOrigin

public String getOrigin(com.hp.hpl.jena.ontology.Restriction restriction)
Retrieves the URI of the class on which a restriction is defined.

Parameters:
restriction - a Jena restriction
Returns:
a String representation of the URI of the class upon which this restriction is defined

getObjectFromRestriction

Object getObjectFromRestriction(Restriction rest,
                                int column)
Returns an object representing a portion of a restriction.

Parameters:
rest - the Restriction
column - the column (see RestrictionEditor
Returns:
an object representing the information identified by the requested column
See Also:
RestrictionWrapper

oastGetRDF

public String oastGetRDF(IOWLAbstractSyntaxTree iOast,
                         TagNode node,
                         String sRdf)
Convenience method to request the value of an attribute in the RDF namespace.

Typical usage: oastGetRDF(oast, node, "ID");
Returns value of rdf:ID on node node in oast iOast

Parameters:
iOast - the oast
node - the node
sRdf - the desired attribute in the RDF namespace
Returns:
the attribute value

getDescriptions

public List getDescriptions(String aboutURI,
                            IOWLAbstractSyntaxTree oast)
Retrieves all the rdf:Description tags relating to a URI.

Parameters:
aboutURI - the URI of a class or resource
oast - the OAST in which to search
Returns:
a List of rdf:Description nodes with the value of the 'about' attribute matching aboutURI

getAllInstances

public List getAllInstances()
Gathers all the available instances in the set of known namespaces (i.e. all of the instances defined in documents which can be accessed of the group including those documents that are given namespaces, and those that are specified in owl:import statements).

Returns:
a List of java.net.URIs representing individuals

getAllProperties

public List getAllProperties()
Returns URIs (in String form) of all the available properties in known namespaces (i.e. all of the instances defined in documents which can be accessed of the group including those documents that are given namespaces, and those that are specified in owl:import statements).

Returns:
a List of Strings representing all relevant property URIs

setModel

public void setModel(OntModel model)
This method sets the Jena model to be used by this inspector, and notifies any waiting threads that a value has been set.

Parameters:
model - the Jena model this inspector will use

getModel

public OntModel getModel()
Returns the Jena model used by this inspector. This method is synchronized and will not return until it has a non-null value for the model. If the model has not yet been set, this method will cause the invoking thread to wait and yield until it is set.

Returns:
the Jena model used by this inspector

getRestrictionsAsQueryJob

public QueryJob getRestrictionsAsQueryJob(String sUri,
                                          IOWLAbstractSyntaxTree oast)
Returns a QueryJob to retrieve the restrictions on a class from an OAST.

Parameters:
sUri - The URI of the class
oast - The OAST
Returns:
a QueryJob
See Also:
QueryJob, getRestrictions(String, IOWLAbstractSyntaxTree)

getRestrictions

public List getRestrictions(String sUri,
                            IOWLAbstractSyntaxTree oast)
Retrieves the restrictions on a class from an OWL abstract syntax tree.

Parameters:
sUri - the URI of a class
oast - all of the restrictions of which the class identified by URI is a subclass
Returns:
a List of OAST Restriction objects which represent the restrictions associated w/ this URI

getAllClasses

public List getAllClasses()
Returns a List of the URIs (as java.net.URI) of all of the Classes in all of the namespaces of this document. This list will include Classes defined in the language, e.g. owl:Thing, etc....

Returns:
a List of the URIs of all of the classes available to this document

getKlasses

public List getKlasses(IOWLAbstractSyntaxTree oast)
Returns all of the named Classes defined within this OAST's document.

Parameters:
oast - the OAST
Returns:
a List of the URIs (as java.net.URI) of all the named Klass objects in this document

getClassesAsQueryJob

public QueryJob getClassesAsQueryJob(IOWLAbstractSyntaxTree oast)
Returns a QueryJob set to execute the given request w/ the given parameters.

Parameters:
oast - The OAST to query
Returns:
a QueryJob
See Also:
QueryJob, getClasses(IOWLAbstractSyntaxTree)

getClasses

public List getClasses(IOWLAbstractSyntaxTree oast)
Gets all classes with local restrictions (that is, restrictions that are defined within this OAST's document).

Parameters:
oast - the OAST
Returns:
a List of strings representing the URIs of the classes

oastChanged

public void oastChanged(OASTEvent event)
Reacts to an change in the document's OAST.

Parameters:
event - The event describing the change.
See Also:
IOASTChangeListener.oastChanged(OASTEvent)


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.