|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DAMLModel
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.
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(String uri)
Create an (optionally anonymous) DAML class. |
DAMLDataInstance |
createDAMLDataInstance(Object value)
Create an anonymous data instance, which has the given value and an appropriate datatype. |
DAMLDataInstance |
createDAMLDataInstance(RDFDatatype datatype,
Object value)
Create an anonymous data instance, which has the given datatype and value. |
DAMLDataInstance |
createDAMLDataInstance(Resource datatype,
Object value)
Create an anonymous data instance, which has the given datatype and value. |
DAMLDatatype |
createDAMLDatatype(String uri)
Create a DAML Datatype representing values from some concrete domain. |
DAMLDatatypeProperty |
createDAMLDatatypeProperty(String uri)
Create an (optionally anonymous) DAML datatype property. |
DAMLInstance |
createDAMLInstance(DAMLClass damlClass,
String uri)
Create an (optionally anonymous) instance of the given class. |
DAMLList |
createDAMLList()
Create an empty DAML list. |
DAMLList |
createDAMLList(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(String uri)
Create a DAML object property. |
DAMLOntology |
createDAMLOntology(String uri)
Create an (optionally anonymous) Ontology (big-'O') element, which holds meta-information for the ontology (small-'o'). |
DAMLProperty |
createDAMLProperty(String uri)
Create a DAML property. |
DAMLRestriction |
createDAMLRestriction(String uri)
Create an (optionally anonymous) DAML Restriction. |
DAMLCommon |
createDAMLValue(String uri,
Resource damlClass)
Create a new DAML value that is a member of the given class. |
DAMLClass |
getDAMLClass(String uri)
Answer a resource from the current model with the given uri, viewed as a DAML Class. |
DAMLInstance |
getDAMLInstance(String uri)
Answer a resource from the current model with the given uri, viewed as a DAML Instance. |
DAMLProperty |
getDAMLProperty(String uri)
Answer a resource from the current model with the given uri, viewed as a DAML Property. |
DAMLCommon |
getDAMLValue(String uri)
Answer the DAML value that corresponds to the given URI, if it exists in the model. |
DAMLCommon |
getDAMLValue(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(String uri,
String base,
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.rdf.model.InfModel |
---|
getDeductionsModel, getDerivation, getRawModel, getReasoner, listStatements, prepare, rebind, reset, setDerivationLogging, validate |
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, setNsPrefix, setNsPrefixes, setNsPrefixes, shortForm, usePrefix, withDefaultMappings |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
---|
enterCriticalSection, leaveCriticalSection |
Method Detail |
---|
DAMLOntology createDAMLOntology(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.
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 referenceand expands to the URL of the current file.
DAMLInstance createDAMLInstance(DAMLClass damlClass, String uri)
Create an (optionally anonymous) instance of the given class.
damlClass
- The class of the newly created DAMLInstanceuri
- The URI for the new instance, or null to create an anonymous instance.
DAMLDataInstance createDAMLDataInstance(Resource datatype, Object value)
Create an anonymous data instance, which has the given datatype and value.
datatype
- A resource denoting the datatype of the new data instance objectvalue
- The value of the data instance
DAMLDataInstance createDAMLDataInstance(RDFDatatype datatype, Object value)
Create an anonymous data instance, which has the given datatype and value.
datatype
- A resource denoting the datatype of the new data instance objectvalue
- The value of the data instance
DAMLDataInstance createDAMLDataInstance(Object value)
Create an anonymous data instance, which has the given value and an appropriate datatype.
value
- The value of the data instance
DAMLClass createDAMLClass(String uri)
Create an (optionally anonymous) DAML class.
uri
- The URI for the new class, or null to create an anonymous class.
DAMLProperty createDAMLProperty(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)
.
uri
- The URI for the new property. May not be null.
DAMLObjectProperty createDAMLObjectProperty(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.
uri
- The URI for the new object property. May not be null.
DAMLObjectProperty
object.DAMLDatatypeProperty createDAMLDatatypeProperty(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.
uri
- The URI for the new datatype property. May not be null.
DAMLList createDAMLList()
Create an empty DAML list.
DAMLList createDAMLList(Iterator elements)
Create a new DAML list containing the given elements.
elements
- An iterator over the elements to be added to the list
DAMLList createDAMLList(RDFNode[] elements)
Create a new DAML list containing the given elements.
elements
- An array of RDFNodes that will be the elements of the list
DAMLRestriction createDAMLRestriction(String uri)
Create an (optionally anonymous) DAML Restriction.
uri
- The URI for the new restriction, or null to create
an anonymous restriction.
DAMLDatatype createDAMLDatatype(String uri)
Create a DAML Datatype representing values from some concrete domain.
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).
DAMLCommon createDAMLValue(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.
uri
- The URI of the new DAML value, or null for an anonymous valuedamlClass
- The class to which the new DAML value will belong
DAMLCommon getDAMLValue(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.
uri
- The URI of the DAML resource to look for.
DAMLCommon getDAMLValue(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.
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.
DAMLClass getDAMLClass(String uri)
Answer a resource from the current model with the given uri, viewed as a DAML Class.
uri
- The uri of the resource to fetch
DAMLProperty getDAMLProperty(String uri)
Answer a resource from the current model with the given uri, viewed as a DAML Property.
uri
- The uri of the resource to fetch
DAMLInstance getDAMLInstance(String uri)
Answer a resource from the current model with the given uri, viewed as a DAML Instance.
uri
- The uri of the resource to fetch
ExtendedIterator listDAMLClasses()
Answer an iterator over all DAML classes that are presently in the model.
ExtendedIterator listDAMLProperties()
Answer an iterator over all DAML properties that are presently in the model.
ExtendedIterator listDAMLInstances()
Answer an iterator over all DAML instances that are presently in the model.
com.hp.hpl.jena.ontology.daml.impl.DAMLLoader getLoader()
Answer a reference to the loader for this DAML model
boolean getLoadSuccessful()
DAMLLoader.getStatus()
for details, and check error log.
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.
Model read(String uri, String base, 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.
read
in interface Model
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( String, String )
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. 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.
useEquivalence
- If true, accessing properties and resources will check for
equivalent values, at a cost of reduced performance.boolean getUseEquivalence()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |