|
|||||||||
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.ResourceImpl | +--com.hp.hpl.jena.daml.common.DAMLCommonImpl
Abstract super-class for all DAML resources (including properties). Defines shared
implementations and common services, such as property manipulation, vocabulary
management and rdf:type
management. Also defines accessors for common
properties, such as comment, label, and equivalentTo.
Constructor Summary | |
DAMLCommonImpl(java.lang.String uri,
DAMLModel model,
DAMLVocabulary vocabulary)
Constructor, takes the URI this value, and the underlying model it will be attached to. |
|
DAMLCommonImpl(java.lang.String namespace,
java.lang.String name,
DAMLModel model,
DAMLVocabulary vocabulary)
Constructor, takes the name and namespace for this value, and the underlying model it will be attached to. |
Method Summary | |
java.util.Iterator |
getAll(Property property,
boolean closed)
Answer an iterator over a set of resources that are the objects of statements with subject this DAML object and predicate the given property. |
DAMLModel |
getDAMLModel()
Answer the underlying model |
java.util.Iterator |
getEquivalenceSet()
Answer the set of equivalent values to this value, but not including the value itself. |
java.util.Iterator |
getEquivalentValues()
Answer an iterator over all of the DAML objects that are equivalent to this value under the daml:equivalentTo relation. |
int |
getNumPropertyValues(Property property)
Answer the number of values a given property has with this value as subject. |
RDFNode |
getPropertyValue(Property property)
Answer the value of a given RDF property for this DAML value, or null if it doesn't have one. |
NodeIterator |
getPropertyValues(Property property)
Answer an iterator over the set of all values for a given RDF property. |
java.util.Iterator |
getRDFTypes(boolean closed)
Answer an iterator over all of the types to which this class belongs. |
java.util.Iterator |
getSelfIterator()
Answer an iterator that contains exactly this value. |
DAMLVocabulary |
getVocabulary()
Answer the DAML+OIL vocabulary that corresponds to the namespace that this value was declared in. |
boolean |
hasRDFType(Resource damlClass)
Answer true if this DAML value is a member of the class denoted by the given DAML class object. |
boolean |
hasRDFType(java.lang.String classURI)
Answer true if this DAML value is a member of the class denoted by the given URI. |
LiteralAccessor |
prop_comment()
Accessor for the property of the comment on the value, whose value is a literal (string). |
PropertyAccessor |
prop_equivalentTo()
Property accessor for the 'equivalentTo' property of a DAML value. |
LiteralAccessor |
prop_label()
Accessor for the property of the label on the value, whose value is a literal (string). |
PropertyAccessor |
prop_type()
Property accessor for the 'rdf:type' property of a DAML value. |
void |
remove()
Remove the DAML object from the model. |
void |
removeAll(Property prop)
Remove all the values for a given property on this DAML resource. |
void |
removeProperty(Property property,
RDFNode value)
Remove the specific RDF property-value pair from this DAML resource. |
void |
replaceProperty(Property prop,
RDFNode value)
Replace the value of the named property with the given value. |
void |
setPropertyValue(Property property,
RDFNode value)
Set the value of the given property of this DAML value to the given value, encoded as an RDFNode. |
void |
setRDFType(Resource rdfClass)
Set the RDF type property for this node in the underlying model, replacing any existing type property. |
void |
setRDFType(Resource rdfClass,
boolean replace)
Add an RDF type property for this node in the underlying model. |
java.lang.String |
toString()
Return a readable representation of the DAML value |
Methods inherited from class com.hp.hpl.mesa.rdf.jena.common.ResourceImpl |
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getEmbeddedResource, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hashCode, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, port, removeProperties |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Resource |
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, removeProperties |
Constructor Detail |
public DAMLCommonImpl(java.lang.String uri, DAMLModel model, DAMLVocabulary vocabulary)
uri
- The URI of the DAML value, or null for an anonymous node.model
- Reference to the DAML model that will contain statements about this DAML value.vocabulary
- The vocabulary for this value (defines the namespace). Can be null, in which
case the vocabulary defaults to the most recent.public DAMLCommonImpl(java.lang.String namespace, java.lang.String name, DAMLModel model, DAMLVocabulary vocabulary)
namespace
- The namespace the class inhabits, or nullname
- The name of the DAML valuemodel
- Reference to the DAML model that will contain statements about this DAML class.vocabulary
- The vocabulary for this value (defines the namespace). Can be null, in which
case the vocabulary defaults to the most recent.Method Detail |
public DAMLModel getDAMLModel()
getDAMLModel
in interface DAMLCommon
public void setRDFType(Resource rdfClass)
setRDFType( Resource, false )
.setRDFType
in interface DAMLCommon
rdfClass
- The RDF resource denoting the new value for the rdf:type property,
which will replace any existing type property.public void setRDFType(Resource rdfClass, boolean replace)
setRDFType
in interface DAMLCommon
rdfClass
- The RDF resource denoting the class that will be new value for the rdf:type property.replace
- If true, the given class will replace any existing type property for this
value, otherwise it will be added as an extra type statement.public boolean hasRDFType(java.lang.String classURI)
hasRDFType
in interface DAMLCommon
classURI
- String denoting the URI of the class to test againstrdf:type
.public boolean hasRDFType(Resource damlClass)
hasRDFType
in interface DAMLCommon
damlClass
- Denotes a class to which this value may belongrdf:type
.public java.util.Iterator getRDFTypes(boolean closed)
{Dog, Vaccinated}
,
i.e. the set of classes for which rdf:type statements exist for fido,
while the closed set might be
{Dog, Vaccinated, Mammal, Pet, Vertebrate, Thing, MedicallyCertified}
getRDFTypes
in interface DAMLCommon
closed
- If true, generate the closed set by considering the super-classes of
the known classes of this value.public RDFNode getPropertyValue(Property property)
getPropertyValue
in interface DAMLCommon
property
- An RDF propertypublic NodeIterator getPropertyValues(Property property)
getPropertyValues
in interface DAMLCommon
property
- The property whose values are soughtRDFNode
.public void setPropertyValue(Property property, RDFNode value)
addProperty
.setPropertyValue
in interface DAMLCommon
property
- The property to updatevalue
- The new value of the property as an RDFNode, or null to
effectively remove this property.public void removeProperty(Property property, RDFNode value)
removeProperty
in interface DAMLCommon
property
- The property to be removedvalue
- The specific value of the property to be removedpublic void removeAll(Property prop)
removeAll
in interface DAMLCommon
prop
- The RDF resource that defines the property to be removedpublic void replaceProperty(Property prop, RDFNode value)
replaceProperty
in interface DAMLCommon
prop
- The RDF property to be updatedvalue
- The new value.public int getNumPropertyValues(Property property)
getNumPropertyValues
in interface DAMLCommon
property
- The property to be testedpublic java.util.Iterator getAll(Property property, boolean closed)
getAll
in interface DAMLCommon
property
- The property whose values are soughtclosed
- If true, and the given property is transitive, generate the
closure over the given property from this value.property
or one of its equivalentspublic DAMLVocabulary getVocabulary()
getVocabulary
in interface DAMLCommon
public java.util.Iterator getEquivalentValues()
daml:equivalentTo
relation. The common method
just tests this relation, getEquivalentValues()
in sub-classes,
such as DAMLClass
, may extend this with specific
additional semantics such as daml:sameClassAs
.getEquivalentValues
in interface DAMLCommon
public java.util.Iterator getEquivalenceSet()
getEquivalenceSet
in interface DAMLCommon
public java.util.Iterator getSelfIterator()
public java.lang.String toString()
toString
in interface Resource
toString
in class ResourceImpl
public void remove()
remove
in interface DAMLCommon
public LiteralAccessor prop_label()
prop_label
in interface DAMLCommon
public LiteralAccessor prop_comment()
prop_comment
in interface DAMLCommon
public PropertyAccessor prop_equivalentTo()
prop_equivalentTo
in interface DAMLCommon
public PropertyAccessor prop_type()
prop_type
in interface DAMLCommon
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |