Protégé-OWL 3.4.8

edu.stanford.smi.protegex.owl.model.impl
Class DefaultRDFIndividual

java.lang.Object
  extended by edu.stanford.smi.protege.model.DefaultFrame
      extended by edu.stanford.smi.protege.model.DefaultInstance
          extended by edu.stanford.smi.protege.model.DefaultSimpleInstance
              extended by edu.stanford.smi.protegex.owl.model.impl.DefaultRDFIndividual
All Implemented Interfaces:
edu.stanford.smi.protege.model.Frame, edu.stanford.smi.protege.model.Instance, edu.stanford.smi.protege.model.Localizable, edu.stanford.smi.protege.model.SimpleInstance, ProtegeInstance, RDFIndividual, RDFObject, RDFResource, Visitable, Serializable, Comparable<edu.stanford.smi.protege.model.Frame>
Direct Known Subclasses:
AbstractCodeGeneratorIndividual, DefaultCustomer_, DefaultOWLDataRange, DefaultOWLIndividual, DefaultOWLOntology, DefaultProduct, DefaultPurchase, DefaultRDFList, DefaultRDFSDatatype, DefaultRDFUntypedResource, DefaultTestPerson

public class DefaultRDFIndividual
extends edu.stanford.smi.protege.model.DefaultSimpleInstance
implements RDFIndividual

See Also:
Serialized Form

Constructor Summary
DefaultRDFIndividual()
           
DefaultRDFIndividual(edu.stanford.smi.protege.model.KnowledgeBase kb, edu.stanford.smi.protege.model.FrameID id)
           
 
Method Summary
 void accept(OWLModelVisitor visitor)
          This method is provided to be used with the OWLModelVisitor, which is part of the visitor design pattern.
 void addComment(String comment)
          Adds an rdfs:comment to this resource.
 void addDifferentFrom(RDFResource resource)
          Adds an owl:differentFrom to this resource.
 void addIsDefinedBy(RDFResource instance)
          Adds an rdfs:isDefinedBy to this resource.
 void addLabel(String label, String language)
          Adds a label to this.
 void addPropertyValue(RDFProperty property, Object value)
          Adds a value for a given property to this resource.
 void addPropertyValueListener(PropertyValueListener listener)
          Adds a PropertyValueListener to receive events when property values have changed.
 void addProtegeType(RDFSClass type)
          Adds an type to this resource.
 void addRDFType(RDFSClass type)
          Adds an rdf:type to this resource.
 void addResourceListener(ResourceListener listener)
          Adds a ResourceListener to receive events when the type of this has changed.
 void addSameAs(RDFResource resource)
          Adds an owl:sameAs to this resource.
 void addVersionInfo(String versionInfo)
          Adds an owl:versionInfo to this resource.
 RDFResource as(Class javaInterface)
          Converts this dynamically into an instance of a given Java interface.
 boolean canAs(Class javaInterface)
          Checks whether this can be dynamically morphed into an instance of a given Java interface.
 boolean equalsStructurally(RDFObject object)
          Determines whether or not the specified class is structurally equal to this class.
 RDFResource getAllValuesFromOnTypes(RDFProperty property)
          Checks for rdfs:range or owl:allValuesFrom restrictions on the types of this resource.
 Collection getComments()
          Gets all rdfs:comments for this resource.
 Collection getDifferentFrom()
          Gets all owl:differentFroms for this resource.
 Collection getDocumentation()
           
 Collection getHasValuesOnTypes(RDFProperty property)
          Checks if there are any owl:hasValue restrictions defined on any rdf:type of this and returns the fillers of the restrictions (if found).
 Icon getIcon()
           
 Class getIconLocation()
          Gets a class that serves as a location of the icon resource.
 String getIconName()
          Gets the local name of an icon for this type of resource.
 Collection getInferredTypes()
          Gets the direct types that were inferred during the most recent execution of a reasoner.
 Collection getIsDefinedBy()
          Gets all rdfs:isDefinedBy for this resource.
 Collection getLabels()
          Gets the rdfs:labels that are currenly defined for this.
 String getLocalName()
          Gets the local part of the full URI (name) of this resource.
 String getNamespace()
          Gets the namespace of this resource.
 String getNamespacePrefix()
          Gets the prefix of the namespace, i.e.
 OWLModel getOWLModel()
          Gets the OWLModel this resource is defined in.
 Collection getPossibleRDFProperties()
          Gets a Collection of all RDFProperties that this resource could take values for.
 String getPrefixedName()
          Gets the qualified name as a namespace, local name pair (e.g.
 Object getPropertyValue(RDFProperty property)
          Gets all (direct) values of a given property.
 Object getPropertyValue(RDFProperty property, boolean includingSubproperties)
          Gets all values of a given property, and optionally its subproperties.
 RDFResource getPropertyValueAs(RDFProperty property, Class javaInterface)
           
 int getPropertyValueCount(RDFProperty property)
          Gets the number of all (direct) values of a given property.
 RDFSLiteral getPropertyValueLiteral(RDFProperty property)
          Gets the first value of a given property as an RDFSLiteral.
 Collection getPropertyValueLiterals(RDFProperty property)
          Gets all (direct) values of a given property at this as RDFSLiterals.
 Collection getPropertyValues(RDFProperty property)
          Gets all (direct) values of a given property at this resource.
 Collection getPropertyValues(RDFProperty property, boolean includingSubproperties)
          Gets all values of a given property, optionally including the values of the subproperties of the property.
 Collection getPropertyValuesAs(RDFProperty property, Class javaInterface)
           
 RDFSClass getProtegeType()
          Gets the first asserted type of this resource.
 Collection getProtegeTypes()
          Gets the asserted types of this resource.
 Collection getRDFProperties()
          Gets all RDFProperties that have at least one value at this.
 RDFSClass getRDFType()
          Gets the first asserted rdf:type of this resource.
 Collection getRDFTypes()
          Gets the asserted rdf:types of this resource.
 Set getReferringAnonymousClasses()
          Gets a Collection of all OWLAnonymousClasses that have a reference to this.
 Collection getSameAs()
          Gets the values of the owl:sameAs property.
 String getURI()
          Gets the full URI of this resource.
 Collection getVersionInfo()
          Gets the values of the owl:versionInfo property.
 boolean hasPropertyValue(RDFProperty property)
          Checks whether this has any (direct) property value.
 boolean hasPropertyValue(RDFProperty property, boolean includingSubproperties)
          Checks whether this has any property value.
 boolean hasPropertyValue(RDFProperty property, Object value)
          Checks whether this has a certain (direct) property value.
 boolean hasPropertyValue(RDFProperty property, Object value, boolean includingSuperproperties)
          Checks whether this has a certain property value.
 boolean hasProtegeType(RDFSClass type)
          Checks whether this resource has a given type.
 boolean hasProtegeType(RDFSClass type, boolean includingSuperclasses)
           
 boolean hasRDFType(RDFSClass type)
          Checks whether this resource has a given rdf:type.
 boolean hasRDFType(RDFSClass type, boolean includingSuperclasses)
           
 boolean isAnonymous()
          Checks whether this represents an anonymous resource / bnode.
 boolean isValidPropertyValue(RDFProperty property, Object object)
          A convenience method to access the corresponding method in OWLModel.
 Iterator listPropertyValues(RDFProperty property)
          Gets all direct values of a certain property as an Iterator.
 Iterator listPropertyValues(RDFProperty property, boolean includingSubproperties)
          Gets all values of a certain property as an Iterator.
 Iterator listPropertyValuesAs(RDFProperty property, Class javaInterface)
           
 Iterator listRDFTypes()
          Gets an Iterator on the rdf:types of this.
 void removeComment(String value)
          Removes an rdfs:comment from this resource.
 void removeDifferentFrom(RDFResource resource)
           
 void removeIsDefinedBy(RDFResource resource)
           
 void removeLabel(String label, String language)
          Removes a label that has been previously added.
 void removePropertyValue(RDFProperty property, Object value)
           
 void removePropertyValueListener(PropertyValueListener listener)
           
 void removeProtegeType(RDFSClass type)
          Removes a type from this resource.
 void removeRDFType(RDFSClass type)
          Removes an rdf:type from this resource.
 void removeResourceListener(ResourceListener listener)
           
 void removeSameAs(RDFResource resource)
           
 void removeVersionInfo(String versionInfo)
           
 void setComment(String comment)
           
 void setComments(Collection comments)
           
 void setDocumentation(String value)
           
 void setInferredTypes(Collection types)
           
 void setPropertyValue(RDFProperty property, Object value)
           
 void setPropertyValues(RDFProperty property, Collection values)
           
 void setProtegeType(RDFSClass type)
           
 void setProtegeTypes(Collection types)
           
 void setRDFType(RDFSClass type)
           
 void setRDFTypes(Collection types)
           
 String toString()
           
 
Methods inherited from class edu.stanford.smi.protege.model.DefaultSimpleInstance
rename
 
Methods inherited from class edu.stanford.smi.protege.model.DefaultInstance
addDirectType, addInstanceListener, copy, deepCopy, getBrowserText, getDirectType, getDirectTypes, getOwnFacetValue, getOwnFacetValues, getReachableSimpleInstances, hasDirectType, hasType, moveDirectType, removeDirectType, removeInstanceListener, setDirectType, setDirectTypes, shallowCopy
 
Methods inherited from class edu.stanford.smi.protege.model.DefaultFrame
addFrameListener, addOwnFacetValue, addOwnSlotValue, areValidOwnSlotValues, assertFrameName, compareTo, delete, equals, equals, getDefaultKnowledgeBase, getDefiningProjectURI, getDirectOwnSlotValue, getDirectOwnSlotValues, getFrameID, getInvalidOwnSlotValuesText, getInvalidOwnSlotValueText, getKnowledgeBase, getName, getOwnSlotAllowsMultipleValues, getOwnSlotAndSubslotValues, getOwnSlotDefaultValues, getOwnSlotFacets, getOwnSlotFacetValues, getOwnSlots, getOwnSlotValue, getOwnSlotValueCount, getOwnSlotValues, getOwnSlotValueType, getProject, getReferences, getReferences, hashCode, hasOwnSlot, isBeingDeleted, isDeleted, isEditable, isIncluded, isSystem, isValid, isValidOwnSlotValue, isVisible, localize, markDeleted, markDeleting, moveDirectOwnSlotValue, removeFrameListener, removeOwnSlotValue, setDirectOwnSlotValue, setDirectOwnSlotValues, setDocumentation, setEditable, setIncluded, setOwnFacetValue, setOwnFacetValues, setOwnSlotValue, setOwnSlotValues, setSystem, setVisible
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFResource
delete, getBrowserText, getName, isVisible, setVisible
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.ProtegeInstance
addDirectType, addFrameListener, addInstanceListener, addOwnFacetValue, addOwnSlotValue, areValidOwnSlotValues, copy, deepCopy, getDirectOwnSlotValue, getDirectOwnSlotValues, getDirectType, getDirectTypes, getInvalidOwnSlotValuesText, getInvalidOwnSlotValueText, getKnowledgeBase, getOwnFacetValue, getOwnFacetValues, getOwnSlotAllowsMultipleValues, getOwnSlotAndSubslotValues, getOwnSlotDefaultValues, getOwnSlotFacets, getOwnSlotFacetValues, getOwnSlots, getOwnSlotValue, getOwnSlotValueCount, getOwnSlotValues, getOwnSlotValueType, getProject, getReachableSimpleInstances, getReferences, getReferences, hasDirectType, hasOwnSlot, hasType, isBeingDeleted, isDeleted, isEditable, isIncluded, isSystem, isValidOwnSlotValue, markDeleted, markDeleting, removeDirectType, removeFrameListener, removeInstanceListener, removeOwnSlotValue, setDirectOwnSlotValue, setDirectOwnSlotValues, setDirectType, setDirectTypes, setDocumentation, setEditable, setIncluded, setOwnFacetValue, setOwnFacetValues, setOwnSlotValue, setOwnSlotValues, shallowCopy
 
Methods inherited from interface edu.stanford.smi.protege.model.Instance
moveDirectType
 
Methods inherited from interface edu.stanford.smi.protege.model.Frame
assertFrameName, getFrameID, isValid, moveDirectOwnSlotValue, rename
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

DefaultRDFIndividual

public DefaultRDFIndividual(edu.stanford.smi.protege.model.KnowledgeBase kb,
                            edu.stanford.smi.protege.model.FrameID id)

DefaultRDFIndividual

public DefaultRDFIndividual()
Method Detail

accept

public void accept(OWLModelVisitor visitor)
Description copied from interface: Visitable
This method is provided to be used with the OWLModelVisitor, which is part of the visitor design pattern. By implementing this method, instances of the implementing class are stating that they can accept an OWLModelVisitor

Specified by:
accept in interface Visitable
Parameters:
visitor - The visitor that will operate on this object.

getIcon

public Icon getIcon()
Specified by:
getIcon in interface edu.stanford.smi.protege.model.Frame
Specified by:
getIcon in interface ProtegeInstance
Overrides:
getIcon in class edu.stanford.smi.protege.model.DefaultSimpleInstance
See Also:
ProtegeUI.getIcon(edu.stanford.smi.protegex.owl.model.RDFResource)

getIconName

public String getIconName()
Description copied from interface: RDFResource
Gets the local name of an icon for this type of resource. This method is used in conjunction with getIconLocation().

Specified by:
getIconName in interface RDFResource
Returns:
an icon name (without suffix, e.g. "RDFIndividual" for RDFIndividual.gif)
See Also:
RDFResource.getIconLocation()

addComment

public void addComment(String comment)
Description copied from interface: RDFResource
Adds an rdfs:comment to this resource.

Specified by:
addComment in interface RDFResource
Parameters:
comment - the comment to add
See Also:
RDFResource.getComments(), RDFResource.removeComment(java.lang.String)

addDifferentFrom

public void addDifferentFrom(RDFResource resource)
Description copied from interface: RDFResource
Adds an owl:differentFrom to this resource.

Specified by:
addDifferentFrom in interface RDFResource
Parameters:
resource - the resource to add
See Also:
RDFResource.getDifferentFrom(), RDFResource.removeDifferentFrom(edu.stanford.smi.protegex.owl.model.RDFResource)

addIsDefinedBy

public void addIsDefinedBy(RDFResource instance)
Description copied from interface: RDFResource
Adds an rdfs:isDefinedBy to this resource.

Specified by:
addIsDefinedBy in interface RDFResource
Parameters:
instance - the resource to add
See Also:
RDFResource.getIsDefinedBy(), RDFResource.removeIsDefinedBy(edu.stanford.smi.protegex.owl.model.RDFResource)

addLabel

public void addLabel(String label,
                     String language)
Description copied from interface: RDFResource
Adds a label to this.

Specified by:
addLabel in interface RDFResource
Parameters:
label - the text of the label to add
language - the language, or null for no language

addPropertyValue

public void addPropertyValue(RDFProperty property,
                             Object value)
Description copied from interface: RDFResource
Adds a value for a given property to this resource. The property should have the type of this resource in its domain.

Specified by:
addPropertyValue in interface RDFResource
Parameters:
property - the property to add a value for
value - the value to add (may be an RDFSLiteral, a primitive value or another Resource)
See Also:
RDFResource.getPropertyValue(edu.stanford.smi.protegex.owl.model.RDFProperty), RDFResource.getPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty), RDFResource.listPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty), RDFResource.removePropertyValue(edu.stanford.smi.protegex.owl.model.RDFProperty, java.lang.Object)

addPropertyValueListener

public void addPropertyValueListener(PropertyValueListener listener)
Description copied from interface: RDFResource
Adds a PropertyValueListener to receive events when property values have changed.

Specified by:
addPropertyValueListener in interface RDFResource
Parameters:
listener - the listener to add
See Also:
RDFResource.removePropertyValueListener(edu.stanford.smi.protegex.owl.model.event.PropertyValueListener)

addProtegeType

public void addProtegeType(RDFSClass type)
Description copied from interface: RDFResource
Adds an type to this resource.

Specified by:
addProtegeType in interface RDFResource
Parameters:
type - the type to add
See Also:
RDFResource.getProtegeTypes(), RDFResource.removeProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass)

addRDFType

public void addRDFType(RDFSClass type)
Description copied from interface: RDFResource
Adds an rdf:type to this resource.

Specified by:
addRDFType in interface RDFResource
Parameters:
type - the rdf:type to add
See Also:
RDFResource.getProtegeTypes(), RDFResource.removeProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass)

addResourceListener

public void addResourceListener(ResourceListener listener)
Description copied from interface: RDFResource
Adds a ResourceListener to receive events when the type of this has changed.

Specified by:
addResourceListener in interface RDFResource
Parameters:
listener - the listener to add
See Also:
RDFResource.removeResourceListener(edu.stanford.smi.protegex.owl.model.event.ResourceListener)

addSameAs

public void addSameAs(RDFResource resource)
Description copied from interface: RDFResource
Adds an owl:sameAs to this resource.

Specified by:
addSameAs in interface RDFResource
Parameters:
resource - the resource to add
See Also:
RDFResource.getSameAs(), RDFResource.removeSameAs(edu.stanford.smi.protegex.owl.model.RDFResource)

addVersionInfo

public void addVersionInfo(String versionInfo)
Description copied from interface: RDFResource
Adds an owl:versionInfo to this resource.

Specified by:
addVersionInfo in interface RDFResource
Parameters:
versionInfo - the version info to add
See Also:
RDFResource.getVersionInfo(), RDFResource.removeVersionInfo(java.lang.String)

as

public RDFResource as(Class javaInterface)
Description copied from interface: RDFResource
Converts this dynamically into an instance of a given Java interface. The interface must inherit from RDFResource and must be accompanied by a public class DefaultXY in the impl subpackage below the interface's package. Note: Work in Progress!

Specified by:
as in interface RDFResource
Parameters:
javaInterface - the Java interface to convert to
Returns:
an instance of the Java interface

canAs

public boolean canAs(Class javaInterface)
Description copied from interface: RDFResource
Checks whether this can be dynamically morphed into an instance of a given Java interface. The interface must inherit from RDFResource and must be accompanied by an implementation in the subpackage "impl" below the interface package. Note: Work in Progress!

Specified by:
canAs in interface RDFResource
Parameters:
javaInterface - the Java interface to test
Returns:
true if this can be morphed into the given Java class

equalsStructurally

public boolean equalsStructurally(RDFObject object)
Description copied from interface: RDFObject
Determines whether or not the specified class is structurally equal to this class. Note that this does not test for structural equivalence using structural subsumption tests.

Specified by:
equalsStructurally in interface RDFObject
Parameters:
object - The class to test against.
Returns:
true if the class is structurally equal to this, false if the class is not structurally equal to this.

getAllValuesFromOnTypes

public RDFResource getAllValuesFromOnTypes(RDFProperty property)
Description copied from interface: RDFResource
Checks for rdfs:range or owl:allValuesFrom restrictions on the types of this resource. This method can be used to check the "valid" value types for a given property. The implementation will check all rdf:types of this.

Specified by:
getAllValuesFromOnTypes in interface RDFResource
Parameters:
property - the property to check for restrictions
Returns:
the range or null if no restriction was found

getComments

public Collection getComments()
Description copied from interface: RDFResource
Gets all rdfs:comments for this resource.

Specified by:
getComments in interface RDFResource
Returns:
a Collection of Strings or RDFSLiterals
See Also:
RDFResource.addComment(java.lang.String), RDFResource.removeComment(java.lang.String)

getDifferentFrom

public Collection getDifferentFrom()
Description copied from interface: RDFResource
Gets all owl:differentFroms for this resource.

Specified by:
getDifferentFrom in interface RDFResource
Returns:
a Collection of RDFResources
See Also:
RDFResource.addDifferentFrom(edu.stanford.smi.protegex.owl.model.RDFResource), RDFResource.removeDifferentFrom(edu.stanford.smi.protegex.owl.model.RDFResource)

getHasValuesOnTypes

public Collection getHasValuesOnTypes(RDFProperty property)
Description copied from interface: RDFResource
Checks if there are any owl:hasValue restrictions defined on any rdf:type of this and returns the fillers of the restrictions (if found).

Specified by:
getHasValuesOnTypes in interface RDFResource
Parameters:
property - the property to look for restrictions
Returns:
the fillers of all owl:hasValue restriction defined on the types of this

getIconLocation

public Class getIconLocation()
Description copied from interface: RDFResource
Gets a class that serves as a location of the icon resource. This method is used in conjunction with getIconName().

Specified by:
getIconLocation in interface RDFResource
Returns:
the icon location class (e.g., OWLIcons.class)
See Also:
RDFResource.getIconName()

getProtegeType

public RDFSClass getProtegeType()
Description copied from interface: RDFResource
Gets the first asserted type of this resource. This is basically a convenience method for those cases where it is known in advance that the resource only has a single type. If the resource has multiple types, then the result of this method is undefined.

Specified by:
getProtegeType in interface RDFResource
Returns:
the first type of this
See Also:
RDFResource.getProtegeTypes()

getProtegeTypes

public Collection getProtegeTypes()
Description copied from interface: RDFResource
Gets the asserted types of this resource. Note that in the case of anonymous classes, this result is different from the sibling method getRDFTypes(): Anonymous classes are internally stored using some special Protege metaclasses (e.g. OWLNames.Cls.COMPLEMENT_CLASS instead of owl:Class).

Specified by:
getProtegeTypes in interface RDFResource
Returns:
the types of this
See Also:
RDFResource.getProtegeType()

getDocumentation

public Collection getDocumentation()
Specified by:
getDocumentation in interface edu.stanford.smi.protege.model.Frame
Specified by:
getDocumentation in interface ProtegeInstance
Overrides:
getDocumentation in class edu.stanford.smi.protege.model.DefaultFrame
See Also:
RDFResource.getComments()

getInferredTypes

public Collection getInferredTypes()
Description copied from interface: RDFResource
Gets the direct types that were inferred during the most recent execution of a reasoner.

Specified by:
getInferredTypes in interface RDFResource
Returns:
the collection of inferred direct types (RDFSClasses)

getIsDefinedBy

public Collection getIsDefinedBy()
Description copied from interface: RDFResource
Gets all rdfs:isDefinedBy for this resource.

Specified by:
getIsDefinedBy in interface RDFResource
Returns:
a Collection of RDFResources
See Also:
RDFResource.addIsDefinedBy(edu.stanford.smi.protegex.owl.model.RDFResource), RDFResource.removeIsDefinedBy(edu.stanford.smi.protegex.owl.model.RDFResource)

getLabels

public Collection getLabels()
Description copied from interface: RDFResource
Gets the rdfs:labels that are currenly defined for this.

Specified by:
getLabels in interface RDFResource
Returns:
a Collection of strings or RDFSLiterals

getLocalName

public String getLocalName()
Description copied from interface: RDFResource
Gets the local part of the full URI (name) of this resource. For example, for "owl:Class" this would return "Class".

Specified by:
getLocalName in interface RDFResource
Returns:
the part of the name after #

getPrefixedName

public String getPrefixedName()
Description copied from interface: RDFResource
Gets the qualified name as a namespace, local name pair (e.g. "owl:Class").

Specified by:
getPrefixedName in interface RDFResource
Returns:
the qualified name of the resource.

getNamespace

public String getNamespace()
Description copied from interface: RDFResource
Gets the namespace of this resource. This is the URI up to before the #

Specified by:
getNamespace in interface RDFResource
Returns:
the namespace

getNamespacePrefix

public String getNamespacePrefix()
Description copied from interface: RDFResource
Gets the prefix of the namespace, i.e. the abbreviated name of the namespace.

Specified by:
getNamespacePrefix in interface RDFResource
Returns:
the prefix, e.g. "owl" or "protege"

getOWLModel

public OWLModel getOWLModel()
Description copied from interface: RDFResource
Gets the OWLModel this resource is defined in. The OWLModel is the top-level container that allows programmers to create, delete and query all resources in the ontology.

Specified by:
getOWLModel in interface RDFResource
Returns:
the OWLModel

getPossibleRDFProperties

public Collection getPossibleRDFProperties()
Description copied from interface: RDFResource
Gets a Collection of all RDFProperties that this resource could take values for. This includes all properties with this in their domain, and their subproperties. The result of this method is a superset of getRDFProperties() which only returns those properties that also have a value at this resource.

Specified by:
getPossibleRDFProperties in interface RDFResource
Returns:
a Collection of RDFProperties
See Also:
RDFResource.getRDFProperties()

getPropertyValue

public Object getPropertyValue(RDFProperty property)
Description copied from interface: RDFResource
Gets all (direct) values of a given property. This is an abbreviation of getPropertyValue(property, true).

Specified by:
getPropertyValue in interface RDFResource
Parameters:
property - the property to get the values for
Returns:
the property values

getPropertyValueAs

public RDFResource getPropertyValueAs(RDFProperty property,
                                      Class javaInterface)
Specified by:
getPropertyValueAs in interface RDFResource

getPropertyValue

public Object getPropertyValue(RDFProperty property,
                               boolean includingSubproperties)
Description copied from interface: RDFResource
Gets all values of a given property, and optionally its subproperties.

Specified by:
getPropertyValue in interface RDFResource
Parameters:
property - the property to get the values for
includingSubproperties - true to also return the subproperty values
Returns:
the property values

getPropertyValueLiteral

public RDFSLiteral getPropertyValueLiteral(RDFProperty property)
Description copied from interface: RDFResource
Gets the first value of a given property as an RDFSLiteral. The caller must make sure that the property only has datatype values (e.g. if the property is an OWLDatatypeProperty).

Specified by:
getPropertyValueLiteral in interface RDFResource
Parameters:
property - the property to get the value from
Returns:
the property value as RDFSLiteral

getPropertyValueCount

public int getPropertyValueCount(RDFProperty property)
Description copied from interface: RDFResource
Gets the number of all (direct) values of a given property.

Specified by:
getPropertyValueCount in interface RDFResource
Parameters:
property - the property
Returns:
the number of direct values of property

getPropertyValueLiterals

public Collection getPropertyValueLiterals(RDFProperty property)
Description copied from interface: RDFResource
Gets all (direct) values of a given property at this as RDFSLiterals. This is often more convenient than calling getPropertyValues, which may return values as primitive values (without the wrapping in an RDFSLiteral). The caller must make sure that the property only holds datatype values prior to the call.

Specified by:
getPropertyValueLiterals in interface RDFResource
Parameters:
property - the property to get the values from
Returns:
the property values as RDFSLiterals

getPropertyValues

public Collection getPropertyValues(RDFProperty property)
Description copied from interface: RDFResource
Gets all (direct) values of a given property at this resource. This call is an abbreviation of getPropertyValues(property, false).

Specified by:
getPropertyValues in interface RDFResource
Parameters:
property - the property to get the values from
Returns:
the property values
See Also:
RDFResource.listPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty)

getPropertyValuesAs

public Collection getPropertyValuesAs(RDFProperty property,
                                      Class javaInterface)
Specified by:
getPropertyValuesAs in interface RDFResource

getPropertyValues

public Collection getPropertyValues(RDFProperty property,
                                    boolean includingSubproperties)
Description copied from interface: RDFResource
Gets all values of a given property, optionally including the values of the subproperties of the property.

Specified by:
getPropertyValues in interface RDFResource
Parameters:
property - the property to get the values from
includingSubproperties - true to also return the subproperty values
Returns:
the property values

getRDFProperties

public Collection getRDFProperties()
Description copied from interface: RDFResource
Gets all RDFProperties that have at least one value at this.

Specified by:
getRDFProperties in interface RDFResource
Returns:
a collection of RDFProperty objects

getRDFType

public RDFSClass getRDFType()
Description copied from interface: RDFResource
Gets the first asserted rdf:type of this resource. This is basically a convenience method for those cases where it is known in advance that the resource only has a single type. If the resource has multiple types, then the result of this method is undefined.

Specified by:
getRDFType in interface RDFResource
Returns:
the first type of this
See Also:
RDFResource.getRDFTypes()

getRDFTypes

public Collection getRDFTypes()
Description copied from interface: RDFResource
Gets the asserted rdf:types of this resource.

Specified by:
getRDFTypes in interface RDFResource
Returns:
the rdf:types of this
See Also:
RDFResource.getRDFType()

getReferringAnonymousClasses

public Set getReferringAnonymousClasses()
Description copied from interface: RDFResource
Gets a Collection of all OWLAnonymousClasses that have a reference to this. This includes
  • all OWLLogicalClasses that have this as Operand
  • all OWLRestrictions that have this as restricted property or filler
  • all OWLEnumeratedClasses that have this as owl:oneOf

Specified by:
getReferringAnonymousClasses in interface RDFResource
Returns:
Set of OWLAnonymousClasses

getSameAs

public Collection getSameAs()
Description copied from interface: RDFResource
Gets the values of the owl:sameAs property.

Specified by:
getSameAs in interface RDFResource
Returns:
a Collection of RDFResources

getURI

public String getURI()
Description copied from interface: RDFResource
Gets the full URI of this resource. This is typically of the form http://www.mydomain.org/myontology#Name

Specified by:
getURI in interface RDFResource
Returns:
the URI

getVersionInfo

public Collection getVersionInfo()
Description copied from interface: RDFResource
Gets the values of the owl:versionInfo property.

Specified by:
getVersionInfo in interface RDFResource
Returns:
the version info values

hasPropertyValue

public boolean hasPropertyValue(RDFProperty property)
Description copied from interface: RDFResource
Checks whether this has any (direct) property value.

Specified by:
hasPropertyValue in interface RDFResource
Parameters:
property - the property
Returns:
true if this has any values for property

hasPropertyValue

public boolean hasPropertyValue(RDFProperty property,
                                boolean includingSubproperties)
Description copied from interface: RDFResource
Checks whether this has any property value.

Specified by:
hasPropertyValue in interface RDFResource
Parameters:
property - the property
includingSubproperties - true to also include subproperties of property
Returns:
true if this has any values for property

hasPropertyValue

public boolean hasPropertyValue(RDFProperty property,
                                Object value)
Description copied from interface: RDFResource
Checks whether this has a certain (direct) property value.

Specified by:
hasPropertyValue in interface RDFResource
Parameters:
property - the property
value - the value (possibly an RDFSLiteral)
Returns:
true if one of the values of the property equals value

hasPropertyValue

public boolean hasPropertyValue(RDFProperty property,
                                Object value,
                                boolean includingSuperproperties)
Description copied from interface: RDFResource
Checks whether this has a certain property value. This is a shortcut for getPropertyValues(property).contains(value);.

Specified by:
hasPropertyValue in interface RDFResource
Parameters:
property - the property
value - the value (possibly an RDFSLiteral)
includingSuperproperties - true to also include subproperties of property
Returns:
true if one of the values of the property equals value

hasProtegeType

public boolean hasProtegeType(RDFSClass type)
Description copied from interface: RDFResource
Checks whether this resource has a given type. This is equivalent to hasProtegeType(type, false).

Specified by:
hasProtegeType in interface RDFResource
Parameters:
type - the type in question
Returns:
true if one of the rdf:types of this is type
See Also:
RDFResource.addProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass), RDFResource.getProtegeTypes(), RDFResource.removeProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass)

hasProtegeType

public boolean hasProtegeType(RDFSClass type,
                              boolean includingSuperclasses)
Specified by:
hasProtegeType in interface RDFResource

hasRDFType

public boolean hasRDFType(RDFSClass type)
Description copied from interface: RDFResource
Checks whether this resource has a given rdf:type. This is equivalent to hasProtegeType(type, false).

Specified by:
hasRDFType in interface RDFResource
Parameters:
type - the type in question
Returns:
true if one of the rdf:types of this is type
See Also:
RDFResource.addProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass), RDFResource.getProtegeTypes(), RDFResource.removeProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass)

hasRDFType

public boolean hasRDFType(RDFSClass type,
                          boolean includingSuperclasses)
Specified by:
hasRDFType in interface RDFResource

isAnonymous

public boolean isAnonymous()
Description copied from interface: RDFResource
Checks whether this represents an anonymous resource / bnode. In Protege-OWL, anonymous resources can be recognized by their name, using the method OWLModel.isAnonymousResourceName().

Specified by:
isAnonymous in interface RDFResource
Returns:
true if this is an anonymous resource
See Also:
OWLModel.isAnonymousResourceName(java.lang.String)

isValidPropertyValue

public boolean isValidPropertyValue(RDFProperty property,
                                    Object object)
Description copied from interface: RDFResource
A convenience method to access the corresponding method in OWLModel.

Specified by:
isValidPropertyValue in interface RDFResource
Parameters:
property - the property to check against
object - the potential property value
Returns:
true if object is a valid value for property
See Also:
OWLModel.isValidPropertyValue(edu.stanford.smi.protegex.owl.model.RDFResource, edu.stanford.smi.protegex.owl.model.RDFProperty, java.lang.Object)

listPropertyValues

public Iterator listPropertyValues(RDFProperty property)
Description copied from interface: RDFResource
Gets all direct values of a certain property as an Iterator.

