|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides a common super-type for all of the abstractions in this ontology representation package.
Method Summary | |
com.hp.hpl.jena.ontology.path.PathSet |
accessor(Property p)
Answer an accessor for the given
property of any ontology value. |
com.hp.hpl.jena.ontology.path.PathSet |
accessor(Property p,
java.lang.String name)
Answer an accessor for the given
property of any ontology value. |
void |
addComment(Literal comment)
Add the given comment to this resource. |
void |
addComment(java.lang.String comment,
java.lang.String lang)
Add the given comment to this resource. |
void |
addDifferentFrom(Resource res)
Add a resource that is declared to be equivalent to this resource. |
void |
addIsDefinedBy(Resource res)
Add a resource that is declared to provide a definition of this resource. |
void |
addLabel(Literal label)
Add the given label to this resource. |
void |
addLabel(java.lang.String label,
java.lang.String lang)
Add the given label to this resource. |
void |
addRDFType(Resource cls)
Add the given class as one of the rdf:type 's for this resource. |
void |
addSameAs(Resource res)
Add a resource that is declared to be equivalent to this resource. |
void |
addSeeAlso(Resource res)
Add a resource that is declared to provided additional information about the definition of this resource |
void |
addVersionInfo(java.lang.String info)
Add the given version information to this resource. |
AllDifferent |
asAllDifferent()
Answer a view of this resource as an 'all different' declaration |
AnnotationProperty |
asAnnotationProperty()
Answer a view of this resource as an annotation property |
OntClass |
asClass()
Answer a view of this resource as a class |
Individual |
asIndividual()
Answer a view of this resource as an individual |
Ontology |
asOntology()
Answer a view of this resource as an ontology description node |
OntProperty |
asProperty()
Answer a view of this resource as a property |
int |
getCardinality(Property p)
Answer the cardinality of the given property on this resource. |
java.lang.String |
getComment(java.lang.String lang)
Answer the comment string for this object. |
OntResource |
getDifferentFrom()
Answer a resource that is declared to be distinct from this resource. |
Resource |
getIsDefinedBy()
Answer a resource that is declared to provide a definition of this resource. |
java.lang.String |
getLabel(java.lang.String lang)
Answer the label string for this object. |
Profile |
getProfile()
Answer the ontology language profile that governs the ontology model to which this ontology resource is attached. |
RDFNode |
getPropertyValue(Property property)
Answer the value of a given RDF property for this resource, or null if it doesn't have one. |
Resource |
getRDFType()
Answer the rdf:type (ie the class) of this resource. |
Resource |
getRDFType(boolean direct)
Answer the rdf:type (ie the class) of this resource. |
OntResource |
getSameAs()
Answer a resource that is declared to be the same as this resource. |
Resource |
getSeeAlso()
Answer a resource that provides additional information about this resource. |
java.lang.String |
getVersionInfo()
Answer the version information string for this object. |
boolean |
hasComment(Literal comment)
Answer true if this resource has the given comment. |
boolean |
hasComment(java.lang.String comment,
java.lang.String lang)
Answer true if this resource has the given comment. |
boolean |
hasLabel(Literal label)
Answer true if this resource has the given label |
boolean |
hasLabel(java.lang.String label,
java.lang.String lang)
Answer true if this resource has the given label |
boolean |
hasRDFType(Resource ontClass)
Answer true if this resource is a member of the class denoted by the given class resource. |
boolean |
hasRDFType(Resource ontClass,
boolean direct)
Answer true if this resource is a member of the class denoted by the given class resource. |
boolean |
hasRDFType(java.lang.String uri)
Answer true if this resource is a member of the class denoted by the given URI. |
boolean |
hasSeeAlso(Resource res)
Answer true if this resource has the given resource as a source of additional information. |
boolean |
hasVersionInfo(java.lang.String info)
Answer true if this resource has the given version information |
boolean |
isDefinedBy(Resource res)
Answer true if this resource is defined by the given resource. |
boolean |
isDifferentFrom(Resource res)
Answer true if this resource is different from the given resource. |
boolean |
isSameAs(Resource res)
Answer true if this resource is the same as the given resource. |
ExtendedIterator |
listComments(java.lang.String lang)
Answer an iterator over all of the comment literals for this resource. |
ExtendedIterator |
listDifferentFrom()
Answer an iterator over all of the resources that are declared to be different from this resource. |
ExtendedIterator |
listIsDefinedBy()
Answer an iterator over all of the resources that are declared to define this resource. |
ExtendedIterator |
listLabels(java.lang.String lang)
Answer an iterator over all of the label literals for this resource. |
NodeIterator |
listPropertyValues(Property property)
Answer an iterator over the values for a given RDF property. |
ExtendedIterator |
listRDFTypes(boolean direct)
Answer an iterator over the RDF classes to which this resource belongs. |
ExtendedIterator |
listSameAs()
Answer an iterator over all of the resources that are declared to be the same as this resource. |
ExtendedIterator |
listSeeAlso()
Answer an iterator over all of the resources that are declared to provide addition information about this resource. |
ExtendedIterator |
listVersionInfo()
Answer an iterator over all of the version info strings for this resource. |
void |
remove()
Removes this resource from the ontology by deleting any statements that refer to it. |
void |
removeComment(Literal comment)
Remove the statement that the given string is a comment on this resource. |
void |
removeComment(java.lang.String comment,
java.lang.String lang)
Remove the statement that the given string is a comment on this resource. |
void |
removeDefinedBy(Resource res)
Remove the statement that this resource is defined by the given resource. |
void |
removeDifferentFrom(Resource res)
Remove the statement that this resource is different the given resource. |
void |
removeLabel(Literal label)
Remove the statement that the given string is a label for this resource. |
void |
removeLabel(java.lang.String label,
java.lang.String lang)
Remove the statement that the given string is a label for this resource. |
void |
removeProperty(Property property,
RDFNode value)
Remove the specific property-value pair from this resource. |
void |
removeRDFType(Resource cls)
Remove the statement that this resource is of the given RDF type. |
void |
removeSameAs(Resource res)
Remove the statement that this resource is the same as the given resource. |
void |
removeSeeAlso(Resource res)
Remove the statement indicating the given resource as a source of additional information about this resource. |
void |
removeVersionInfo(java.lang.String info)
Remove the statement that the given string provides version information about this resource. |
void |
setComment(java.lang.String comment,
java.lang.String lang)
Assert that the given string is the comment on this resource. |
void |
setDifferentFrom(Resource res)
Assert that the given resource and this resource are distinct. |
void |
setIsDefinedBy(Resource res)
Assert that the given resource provides a source of definitions about this resource. |
void |
setLabel(java.lang.String label,
java.lang.String lang)
Assert that the given string is the value of the label for this resource. |
void |
setPropertyValue(Property property,
RDFNode value)
Set the value of the given property of this ontology resource to the given value, encoded as an RDFNode. |
void |
setRDFType(Resource cls)
Set the RDF type (ie the class) for this resource, replacing any existing rdf:type property. |
void |
setSameAs(Resource res)
Assert equivalence between the given resource and this resource. |
void |
setSeeAlso(Resource res)
Assert that the given resource provides additional information about the definition of this resource |
void |
setVersionInfo(java.lang.String info)
Assert that the given string is the value of the version info for this resource. |
Methods inherited from interface com.hp.hpl.jena.rdf.model.Resource |
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getNode, getProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, removeAll, removeProperties, toString |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFNode |
as, asNode, canAs, inModel, visitWith |
Method Detail |
public Profile getProfile()
Answer the ontology language profile that governs the ontology model to which this ontology resource is attached.
public void setSameAs(Resource res)
Assert equivalence between the given resource and this resource. Any existing
statements for sameAs
will be removed.
res
- The resource that is declared to be the same as this resource
OntProfileException
- If the Profile.SAME_AS()
property is not supported in the current language profile.public void addSameAs(Resource res)
Add a resource that is declared to be equivalent to this resource.
res
- A resource that declared to be the same as this resource
OntProfileException
- If the Profile.SAME_AS()
property is not supported in the current language profile.public OntResource getSameAs()
Answer a resource that is declared to be the same as this resource. If there is more than one such resource, an arbitrary selection is made.
OntProfileException
- If the Profile.SAME_AS()
property is not supported in the current language profile.public ExtendedIterator listSameAs()
Answer an iterator over all of the resources that are declared to be the same as
this resource. Each elemeent of the iterator will be an OntResource
.
OntProfileException
- If the Profile.SAME_AS()
property is not supported in the current language profile.public boolean isSameAs(Resource res)
Answer true if this resource is the same as the given resource.
res
- A resource to test against
sameAs
statement.
OntProfileException
- If the Profile.SAME_AS()
property is not supported in the current language profile.public void removeSameAs(Resource res)
Remove the statement that this resource is the same as the given resource. If this statement is not true of the current model, nothing happens.
res
- A resource that may be declared to be the sameAs this resourcepublic void setDifferentFrom(Resource res)
Assert that the given resource and this resource are distinct. Any existing
statements for differentFrom
will be removed.
res
- The resource that is declared to be distinct from this resource
OntProfileException
- If the Profile.DIFFERENT_FROM()
property is not supported in the current language profile.public void addDifferentFrom(Resource res)
Add a resource that is declared to be equivalent to this resource.
res
- A resource that declared to be the same as this resource
OntProfileException
- If the Profile.DIFFERENT_FROM()
property is not supported in the current language profile.public OntResource getDifferentFrom()
Answer a resource that is declared to be distinct from this resource. If there is more than one such resource, an arbitrary selection is made.
OntProfileException
- If the Profile.DIFFERENT_FROM()
property is not supported in the current language profile.public ExtendedIterator listDifferentFrom()
Answer an iterator over all of the resources that are declared to be different from
this resource. Each elemeent of the iterator will be an OntResource
.
OntProfileException
- If the Profile.DIFFERENT_FROM()
property is not supported in the current language profile.public boolean isDifferentFrom(Resource res)
Answer true if this resource is different from the given resource.
res
- A resource to test against
differentFrom
statement.public void removeDifferentFrom(Resource res)
Remove the statement that this resource is different the given resource. If this statement is not true of the current model, nothing happens.
res
- A resource that may be declared to be differentFrom this resourcepublic void setSeeAlso(Resource res)
Assert that the given resource provides additional information about the definition of this resource
res
- A resource that can provide additional information about this resource
OntProfileException
- If the Profile.SEE_ALSO()
property is not supported in the current language profile.public void addSeeAlso(Resource res)
Add a resource that is declared to provided additional information about the definition of this resource
res
- A resource that provides extra information on this resource
OntProfileException
- If the Profile.SEE_ALSO()
property is not supported in the current language profile.public Resource getSeeAlso()
Answer a resource that provides additional information about this resource. If more than one such resource is defined, make an arbitrary choice.
OntProfileException
- If the Profile.SEE_ALSO()
property is not supported in the current language profile.public ExtendedIterator listSeeAlso()
Answer an iterator over all of the resources that are declared to provide addition information about this resource.
OntProfileException
- If the Profile.SEE_ALSO()
property is not supported in the current language profile.public boolean hasSeeAlso(Resource res)
Answer true if this resource has the given resource as a source of additional information.
res
- A resource to test against
res
provides more information on this resource.public void removeSeeAlso(Resource res)
Remove the statement indicating the given resource as a source of additional information about this resource. If this statement is not true of the current model, nothing happens.
res
- A resource that may be declared to provide additional information about this resourcepublic void setIsDefinedBy(Resource res)
Assert that the given resource provides a source of definitions about this resource. Any existing
statements for isDefinedBy
will be removed.
res
- The resource that is declared to be a definition of this resource.
OntProfileException
- If the Profile.IS_DEFINED_BY()
property is not supported in the current language profile.public void addIsDefinedBy(Resource res)
Add a resource that is declared to provide a definition of this resource.
res
- A defining resource
OntProfileException
- If the Profile.IS_DEFINED_BY()
property is not supported in the current language profile.public Resource getIsDefinedBy()
Answer a resource that is declared to provide a definition of this resource. If there is more than one such resource, an arbitrary selection is made.
OntProfileException
- If the Profile.IS_DEFINED_BY()
property is not supported in the current language profile.public ExtendedIterator listIsDefinedBy()
Answer an iterator over all of the resources that are declared to define this resource.
OntProfileException
- If the Profile.IS_DEFINED_BY()
property is not supported in the current language profile.public boolean isDefinedBy(Resource res)
Answer true if this resource is defined by the given resource.
res
- A resource to test against
res
defines this resource.public void removeDefinedBy(Resource res)
Remove the statement that this resource is defined by the given resource. If this statement is not true of the current model, nothing happens.
res
- A resource that may be declared to define this resourcepublic void setVersionInfo(java.lang.String info)
Assert that the given string is the value of the version info for this resource. Any existing
statements for versionInfo
will be removed.
info
- The version information for this resource
OntProfileException
- If the Profile.VERSION_INFO()
property is not supported in the current language profile.public void addVersionInfo(java.lang.String info)
Add the given version information to this resource.
info
- A version information string for this resource
OntProfileException
- If the Profile.VERSION_INFO()
property is not supported in the current language profile.public java.lang.String getVersionInfo()
Answer the version information string for this object. If there is more than one such resource, an arbitrary selection is made.
OntProfileException
- If the Profile.VERSION_INFO()
property is not supported in the current language profile.public ExtendedIterator listVersionInfo()
Answer an iterator over all of the version info strings for this resource.
OntProfileException
- If the Profile.VERSION_INFO()
property is not supported in the current language profile.public boolean hasVersionInfo(java.lang.String info)
Answer true if this resource has the given version information
info
- Version information to test for
info
as version information.public void removeVersionInfo(java.lang.String info)
Remove the statement that the given string provides version information about this resource. If this statement is not true of the current model, nothing happens.
info
- A version information string to be removedpublic void setLabel(java.lang.String label, java.lang.String lang)
Assert that the given string is the value of the label for this resource. Any existing
statements for label
will be removed.
label
- The label for this resourcelang
- The language attribute for this label (EN, FR, etc) or null if not specified.
OntProfileException
- If the Profile.LABEL()
property is not supported in the current language profile.public void addLabel(java.lang.String label, java.lang.String lang)
Add the given label to this resource.
label
- A label string for this resourcelang
- The language attribute for this label (EN, FR, etc) or null if not specified.
OntProfileException
- If the Profile.LABEL()
property is not supported in the current language profile.public void addLabel(Literal label)
Add the given label to this resource.
label
- The literal label
OntProfileException
- If the Profile.LABEL()
property is not supported in the current language profile.public java.lang.String getLabel(java.lang.String lang)
Answer the label string for this object. If there is more than one such resource, an arbitrary selection is made.
lang
- The language attribute for the desired label (EN, FR, etc) or null for don't care. Will
attempt to retreive the most specific label matching the given language
OntProfileException
- If the Profile.LABEL()
property is not supported in the current language profile.public ExtendedIterator listLabels(java.lang.String lang)
Answer an iterator over all of the label literals for this resource.
lang
- The language tag to restric the listed comments to, or null to select all comments
Literal
's.
OntProfileException
- If the Profile.LABEL()
property is not supported in the current language profile.public boolean hasLabel(java.lang.String label, java.lang.String lang)
Answer true if this resource has the given label
label
- The label to test forlang
- The optional language tag, or null for don't care.
label
as a label.public boolean hasLabel(Literal label)
Answer true if this resource has the given label
label
- The label to test for
label
as a label.public void removeLabel(java.lang.String label, java.lang.String lang)
Remove the statement that the given string is a label for this resource. If this statement is not true of the current model, nothing happens.
label
- A label string to be removedlang
- A lang tag, or null if not specifiedpublic void removeLabel(Literal label)
Remove the statement that the given string is a label for this resource. If this statement is not true of the current model, nothing happens.
label
- A label literal to be removedpublic void setComment(java.lang.String comment, java.lang.String lang)
Assert that the given string is the comment on this resource. Any existing
statements for comment
will be removed.
comment
- The comment for this resourcelang
- The language attribute for this comment (EN, FR, etc) or null if not specified.
OntProfileException
- If the Profile.COMMENT()
property is not supported in the current language profile.public void addComment(java.lang.String comment, java.lang.String lang)
Add the given comment to this resource.
comment
- A comment string for this resourcelang
- The language attribute for this comment (EN, FR, etc) or null if not specified.
OntProfileException
- If the Profile.COMMENT()
property is not supported in the current language profile.public void addComment(Literal comment)
Add the given comment to this resource.
comment
- The literal comment
OntProfileException
- If the Profile.COMMENT()
property is not supported in the current language profile.public java.lang.String getComment(java.lang.String lang)
Answer the comment string for this object. If there is more than one such resource, an arbitrary selection is made.
lang
- The language attribute for the desired comment (EN, FR, etc) or null for don't care. Will
attempt to retreive the most specific comment matching the given language
OntProfileException
- If the Profile.COMMENT()
property is not supported in the current language profile.public ExtendedIterator listComments(java.lang.String lang)
Answer an iterator over all of the comment literals for this resource.
lang
- The language tag to restric the listed comments to, or null to select all comments
Literal
's.
OntProfileException
- If the Profile.COMMENT()
property is not supported in the current language profile.public boolean hasComment(java.lang.String comment, java.lang.String lang)
Answer true if this resource has the given comment.
comment
- The comment to test forlang
- The optional language tag, or null for don't care.
comment
as a comment.public boolean hasComment(Literal comment)
Answer true if this resource has the given comment.
comment
- The comment to test for
comment
as a comment.public void removeComment(java.lang.String comment, java.lang.String lang)
Remove the statement that the given string is a comment on this resource. If this statement is not true of the current model, nothing happens.
comment
- A comment string to be removedlang
- A lang tag, or null if not specifiedpublic void removeComment(Literal comment)
Remove the statement that the given string is a comment on this resource. If this statement is not true of the current model, nothing happens.
comment
- A comment literal to be removedpublic void setRDFType(Resource cls)
Set the RDF type (ie the class) for this resource, replacing any
existing rdf:type
property. Any existing statements for the RDF type
will first be removed.
cls
- The RDF resource denoting the new value for the rdf:type
property,
which will replace any existing type property.public void addRDFType(Resource cls)
Add the given class as one of the rdf:type
's for this resource.
cls
- An RDF resource denoting a new value for the rdf:type
property.public Resource getRDFType()
Answer the rdf:type
(ie the class) of this resource. If there
is more than one type for this resource, the return value will be one of
the values, but it is not specified which one (nor that it will consistently
be the same one each time). Equivalent to getRDFType( false )
.
public Resource getRDFType(boolean direct)
Answer the rdf:type
(ie the class) of this resource. If there
is more than one type for this resource, the return value will be one of
the values, but it is not specified which one (nor that it will consistently
be the same one each time).
direct
- If true, only consider the direct types of this resource, and not
the super-classes of the type(s).
public ExtendedIterator listRDFTypes(boolean direct)
Answer an iterator over the RDF classes to which this resource belongs.
direct
- If true, only answer those resources that are direct types
of this resource, not the super-classes of the class etc.
public boolean hasRDFType(Resource ontClass, boolean direct)
Answer true if this resource is a member of the class denoted by the given class resource.
ontClass
- Denotes a class to which this value may belongdirect
- If true, only consider the direct types of this resource, ignoring
the super-classes of the stated types.
rdf:type
's.public boolean hasRDFType(Resource ontClass)
Answer true if this resource is a member of the class denoted by the
given class resource. Includes all available types, so is equivalent to
hasRDF( ontClass, false );
ontClass
- Denotes a class to which this value may belong
rdf:type
's.public void removeRDFType(Resource cls)
Remove the statement that this resource is of the given RDF type. If this statement is not true of the current model, nothing happens.
cls
- A resource denoting a class that that is to be removed from the classes of this resourcepublic boolean hasRDFType(java.lang.String uri)
Answer true if this resource is a member of the class denoted by the given URI.
uri
- Denotes the URI of a class to which this value may belong
rdf:type
's.public int getCardinality(Property p)
Answer the cardinality of the given property on this resource. The cardinality is the number of distinct values there are for the property.
p
- A property
p
on this resource, as an
integer greater than or equal to zero.public com.hp.hpl.jena.ontology.path.PathSet accessor(Property p, java.lang.String name)
Answer an accessor
for the given
property of any ontology value. The accessor
can be used to perform a variety of operations, including getting and setting the value.
p
- A propertyname
- A string name for the property, in case an error must be reported and the property is null
public com.hp.hpl.jena.ontology.path.PathSet accessor(Property p)
Answer an accessor
for the given
property of any ontology value. The accessor
can be used to perform a variety of operations, including getting and setting the value.
p
- A property
public void setPropertyValue(Property property, RDFNode value)
Set the value of the given property of this ontology resource to the given
value, encoded as an RDFNode. Maintains the invariant that there is
at most one value of the property for a given resource, so existing
property values are first removed. To add multiple properties, use
addProperty
.
property
- The property to updatevalue
- The new value of the property as an RDFNode, or null to
effectively remove this property.public RDFNode getPropertyValue(Property property)
Answer the value of a given RDF property for this resource, or null if it doesn't have one. If there is more than one RDF statement with the given property for the current value, it is not defined which of the values will be returned.
property
- An RDF property
public NodeIterator listPropertyValues(Property property)
Answer an iterator over the values for a given RDF property. Each
value in the iterator will be an RDFNode
.
property
- The property whose values are sought
public void remove()
Removes this resource from the ontology by deleting any statements that refer to it. If this resource is a property, this method will not remove instances of the property from the model.
public void removeProperty(Property property, RDFNode value)
Remove the specific property-value pair from this resource.
property
- The property to be removedvalue
- The specific value of the property to be removedpublic AnnotationProperty asAnnotationProperty()
Answer a view of this resource as an annotation property
ConversionException
- if the resource cannot be converted to an annotation propertypublic OntProperty asProperty()
Answer a view of this resource as a property
ConversionException
- if the resource cannot be converted to a propertypublic Individual asIndividual()
Answer a view of this resource as an individual
ConversionException
- if the resource cannot be converted to an individualpublic OntClass asClass()
Answer a view of this resource as a class
ConversionException
- if the resource cannot be converted to a classpublic Ontology asOntology()
Answer a view of this resource as an ontology description node
ConversionException
- if the resource cannot be converted to an ontology description nodepublic AllDifferent asAllDifferent()
Answer a view of this resource as an 'all different' declaration
ConversionException
- if the resource cannot be converted to an all different declaration
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |