|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.mesa.rdf.jena.common.ModelCom | +--com.hp.hpl.mesa.rdf.jena.mem.ModelMem | +--com.hp.hpl.jena.daml.common.DAMLModelImpl
Implementation for the DAML model interface, which is a specialisation of a Jena RDF store for the application of storing and manipulating DAML objects. The specialisations include storing a set of DAML wrapper objects that provide a convenience interface to the underlying RDF statements, and providing a set of indexes for efficiently retrieving these objects.
TODO: this class should really not extend ModelMem, since that commits it to a particular storage model (in-memory storage). Brian is looking at refactoring the Jena Model implementations, to parameterise them on a storage module, rather than expressing that storage through the class hierarchy. Pending that change, I have decided to directly extend ModelMem.
Constructor Summary | |
DAMLModelImpl()
Constructor, initialises internal data structures. |
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 the DAML Loader that is used by this store to load DAML source documents. |
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.io.Reader in,
java.lang.String base)
Read the ontology from the given reader, assuming that its base URI is the given URI. |
Model |
read(java.io.Reader in,
java.lang.String base,
java.lang.String lang)
Read the ontology from the given reader, assuming that its base URI is the given URI. |
Model |
read(java.lang.String uri)
Read the ontology indicated by the given uri. |
Model |
read(java.lang.String uri,
java.lang.String lang)
Read the ontology indicated by the given uri. |
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 class com.hp.hpl.mesa.rdf.jena.mem.ModelMem |
difference, intersection, query, supportsSetOperations, supportsTransactions, union |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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, 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 |
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.common.ModelI |
containerContains, containerIndexOf, containerSize, convert, convert, convert, listContainerMembers |
Constructor Detail |
public DAMLModelImpl()
Method Detail |
public DAMLOntology createDAMLOntology()
createDAMLOntology
in interface DAMLModel
public DAMLInstance createDAMLInstance(DAMLClass damlClass, java.lang.String uri)
createDAMLInstance
in interface DAMLModel
damlClass
- The class of the newly created DAMLInstanceuri
- The URI for the new instance, or null to create an anonymous instance.public DAMLClass createDAMLClass(java.lang.String uri)
createDAMLClass
in interface DAMLModel
uri
- The URI for the new class, or null to create an anonymous class.public DAMLProperty createDAMLProperty(java.lang.String uri)
createDAMLObjectProperty(java.lang.String)
or createDAMLDatatypeProperty(java.lang.String)
.createDAMLProperty
in interface DAMLModel
uri
- The URI for the new property, or null to create an anonymous property.public DAMLObjectProperty createDAMLObjectProperty(java.lang.String uri)
createDAMLObjectProperty
in interface DAMLModel
uri
- The URI for the new object property, or null to create an
anonymous object property.public DAMLDatatypeProperty createDAMLDatatypeProperty(java.lang.String uri)
createDAMLDatatypeProperty
in interface DAMLModel
uri
- The URI for the new datatype property, or null to create
an anonymous datatype property.public DAMLList createDAMLList(java.lang.String uri)
createDAMLList
in interface DAMLModel
uri
- The URI for the new list, or null to create
an anonymous list.public DAMLRestriction createDAMLRestriction(java.lang.String uri)
createDAMLRestriction
in interface DAMLModel
uri
- The URI for the new restriction, or null to create
an anonymous restriction.public DAMLCommon createDAMLValue(java.lang.String uri, Resource damlClass, DAMLVocabulary vocabulary)
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.createDAMLValue
in interface DAMLModel
uri
- The URI of the new DAML value, or null for an anonymous valuedamlClass
- The class to which the new DAML value will belongvocabulary
- The vocabulary to use for the new value, or null to use
the default vocabulary.public DAMLCommon getDAMLValue(java.lang.String uri)
getDAMLValue
in interface DAMLModel
uri
- The URI of the DAML resource to look for.public DAMLCommon getDAMLValue(java.lang.String uri, DAMLClass damlClass, DAMLVocabulary vocabulary)
getDAMLValue
in interface DAMLModel
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.public java.util.Iterator listDAMLClasses()
listDAMLClasses
in interface DAMLModel
public java.util.Iterator listDAMLProperties()
listDAMLProperties
in interface DAMLModel
public java.util.Iterator listDAMLInstances()
listDAMLInstances
in interface DAMLModel
public Model read(java.lang.String uri)
DAMLLoader
, ontology import statements embedded in this document will be
processed and the ontologies fetched and loaded.read
in interface Model
read
in class ModelCom
uri
- The URI identifying an ontology to be added, which is assumed to be
represented in the XML serialisation of RDF.public Model read(java.lang.String uri, java.lang.String lang)
DAMLLoader
, ontology import statements embedded in this document will be
processed and the ontologies fetched and loaded.read
in interface Model
read
in class ModelCom
uri
- The URI identifying an ontology to be added, which is assumed to be
represented in the XML serialisation of RDF.lang
- The encoding language of the source documentpublic Model read(java.io.Reader in, java.lang.String base)
DAMLLoader
, ontology import statements embedded in this document will be
processed and the ontologies fetched and loaded.read
in interface Model
read
in class ModelCom
in
- A reader, from which will be read the DAML definitions, which are assumed to be
represented in the XML serialisation of RDF.base
- The base URI for any relative definitions that are loaded.public Model read(java.lang.String uri, java.lang.String base, java.lang.String lang)
DAMLLoader
, ontology import statements embedded in this document will be
processed and the ontologies fetched and loaded.read
in interface DAMLModel
uri
- The URI identifying an ontology to be added.base
- The base URI for any relative names that are loaded from the source documentlang
- Denotes the language the statements are represented in.Model.read( java.lang.String, java.lang.String )
public Model read(java.io.Reader in, java.lang.String base, java.lang.String lang)
DAMLLoader
, ontology import statements embedded in this document will be
processed and the ontologies fetched and loaded. Use getLoadSuccessful()
to
check whether the load operation was successful.read
in interface Model
read
in class ModelCom
in
- A reader, from which will be read the DAML definitions.base
- The base URI for any relative definitions that are loaded.lang
- Denotes the language the statements are represented in.public DAMLLoader getLoader()
getLoader
in interface DAMLModel
public boolean getLoadSuccessful()
DAMLLoader.getStatus()
for details, and check error log.getLoadSuccessful
in interface DAMLModel
public XMLDatatypeRegistry getDatatypeRegistry()
DAMLDataInstance
objects, and type declarations that correspond to
DAMLDatatype
objects.getDatatypeRegistry
in interface DAMLModel
public void setUseEquivalence(boolean useEquivalence)
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.setUseEquivalence
in interface DAMLModel
useEquivalence
- If true, accessing properties and resources will check for
equivalent values, at a cost of reduced performance.public boolean getUseEquivalence()
setUseEquivalence(boolean)
for details.getUseEquivalence
in interface DAMLModel
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |