|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 inherited from class com.hp.hpl.jena.shared.PrefixMapping |
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException |
Field Summary |
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
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.rdf.model.InfModel |
getDeductionsModel, getDerivation, getRawModel, getReasoner, listStatements, prepare, rebind, reset, setDerivationLogging, validate |
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, removeNsPrefix, setNsPrefix, setNsPrefixes, setNsPrefixes, usePrefix |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
enterCriticalSection, leaveCriticalSection |
Method Detail |
public 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.
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.
public DAMLInstance createDAMLInstance(DAMLClass damlClass, java.lang.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.
public DAMLDataInstance createDAMLDataInstance(Resource datatype, java.lang.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
public DAMLDataInstance createDAMLDataInstance(RDFDatatype datatype, java.lang.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
public DAMLDataInstance createDAMLDataInstance(java.lang.Object value)
Create an anonymous data instance, which has the given value and an appropriate datatype.
value
- The value of the data instance
public DAMLClass createDAMLClass(java.lang.String uri)
Create an (optionally anonymous) DAML class.
uri
- The URI for the new class, or null to create an anonymous class.
public 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)
.
uri
- The URI for the new property. May not be null.
public 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.
uri
- The URI for the new object property. May not be null.
DAMLObjectProperty
object.public 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.
uri
- The URI for the new datatype property. May not be null.
public DAMLList createDAMLList()
Create an empty DAML list.
public DAMLList createDAMLList(java.util.Iterator elements)
Create a new DAML list containing the given elements.
elements
- An iterator over the elements to be added to the list
public 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
public DAMLRestriction createDAMLRestriction(java.lang.String uri)
Create an (optionally anonymous) DAML Restriction.
uri
- The URI for the new restriction, or null to create
an anonymous restriction.
public DAMLDatatype createDAMLDatatype(java.lang.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).
public 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.
uri
- The URI of the new DAML value, or null for an anonymous valuedamlClass
- The class to which the new DAML value will belong
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.
uri
- The URI of the DAML resource to look for.
public 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.
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.
public DAMLClass getDAMLClass(java.lang.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
public DAMLProperty getDAMLProperty(java.lang.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
public DAMLInstance getDAMLInstance(java.lang.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
public ExtendedIterator listDAMLClasses()
Answer an iterator over all DAML classes that are presently in the model.
public ExtendedIterator listDAMLProperties()
Answer an iterator over all DAML properties that are presently in the model.
public ExtendedIterator listDAMLInstances()
Answer an iterator over all DAML instances that are presently in the model.
public com.hp.hpl.jena.ontology.daml.impl.DAMLLoader getLoader()
Answer a reference to the loader for this DAML model
public boolean getLoadSuccessful()
DAMLLoader.getStatus()
for details, and check error log.
public 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.
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.
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 )
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. 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.public 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 |