com.hp.hpl.jena.ontology.daml
Interface DAMLModel

All Superinterfaces:
InfModel, Lock, Model, ModelCon, ModelGraphInterface, ModelLock, OntModel, PrefixMapping, RDFReaderF, RDFWriterF

public interface DAMLModel
extends OntModel

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.12 2005/02/21 12:05:00 andy_seaborne Exp $
Author:
Ian Dickinson, HP Labs (email)

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.hp.hpl.jena.shared.PrefixMapping
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException
 
Field Summary
 
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping
Extended, Standard
 
Fields inherited from interface com.hp.hpl.jena.rdf.model.ModelLock
READ, WRITE
 
Method Summary
 DAMLClass createDAMLClass(java.lang.String uri)
          Create an (optionally anonymous) DAML class.
 DAMLDataInstance createDAMLDataInstance(java.lang.Object value)
          Create an anonymous data instance, which has the given value and an appropriate datatype.
 DAMLDataInstance createDAMLDataInstance(RDFDatatype datatype, java.lang.Object value)
          Create an anonymous data instance, which has the given datatype and value.
 DAMLDataInstance createDAMLDataInstance(Resource datatype, java.lang.Object value)
          Create an anonymous data instance, which has the given datatype and value.
 DAMLDatatype createDAMLDatatype(java.lang.String uri)
          Create a DAML Datatype representing values from some concrete domain.
 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()
          Create an empty DAML list.
 DAMLList createDAMLList(java.util.Iterator elements)
          Create a new DAML list containing the given elements.
 DAMLList createDAMLList(RDFNode[] elements)
          Create a new DAML list containing the given elements.
 DAMLObjectProperty createDAMLObjectProperty(java.lang.String uri)
          Create a DAML object property.
 DAMLOntology createDAMLOntology(java.lang.String uri)
          Create an (optionally anonymous) Ontology (big-'O') element, which holds meta-information for the ontology (small-'o').
 DAMLProperty createDAMLProperty(java.lang.String uri)
          Create a DAML property.
 DAMLRestriction createDAMLRestriction(java.lang.String uri)
          Create an (optionally anonymous) DAML Restriction.
 DAMLCommon createDAMLValue(java.lang.String uri, Resource damlClass)
          Create a new DAML value that is a member of the given class.
 DAMLClass getDAMLClass(java.lang.String uri)
          Answer a resource from the current model with the given uri, viewed as a DAML Class.
 DAMLInstance getDAMLInstance(java.lang.String uri)
          Answer a resource from the current model with the given uri, viewed as a DAML Instance.
 DAMLProperty getDAMLProperty(java.lang.String uri)
          Answer a resource from the current model with the given uri, viewed as a DAML Property.
 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)
          Answer the DAML value that corresponds to the given URI, if it exists in the model.
 TypeMapper 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.
 com.hp.hpl.jena.ontology.daml.impl.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()
          Deprecated. Not useful in Jena2, since equivalence processing is handled by the inference graph.
 ExtendedIterator listDAMLClasses()
          Answer an iterator over all DAML classes that are presently in the model.
 ExtendedIterator listDAMLInstances()
          Answer an iterator over all DAML instances that are presently in the model.
 ExtendedIterator 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)
          Deprecated. Not useful in Jena2, since equivalence processing is handled by the inference graph.
 
Methods inherited from interface com.hp.hpl.jena.ontology.OntModel
addLoadedImport, addSubModel, addSubModel, createAllDifferent, createAllDifferent, createAllValuesFromRestriction, createAnnotationProperty, createCardinalityQRestriction, createCardinalityRestriction, createClass, createClass, createComplementClass, createDataRange, createDatatypeProperty, createDatatypeProperty, createEnumeratedClass, createHasValueRestriction, createIndividual, createIndividual, createIntersectionClass, createInverseFunctionalProperty, createInverseFunctionalProperty, createMaxCardinalityQRestriction, createMaxCardinalityRestriction, createMinCardinalityQRestriction, createMinCardinalityRestriction, createObjectProperty, createObjectProperty, createOntology, createOntProperty, createOntResource, createOntResource, createRestriction, createRestriction, createSomeValuesFromRestriction, createSymmetricProperty, createSymmetricProperty, createTransitiveProperty, createTransitiveProperty, createUnionClass, getAllValuesFromRestriction, getAnnotationProperty, getBaseModel, getCardinalityQRestriction, getCardinalityRestriction, getComplementClass, getDatatypeProperty, getDocumentManager, getDynamicImports, getEnumeratedClass, getEventManager, getHasValueRestriction, getImportedModel, getImportModelMaker, getIndividual, getIntersectionClass, getInverseFunctionalProperty, getMaxCardinalityQRestriction, getMaxCardinalityRestriction, getMinCardinalityQRestriction, getMinCardinalityRestriction, getModelMaker, getObjectProperty, getOntClass, getOntology, getOntProperty, getOntResource, getOntResource, getOWLLanguageLevel, getProfile, getQualifiedRestriction, getRestriction, getSomeValuesFromRestriction, getSpecification, getSubGraphs, getSymmetricProperty, getTransitiveProperty, getUnionClass, hasLoadedImport, isInBaseModel, isInBaseModel, listAllDifferent, listAnnotationProperties, listClasses, listComplementClasses, listDataRanges, listDatatypeProperties, listEnumeratedClasses, listFunctionalProperties, listHierarchyRootClasses, listImportedModels, listImportedOntologyURIs, listImportedOntologyURIs, listIndividuals, listIndividuals, listIntersectionClasses, listInverseFunctionalProperties, listNamedClasses, listObjectProperties, listOntologies, listOntProperties, listRestrictions, listSymmetricProperties, listTransitiveProperties, listUnionClasses, queryFor, removeLoadedImport, removeSubModel, removeSubModel, setDynamicImports, setStrictMode, strictMode, write, write, write, write, write, write, writeAll, writeAll
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.InfModel
getDeductionsModel, getDerivation, getRawModel, getReasoner, listStatements, prepare, rebind, reset, setDerivationLogging, validate
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.Model
abort, add, add, add, add, add, add, begin, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createList, createList, createList, createLiteral, createLiteral, createLiteral, createProperty, createReifiedStatement, createReifiedStatement, createResource, createResource, createResource, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, equals, executeInTransaction, getAnyReifiedStatement, getModelLock, getProperty, getProperty, getReificationStyle, getRequiredProperty, getResource, independent, intersection, isEmpty, isIsomorphicWith, isReified, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listReifiedStatements, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, notifyEvent, query, read, read, read, read, read, read, register, remove, remove, remove, removeAll, removeAll, removeAllReifications, removeReification, size, supportsSetOperations, supportsTransactions, union, unregister
 
Methods inherited from interface com.hp.hpl.jena.rdf.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, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, getAlt, getAlt, getBag, getBag, getProperty, getRDFNode, getResource, getSeq, getSeq, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listStatements, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, remove, remove, remove
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelGraphInterface
asRDFNode, asStatement, getGraph, queryHandler
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFReaderF
getReader, getReader, setReaderClassName
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFWriterF
getWriter, getWriter, setWriterClassName
 
Methods inherited from interface com.hp.hpl.jena.shared.PrefixMapping
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, lock, qnameFor, removeNsPrefix, samePrefixMappingAs, setNsPrefix, setNsPrefixes, setNsPrefixes, shortForm, usePrefix, withDefaultMappings
 
Methods inherited from interface com.hp.hpl.jena.shared.Lock
enterCriticalSection, leaveCriticalSection
 

Method Detail

createDAMLOntology

DAMLOntology createDAMLOntology(java.lang.String uri)

Create an (optionally anonymous) 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.

Parameters:
uri - The URI for the new Ontology, or null to create an anonymous Ontology. Ideally provide the URL in which the Ontology is stored. Conventionally, in the RDF/XML serialization, we have
             <daml:Ontology rdf:about="">
            
The empty URIref in the above RDF/XML is known as a same document reference and expands to the URL of the current file.
Returns:
A new DAMLOntology object, which is created by adding the appropriate statements to the RDF model.

createDAMLInstance

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.

createDAMLDataInstance

DAMLDataInstance createDAMLDataInstance(Resource datatype,
                                        java.lang.Object value)

Create an anonymous data instance, which has the given datatype and value.

Parameters:
datatype - A resource denoting the datatype of the new data instance object
value - The value of the data instance
Returns:
A new DAMLDataInstance object.

createDAMLDataInstance

DAMLDataInstance createDAMLDataInstance(RDFDatatype datatype,
                                        java.lang.Object value)

Create an anonymous data instance, which has the given datatype and value.

Parameters:
datatype - A resource denoting the datatype of the new data instance object
value - The value of the data instance
Returns:
A new DAMLDataInstance object.

createDAMLDataInstance

DAMLDataInstance createDAMLDataInstance(java.lang.Object value)

Create an anonymous data instance, which has the given value and an appropriate datatype.

Parameters:
value - The value of the data instance
Returns:
A new DAMLDataInstance object.

createDAMLClass

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

DAMLProperty createDAMLProperty(java.lang.String uri)

Create a 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. May not be null.
Returns:
A new DAMLProperty object, which is created by adding the appropriate statements to the RDF model.

createDAMLObjectProperty

DAMLObjectProperty createDAMLObjectProperty(java.lang.String uri)

Create a DAML object property. An object property has ontology individuals (instances) in its range, whereas a datatype property has concrete data literals in the range.

Parameters:
uri - The URI for the new object property. May not be null.
Returns:
A new DAMLObjectProperty object.

createDAMLDatatypeProperty

DAMLDatatypeProperty createDAMLDatatypeProperty(java.lang.String uri)

Create an (optionally anonymous) DAML datatype property. A datatype property has concrete data literals in its range, whereas an object property has ontology individuals (instances) in the range.

Parameters:
uri - The URI for the new datatype property. May not be null.
Returns:
A new DAMLDatatypeProperty object.

createDAMLList

DAMLList createDAMLList()

Create an empty DAML list.

Returns:
A new empty DAMLList.

createDAMLList

DAMLList createDAMLList(java.util.Iterator elements)

Create a new DAML list containing the given elements.

Parameters:
elements - An iterator over the elements to be added to the list
Returns:
A new empty DAMLList.

createDAMLList

DAMLList createDAMLList(RDFNode[] elements)

Create a new DAML list containing the given elements.

Parameters:
elements - An array of RDFNodes that will be the elements of the list
Returns:
A new empty DAMLList.

createDAMLRestriction

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.

createDAMLDatatype

DAMLDatatype createDAMLDatatype(java.lang.String uri)

Create a DAML Datatype representing values from some concrete domain.

Parameters:
uri - The URI that is both the URI of this datatype value, and the identifier of the concrete domain type (e.g. as an XSD datatype).
Returns:
A new DAMLDatatype object.

createDAMLValue

DAMLCommon createDAMLValue(java.lang.String uri,
                           Resource damlClass)

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: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
Returns:
An instance of a DAMLCommon value that corresponds to the given class.

getDAMLValue

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

DAMLCommon getDAMLValue(java.lang.String uri,
                        DAMLClass damlClass)

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.
Returns:
An existing DAML resource from the model, matching uri, or a new resource if no existing resource is found.

getDAMLClass

DAMLClass getDAMLClass(java.lang.String uri)

Answer a resource from the current model with the given uri, viewed as a DAML Class.

Parameters:
uri - The uri of the resource to fetch
Returns:
The class resource with the given URI, or null

getDAMLProperty

DAMLProperty getDAMLProperty(java.lang.String uri)

Answer a resource from the current model with the given uri, viewed as a DAML Property.

Parameters:
uri - The uri of the resource to fetch
Returns:
The property resource with the given URI, or null

getDAMLInstance

DAMLInstance getDAMLInstance(java.lang.String uri)

Answer a resource from the current model with the given uri, viewed as a DAML Instance.

Parameters:
uri - The uri of the resource to fetch
Returns:
The instance resource with the given URI, or null

listDAMLClasses

ExtendedIterator 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

ExtendedIterator 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

ExtendedIterator listDAMLInstances()

Answer an iterator over all DAML instances that are presently in the model.

Returns:
An iterator over all currently defined DAML instances.

getLoader

com.hp.hpl.jena.ontology.daml.impl.DAMLLoader getLoader()

Answer a reference to the loader for this DAML model

Returns:
a DAMLLoader reference

getLoadSuccessful

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

TypeMapper 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 method has changed since Jena1, and now uses the much more clearly defined mechanism for datatypes that has been specified for RDF. This updated specification is represented in Jena2 via the com.hp.hpl.jena.datatypes package.

Note that the type mapper returned is the shared, global singleton instance of the type mapper.

Returns:
An XML datatype mapper

read

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.

Specified by:
read in interface Model
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( String, String )

setUseEquivalence

void setUseEquivalence(boolean useEquivalence)
Deprecated. Not useful in Jena2, since equivalence processing is handled by the inference graph.

Flag to control whether accessing the DAML store will take into account equivalence classes for properties and resources, using daml:equivalentTo and similar statements. In Jena 2, equivalence processing is delegated to the inference engine that is used to wrap the graph. Therefore, setting a flag at this API level is not useful, and this method is therefore deprecated.

Parameters:
useEquivalence - If true, accessing properties and resources will check for equivalent values, at a cost of reduced performance.

getUseEquivalence

boolean getUseEquivalence()
Deprecated. Not useful in Jena2, since equivalence processing is handled by the inference graph.

Answer true if the model will consider equivalence classes when accessing properties and resources. See setUseEquivalence(boolean) for details. In Jena 2, equivalence processing is delegated to the inference engine that is used to wrap the graph. Therefore, setting a flag at this API level is not useful, and this method is therefore deprecated.

Returns:
True if equivalence classes are being considered.


Copyright © 2000, 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP