com.hp.hpl.jena.daml
Interface DAMLModel

All Superinterfaces:
Model, ModelCon, RDFReaderF, RDFWriterF
All Known Implementing Classes:
DAMLModelImpl

public interface DAMLModel
extends Model

Interface that encapsulates the capability of storing and retrieving DAML ontology information from the underlying storage or persistence service. The DAML model is an extension of a single Jena RDF model, which is used to store the information from all loaded ontologies.

Version:
CVS info: $Id: DAMLModel.java,v 1.2 2002/01/03 17:59:01 ijd Exp $
Author:
Ian Dickinson, HP Labs (email)

Method Summary
 DAMLClass createDAMLClass(java.lang.String uri)
          Create an (optionally anonymous) DAML class.
 DAMLDatatypeProperty createDAMLDatatypeProperty(java.lang.String uri)
          Create an (optionally anonymous) DAML datatype property.
 DAMLInstance createDAMLInstance(DAMLClass damlClass, java.lang.String uri)
          Create an (optionally anonymous) instance of the given class.
 DAMLList createDAMLList(java.lang.String uri)
          Create an (optionally anonymous) DAML list.
 DAMLObjectProperty createDAMLObjectProperty(java.lang.String uri)
          Create an (optionally anonymous) DAML object property.
 DAMLOntology createDAMLOntology()
          Create an Ontology (big-'O') element, which holds meta-information for the ontology (small-'o').
 DAMLProperty createDAMLProperty(java.lang.String uri)
          Create an (optionally anonymous) DAML property.
 DAMLRestriction createDAMLRestriction(java.lang.String uri)
          Create an (optionally anonymous) DAML Restriction.
 DAMLCommon createDAMLValue(java.lang.String uri, Resource damlClass, DAMLVocabulary vocabulary)
          Create a new DAML value that is a member of the given class.
 DAMLCommon getDAMLValue(java.lang.String uri)
          Answer the DAML value that corresponds to the given URI, if it exists in the model.
 DAMLCommon getDAMLValue(java.lang.String uri, DAMLClass damlClass, DAMLVocabulary vocabulary)
          Answer the DAML value that corresponds to the given URI, if it exists in the model.
 XMLDatatypeRegistry getDatatypeRegistry()
          Answer a reference to the XML datatype registry for this model, that can be used to map between XML data marked up using XML Schema data descriptions, and Java objects.
 DAMLLoader getLoader()
          Answer a reference to the loader for this DAML model
 boolean getLoadSuccessful()
          Answer true if the most recent load operation was successful.
 boolean getUseEquivalence()
          Answer true if the model will consider equivalence classes when accessing properties and resources.
 java.util.Iterator listDAMLClasses()
          Answer an iterator over all DAML classes that are presently in the model.
 java.util.Iterator listDAMLInstances()
          Answer an iterator over all DAML instances that are presently in the model.
 java.util.Iterator listDAMLProperties()
          Answer an iterator over all DAML properties that are presently in the model.
 Model read(java.lang.String uri, java.lang.String base, java.lang.String lang)
          Read the ontology indicated by the given uri.
 void setUseEquivalence(boolean useEquivalence)
          Flag to control whether accessing the DAML store will take into account equivalence classes for properties and resources, using daml:equivalentTo and similar statements.
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Model
abort, add, add, add, begin, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, createLiteral, createLiteral, createProperty, createResource, createResource, createStatement, difference, equals, getProperty, getProperty, getResource, independent, intersection, isReified, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, query, read, read, read, read, remove, size, supportsSetOperations, supportsTransactions, union, write, write, write
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.ModelCon
add, add, add, add, add, add, add, add, add, add, add, contains, contains, contains, contains, contains, contains, contains, contains, createAlt, createAlt, createBag, createBag, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createProperty, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, getAlt, getAlt, getBag, getBag, getProperty, getResource, getSeq, getSeq, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, remove, remove
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFReaderF
getReader, getReader, setReaderClassName
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFWriterF
getWriter, getWriter, setWriterClassName
 

Method Detail

createDAMLOntology

public DAMLOntology createDAMLOntology()
Create an Ontology (big-'O') element, which holds meta-information for the ontology (small-'o'). N.B. This does not create a new ontology, it simply makes an entry in the current model.
Returns:
A new DAMLOntology object, which is created by adding the appropriate statements to the RDF model.

createDAMLInstance

public DAMLInstance createDAMLInstance(DAMLClass damlClass,
                                       java.lang.String uri)
Create an (optionally anonymous) instance of the given class.
Parameters:
damlClass - The class of the newly created DAMLInstance
uri - The URI for the new instance, or null to create an anonymous instance.
Returns:
A new DAMLInstance object, which is created by adding the appropriate statements to the RDF model.

createDAMLClass

public DAMLClass createDAMLClass(java.lang.String uri)
Create an (optionally anonymous) DAML class.
Parameters:
uri - The URI for the new class, or null to create an anonymous class.
Returns:
A new DAMLClass object, which is created by adding the appropriate statements to the RDF model.

createDAMLProperty

public DAMLProperty createDAMLProperty(java.lang.String uri)
Create an (optionally anonymous) DAML property. Note that it is recommended to use one of the more specific property classes from the new DAML release: see createDAMLObjectProperty(java.lang.String) or createDAMLDatatypeProperty(java.lang.String).
Parameters:
uri - The URI for the new property, or null to create an anonymous property.
Returns:
A new DAMLProperty object, which is created by adding the appropriate statements to the RDF model.

createDAMLObjectProperty

public DAMLObjectProperty createDAMLObjectProperty(java.lang.String uri)
Create an (optionally anonymous) DAML object property.
Parameters:
uri - The URI for the new object property, or null to create an anonymous object property.
Returns:
A new DAMLObjectProperty object, which is created by adding the appropriate statements to the RDF model.

createDAMLDatatypeProperty

public DAMLDatatypeProperty createDAMLDatatypeProperty(java.lang.String uri)
Create an (optionally anonymous) DAML datatype property.
Parameters:
uri - The URI for the new datatype property, or null to create an anonymous datatype property.
Returns:
A new DAMLDatatypeProperty object, which is created by adding the appropriate statements to the RDF model.

createDAMLList

public DAMLList createDAMLList(java.lang.String uri)
Create an (optionally anonymous) DAML list.
Parameters:
uri - The URI for the new list, or null to create an anonymous list.
Returns:
A new DAMLList object, which is created by adding the appropriate statements to the RDF model.

createDAMLRestriction

public DAMLRestriction createDAMLRestriction(java.lang.String uri)
Create an (optionally anonymous) DAML Restriction.
Parameters:
uri - The URI for the new restriction, or null to create an anonymous restriction.
Returns:
A new DAMLRestriction object, which is created by adding the appropriate statements to the RDF model.

createDAMLValue

public DAMLCommon createDAMLValue(java.lang.String uri,
                                  Resource damlClass,
                                  DAMLVocabulary vocabulary)
Create a new DAML value that is a member of the given class. The appropriate DAMLCommon sub-class will be instantiated, so, for example, if the DAMLClass is DAML_OIL.Restriction, a DAMLRestriction object will be returned. Note that if a URI is given, and a value with that URI already exists in the model, that instance will be returned instead of creating a new DAML value. This is necessary to maintain consistency of the model.
Parameters:
uri - The URI of the new DAML value, or null for an anonymous value
damlClass - The class to which the new DAML value will belong
vocabulary - The vocabulary to use for the newly created classs, or null to use the default vocabulary
Returns:
an instance of a DAMLCommon value that corresponds to the given class.

getDAMLValue

public DAMLCommon getDAMLValue(java.lang.String uri)
Answer the DAML value that corresponds to the given URI, if it exists in the model. If the URI does not match any of the resources presently in the model, null is returned.
Parameters:
uri - The URI of the DAML resource to look for.
Returns:
An existing DAML resource from the model, matching uri, or null if no such resource is found.

getDAMLValue

public DAMLCommon getDAMLValue(java.lang.String uri,
                               DAMLClass damlClass,
                               DAMLVocabulary vocabulary)
Answer the DAML value that corresponds to the given URI, if it exists in the model. If the URI does not match any of the resources presently in the model, create a new DAML resource with the given URI and vocabulary, from the given DAML class.
Parameters:
uri - The URI of the DAML resource to look for.
damlClass - The class of the new resource to create if no existing resource is found.
vocabulary - The vocabulary to use for the new value (if needed), or null to use the default vocabulary.
Returns:
An existing DAML resource from the model, matching uri, or a new resource if no existing resource is found.

listDAMLClasses

public java.util.Iterator listDAMLClasses()
Answer an iterator over all DAML classes that are presently in the model.
Returns:
an iterator over all currently defined classes (including Restrictions).

listDAMLProperties

public java.util.Iterator listDAMLProperties()
Answer an iterator over all DAML properties that are presently in the model.
Returns:
an iterator over all currently defined properties (i.e. rdf:Property and all sub-classes).

listDAMLInstances

public java.util.Iterator listDAMLInstances()
Answer an iterator over all DAML instances that are presently in the model.
Returns:
an iterator over all currently defined DAML instances.

getLoader

public DAMLLoader getLoader()
Answer a reference to the loader for this DAML model
Returns:
a DAMLLoader reference

getLoadSuccessful

public boolean getLoadSuccessful()
Answer true if the most recent load operation was successful. If not, consult DAMLLoader.getStatus() for details, and check error log.
Returns:
true if the most recent model load was successful

getDatatypeRegistry

public XMLDatatypeRegistry getDatatypeRegistry()
Answer a reference to the XML datatype registry for this model, that can be used to map between XML data marked up using XML Schema data descriptions, and Java objects. This registry is also used to detect resources in the model that correspond to DAMLDataInstance objects, and type declarations that correspond to DAMLDatatype objects.
Returns:
an XML data translator registry

read

public Model read(java.lang.String uri,
                  java.lang.String base,
                  java.lang.String lang)
Read the ontology indicated by the given uri. Note that, depending on the settings in the embedded DAMLLoader, ontology import statements embedded in this document will be processed and the ontologies fetched and loaded.
Parameters:
uri - The URI identifying an ontology to be added.
base - The base URI for any relative names that are loaded from the source document
lang - Denotes the language the statements are represented in.
Returns:
self.
See Also:
Model.read( java.lang.String, java.lang.String )

setUseEquivalence

public void setUseEquivalence(boolean useEquivalence)
Flag to control whether accessing the DAML store will take into account equivalence classes for properties and resources, using daml:equivalentTo and similar statements. Turning this flag on is correct according to the DAML semantics, but will impose a significant performance problem in the current version. Turning the flag off will improve performance, at the cost of not conforming strictly to the DAML specification.
Parameters:
useEquivalence - If true, accessing properties and resources will check for equivalent values, at a cost of reduced performance.

getUseEquivalence

public boolean getUseEquivalence()
Answer true if the model will consider equivalence classes when accessing properties and resources. See setUseEquivalence(boolean) for details.
Returns:
true if equivalence classes are being considered.


Copyright 2001 Hewlett-Packard. All Rights Reserved.