Specified by:
listPropertyValues in interface RDFResource
Parameters:
property - the property to get the values from
Returns:
an Iterator on property values
See Also:
RDFResource.getPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty)

listPropertyValuesAs

public Iterator listPropertyValuesAs(RDFProperty property,
                                     Class javaInterface)
Specified by:
listPropertyValuesAs in interface RDFResource

listPropertyValues

public Iterator listPropertyValues(RDFProperty property,
                                   boolean includingSubproperties)
Description copied from interface: RDFResource
Gets all values of a certain property as an Iterator.

Specified by:
listPropertyValues in interface RDFResource
Parameters:
property - the property to get the values from
includingSubproperties - true to also return values of subproperties
Returns:
an Iterator on property values
See Also:
RDFResource.getPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty)

listRDFTypes

public Iterator listRDFTypes()
Description copied from interface: RDFResource
Gets an Iterator on the rdf:types of this.

Specified by:
listRDFTypes in interface RDFResource
Returns:
an Iterator of the types

removeComment

public void removeComment(String value)
Description copied from interface: RDFResource
Removes an rdfs:comment from this resource.

Specified by:
removeComment in interface RDFResource
Parameters:
value - the comment to remove
See Also:
RDFResource.addComment(java.lang.String), RDFResource.getComments()

removeDifferentFrom

public void removeDifferentFrom(RDFResource resource)
Specified by:
removeDifferentFrom in interface RDFResource

removeIsDefinedBy

public void removeIsDefinedBy(RDFResource resource)
Specified by:
removeIsDefinedBy in interface RDFResource

removeLabel

public void removeLabel(String label,
                        String language)
Description copied from interface: RDFResource
Removes a label that has been previously added.

Specified by:
removeLabel in interface RDFResource
Parameters:
label - the text of the label to remove
language - the language of the label or null

removePropertyValue

public void removePropertyValue(RDFProperty property,
                                Object value)
Specified by:
removePropertyValue in interface RDFResource

removePropertyValueListener

public void removePropertyValueListener(PropertyValueListener listener)
Specified by:
removePropertyValueListener in interface RDFResource

removeProtegeType

public void removeProtegeType(RDFSClass type)
Description copied from interface: RDFResource
Removes a type from this resource. Note that the resource must have at least one type at any time.

Specified by:
removeProtegeType in interface RDFResource
Parameters:
type - the type to remove
See Also:
RDFResource.addProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass), RDFResource.getProtegeTypes()

removeRDFType

public void removeRDFType(RDFSClass type)
Description copied from interface: RDFResource
Removes an rdf:type from this resource. Note that the resource must have at least one rdf:type at any time.

Specified by:
removeRDFType in interface RDFResource
Parameters:
type - the type to remove
See Also:
RDFResource.addRDFType(edu.stanford.smi.protegex.owl.model.RDFSClass), RDFResource.getRDFTypes()

removeResourceListener

public void removeResourceListener(ResourceListener listener)
Specified by:
removeResourceListener in interface RDFResource

removeSameAs

public void removeSameAs(RDFResource resource)
Specified by:
removeSameAs in interface RDFResource

removeVersionInfo

public void removeVersionInfo(String versionInfo)
Specified by:
removeVersionInfo in interface RDFResource

setComment

public void setComment(String comment)
Specified by:
setComment in interface RDFResource

setComments

public void setComments(Collection comments)
Specified by:
setComments in interface RDFResource

setDocumentation

public void setDocumentation(String value)
Specified by:
setDocumentation in interface edu.stanford.smi.protege.model.Frame
Specified by:
setDocumentation in interface ProtegeInstance
Overrides:
setDocumentation in class edu.stanford.smi.protege.model.DefaultFrame
See Also:
RDFResource.setComment(java.lang.String)

setInferredTypes

public void setInferredTypes(Collection types)
Specified by:
setInferredTypes in interface RDFResource

setPropertyValue

public void setPropertyValue(RDFProperty property,
                             Object value)
Specified by:
setPropertyValue in interface RDFResource

setPropertyValues

public void setPropertyValues(RDFProperty property,
                              Collection values)
Specified by:
setPropertyValues in interface RDFResource

setProtegeType

public void setProtegeType(RDFSClass type)
Specified by:
setProtegeType in interface RDFResource

setProtegeTypes

public void setProtegeTypes(Collection types)
Specified by:
setProtegeTypes in interface RDFResource

setRDFType

public void setRDFType(RDFSClass type)
Specified by:
setRDFType in interface RDFResource

setRDFTypes

public void setRDFTypes(Collection types)
Specified by:
setRDFTypes in interface RDFResource

toString

public String toString()
Overrides:
toString in class edu.stanford.smi.protege.model.DefaultSimpleInstance

Protégé-OWL 3.4.8

Submit a bug report or feature request
Copyright (c) 1998-2012 Stanford University.