com.bbn.swede.core
Class OWLDocumentInfo

java.lang.Object
  extended bycom.bbn.swede.core.OWLElementInfo
      extended bycom.bbn.swede.core.OWLDocumentInfo

public class OWLDocumentInfo
extends OWLElementInfo

A specialization of OWL element info for OWL documents. Document info adds delayed loading of a document's OAST and Jena model.

Author:
jlerner, tself

Field Summary
 
Fields inherited from class com.bbn.swede.core.OWLElementInfo
_aelemChildren, _elem
 
Constructor Summary
OWLDocumentInfo(IOWLDocument doc)
          Creates a new info object for an OWL document.
 
Method Summary
 void buildChildren()
          Populates the internal list of OWL classes and properties that are contained in this OWL document.
 IOWLElement[] getChildren()
          Returns the children of this OWL element.
 IOWLDocument getDocument()
          Returns the OWL document associated with this info object.
 Model getModel()
          Returns the Jena model representing the OWL document.
 Resource[] getNamedIndividuals()
          Produces a list of all named individuals in the document.
 IOWLAbstractSyntaxTree getOAST()
          Returns the OAST representing the OWL document.
 boolean modelExists()
          Indicates whether or not the Jena model for this document has been built.
 
Methods inherited from class com.bbn.swede.core.OWLElementInfo
addChild, getElement, includesChild, removeChild, setChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLDocumentInfo

public OWLDocumentInfo(IOWLDocument doc)
Creates a new info object for an OWL document.

Parameters:
doc - The document
Method Detail

getDocument

public IOWLDocument getDocument()

Returns the OWL document associated with this info object.

This is a convenience method, fully equivalent to:

(IOWLDocument)getElement()

Returns:
The OWL document this info object is assocaited with.

modelExists

public boolean modelExists()
Indicates whether or not the Jena model for this document has been built.

Returns:
true if the Jena model already exists, false if not.

getModel

public Model getModel()
Returns the Jena model representing the OWL document. If the model does not already exist, it will be built. Furthermore, if the OAST does not already exist, it will be built. Once the Jena model has been built once, the OAST keeps it in synch with the document structure, so the model returned by this method is always current.

Returns:
The Jena model for this document.

getNamedIndividuals

public Resource[] getNamedIndividuals()
Produces a list of all named individuals in the document. This method will cause the Jena model for the document to be built, if it does not already exist.

Returns:
An unordered array of Jena resources representing all the non-anonymous individuals in the document.

buildChildren

public void buildChildren()
Populates the internal list of OWL classes and properties that are contained in this OWL document. This method relies on the Jena model, which relies on the OAST; if one or both of these does not yet exist when it is called, they will be created now.


getOAST

public IOWLAbstractSyntaxTree getOAST()
Returns the OAST representing the OWL document. If it does not already exist, this method causes the OAST to be built.

Returns:
The document's OAST.

getChildren

public IOWLElement[] getChildren()
Description copied from class: OWLElementInfo
Returns the children of this OWL element.

Overrides:
getChildren in class OWLElementInfo
Returns:
An array (possibly empty) of child elements.


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