edu.stanford.smi.protegex.owl.model
Interface RDFResource

All Superinterfaces:
Comparable, edu.stanford.smi.protege.model.Frame, edu.stanford.smi.protege.model.Instance, ProtegeInstance, RDFObject, Visitable
All Known Subinterfaces:
OWLAllDifferent, OWLAllValuesFrom, OWLAnonymousClass, OWLCardinality, OWLCardinalityBase, OWLClass, OWLComplementClass, OWLDataRange, OWLDatatypeProperty, OWLEnumeratedClass, OWLExistentialRestriction, OWLHasValue, OWLIndividual, OWLIntersectionClass, OWLLogicalClass, OWLMaxCardinality, OWLMinCardinality, OWLNamedClass, OWLNAryLogicalClass, OWLObjectProperty, OWLOntology, OWLProperty, OWLQuantifierRestriction, OWLRestriction, OWLSomeValuesFrom, OWLUnionClass, RDFIndividual, RDFList, RDFProperty, RDFSClass, RDFSDatatype, RDFSNamedClass, RDFUntypedResource, SWRLAtom, SWRLAtomList, SWRLBuiltin, SWRLBuiltinAtom, SWRLClassAtom, SWRLDataRangeAtom, SWRLDatavaluedPropertyAtom, SWRLDifferentIndividualsAtom, SWRLImp, SWRLIndividual, SWRLIndividualPropertyAtom, SWRLIndividualsAtom, SWRLSameIndividualAtom, SWRLVariable, TestPerson
All Known Implementing Classes:
AbstractOWLAnonymousClass, AbstractOWLCardinalityBase, AbstractOWLLogicalClass, AbstractOWLNAryLogicalClass, AbstractOWLProperty, AbstractOWLQuantifierRestriction, AbstractOWLRestriction, AbstractRDFSClass, AbstractSWRLIndividualsAtom, DefaultOWLAllDifferent, DefaultOWLAllValuesFrom, DefaultOWLCardinality, DefaultOWLComplementClass, DefaultOWLDataRange, DefaultOWLDatatypeProperty, DefaultOWLEnumeratedClass, DefaultOWLHasValue, DefaultOWLIndividual, DefaultOWLIntersectionClass, DefaultOWLMaxCardinality, DefaultOWLMinCardinality, DefaultOWLNamedClass, DefaultOWLObjectProperty, DefaultOWLOntology, DefaultOWLSomeValuesFrom, DefaultOWLUnionClass, DefaultRDFIndividual, DefaultRDFList, DefaultRDFProperty, DefaultRDFSDatatype, DefaultRDFSNamedClass, DefaultRDFUntypedResource, DefaultSWRLAtom, DefaultSWRLAtomList, DefaultSWRLBuiltin, DefaultSWRLBuiltinAtom, DefaultSWRLClassAtom, DefaultSWRLDataRangeAtom, DefaultSWRLDatavaluedPropertyAtom, DefaultSWRLDifferentIndividualsAtom, DefaultSWRLImp, DefaultSWRLIndividualPropertyAtom, DefaultSWRLSameIndividualAtom, DefaultSWRLVariable, DefaultTestPerson

public interface RDFResource
extends ProtegeInstance, RDFObject, Visitable

The base interface for various OWL classes, slots and instances.

Author:
Holger Knublauch

Method Summary
 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 resource)
          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.
 void delete()
          Deletes this resource from the model.
 RDFResource getAllValuesFromOnTypes(RDFProperty property)
          Checks for rdfs:range or owl:allValuesFrom restrictions on the types of this resource.
 String getBrowserText()
          Gets a human-readable visual representation of this resource.
 Collection getComments()
          Gets all rdfs:comments for this resource.
 Collection getDifferentFrom()
          Gets all owl:differentFroms for this resource.
 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).
 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 getName()
          Gets the Protege name of this resource.
 String getNamespace()
          Gets the namespace of this resource.
 String getNamespacePrefix()
          Gets the prefix of the namespace, i.e. the abbreviated name of the namespace.
 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.
 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 includingSubproperties)
          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.
 boolean isVisible()
          Checks whether this resource has been declared to be invisible in the user interface.
 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 setInferredTypes(Collection types)
           
 void setName(String newName)
          Sets the Protege name of this resource.
 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)
           
 void setVisible(boolean b)
          Sets this resource visible or invisible.
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.ProtegeInstance
addDirectType, addFrameListener, addInstanceListener, addOwnFacetValue, addOwnSlotValue, areValidOwnSlotValues, copy, deepCopy, getDirectOwnSlotValue, getDirectOwnSlotValues, getDirectType, getDirectTypes, getDocumentation, getFrameID, getIcon, 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, 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
isValid, moveDirectOwnSlotValue
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.RDFObject
equalsStructurally
 
Methods inherited from interface edu.stanford.smi.protegex.owl.model.visitor.Visitable
accept
 

Method Detail

addComment

public void addComment(String comment)
Adds an rdfs:comment to this resource.

Parameters:
comment - the comment to add
See Also:
getComments(), removeComment(java.lang.String)

addDifferentFrom

public void addDifferentFrom(RDFResource resource)
Adds an owl:differentFrom to this resource.

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

addIsDefinedBy

public void addIsDefinedBy(RDFResource resource)
Adds an rdfs:isDefinedBy to this resource.

Parameters:
resource - the resource to add
See Also:
getIsDefinedBy(), removeIsDefinedBy(edu.stanford.smi.protegex.owl.model.RDFResource)

addLabel

public void addLabel(String label,
                     String language)
Adds a label to this.

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)
Adds a value for a given property to this resource. The property should have the type of this resource in its domain.

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:
getPropertyValue(edu.stanford.smi.protegex.owl.model.RDFProperty), getPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty), listPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty), removePropertyValue(edu.stanford.smi.protegex.owl.model.RDFProperty, java.lang.Object)

addPropertyValueListener

public void addPropertyValueListener(PropertyValueListener listener)
Adds a PropertyValueListener to receive events when property values have changed.

Parameters:
listener - the listener to add
See Also:
removePropertyValueListener(edu.stanford.smi.protegex.owl.model.event.PropertyValueListener)

addProtegeType

public void addProtegeType(RDFSClass type)
Adds an type to this resource.

Parameters:
type - the type to add
See Also:
getProtegeTypes(), removeProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass)

addRDFType

public void addRDFType(RDFSClass type)
Adds an rdf:type to this resource.

Parameters:
type - the rdf:type to add
See Also:
getProtegeTypes(), removeProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass)

addResourceListener

public void addResourceListener(ResourceListener listener)
Adds a ResourceListener to receive events when the type of this has changed.

Parameters:
listener - the listener to add
See Also:
removeResourceListener(edu.stanford.smi.protegex.owl.model.event.ResourceListener)

addSameAs

public void addSameAs(RDFResource resource)
Adds an owl:sameAs to this resource.

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

addVersionInfo

public void addVersionInfo(String versionInfo)
Adds an owl:versionInfo to this resource.

Parameters:
versionInfo - the version info to add
See Also:
getVersionInfo(), removeVersionInfo(java.lang.String)

as

public RDFResource as(Class javaInterface)
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!

Parameters:
javaInterface - the Java interface to convert to
Returns:
an instance of the Java interface

canAs

public boolean canAs(Class javaInterface)
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!

Parameters:
javaInterface - the Java interface to test
Returns:
true if this can be morphed into the given Java class

delete

public void delete()
Deletes this resource from the model. This will first remove all references of the resource to other resources and then destroy the object.

Specified by:
delete in interface edu.stanford.smi.protege.model.Frame

getAllValuesFromOnTypes

public RDFResource getAllValuesFromOnTypes(RDFProperty property)
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.

Parameters:
property - the property to check for restrictions
Returns:
the range or null if no restriction was found

getBrowserText

public String getBrowserText()
Gets a human-readable visual representation of this resource. This is typically just the name of the resource, but for example, with anonymous class expressions this will return the full expression including special symbols.

Specified by:
getBrowserText in interface ProtegeInstance
Returns:
the browser text

getComments

public Collection getComments()
Gets all rdfs:comments for this resource.

Returns:
a Collection of Strings or RDFSLiterals
See Also:
addComment(java.lang.String), removeComment(java.lang.String)

getDifferentFrom

public Collection getDifferentFrom()
Gets all owl:differentFroms for this resource.

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

getHasValuesOnTypes

public 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).

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()
Gets a class that serves as a location of the icon resource. This method is used in conjunction with getIconName().

Returns:
the icon location class (e.g., OWLIcons.class)
See Also:
getIconName()

getIconName

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

Returns:
an icon name (without suffix, e.g. "RDFIndividual" for RDFIndividual.gif)
See Also:
getIconLocation()

getInferredTypes

public Collection getInferredTypes()
Gets the direct types that were inferred during the most recent execution of a reasoner.

Returns:
the collection of inferred direct types (RDFSClasses)

getIsDefinedBy

public Collection getIsDefinedBy()
Gets all rdfs:isDefinedBy for this resource.

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

getLabels

public Collection getLabels()
Gets the rdfs:labels that are currenly defined for this.

Returns:
a Collection of strings or RDFSLiterals

getLocalName

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

Returns:
the part of the name after #

getName

public String getName()
Gets the Protege name of this resource. The name consists of a local name and an optional prefix, separated with ":". The Protege system uses names as primary access mechanism for resources and has some optimizations for searching and handling resources by name.

Specified by:
getName in interface edu.stanford.smi.protege.model.Frame
Returns:
the name

getNamespace

public String getNamespace()
Gets the namespace of this resource. This is the URI up to before the #

Returns:
the namespace

getNamespacePrefix

public String getNamespacePrefix()
Gets the prefix of the namespace, i.e. the abbreviated name of the namespace.

Returns:
the prefix, e.g. "owl" or "protege"

getOWLModel

public OWLModel getOWLModel()
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.

Returns:
the OWLModel

getPossibleRDFProperties

public Collection getPossibleRDFProperties()
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.

Returns:
a Collection of RDFProperties
See Also:
getRDFProperties()

getPropertyValue

public Object getPropertyValue(RDFProperty property)
Gets all (direct) values of a given property. This is an abbreviation of getPropertyValue(property, true).

Parameters:
property - the property to get the values for
Returns:
the property values

getPropertyValueAs

public RDFResource getPropertyValueAs(RDFProperty property,
                                      Class javaInterface)

getPropertyValueLiteral

public RDFSLiteral getPropertyValueLiteral(RDFProperty property)
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).

Parameters:
property - the property to get the value from
Returns:
the property value as RDFSLiteral

getPropertyValue

public Object getPropertyValue(RDFProperty property,
                               boolean includingSubproperties)
Gets all values of a given property, and optionally its subproperties.

Parameters:
property - the property to get the values for
includingSubproperties - true to also return the subproperty values
Returns:
the property values

getPropertyValueCount

public int getPropertyValueCount(RDFProperty property)
Gets the number of all (direct) values of a given property.

Parameters:
property - the property
Returns:
the number of direct values of property

getPropertyValues

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

Parameters:
property - the property to get the values from
Returns:
the property values
See Also:
listPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty)

getPropertyValuesAs

public Collection getPropertyValuesAs(RDFProperty property,
                                      Class javaInterface)

getPropertyValueLiterals

public Collection getPropertyValueLiterals(RDFProperty property)
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.

Parameters:
property - the property to get the values from
Returns:
the property values as RDFSLiterals

getPropertyValues

public Collection getPropertyValues(RDFProperty property,
                                    boolean includingSubproperties)
Gets all values of a given property, optionally including the values of the subproperties of the property.

Parameters:
property - the property to get the values from
includingSubproperties - true to also return the subproperty values
Returns:
the property values

getProtegeType

public RDFSClass getProtegeType()
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.

Returns:
the first type of this
See Also:
getProtegeTypes()

getProtegeTypes

public Collection getProtegeTypes()
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).

Returns:
the types of this
See Also:
getProtegeType()

getRDFProperties

public Collection getRDFProperties()
Gets all RDFProperties that have at least one value at this.

Returns:
a collection of RDFProperty objects

getRDFType

public RDFSClass getRDFType()
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.

Returns:
the first type of this
See Also:
getRDFTypes()

getRDFTypes

public Collection getRDFTypes()
Gets the asserted rdf:types of this resource.

Returns:
the rdf:types of this
See Also:
getRDFType()

getReferringAnonymousClasses

public Set getReferringAnonymousClasses()
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

Returns:
Set of OWLAnonymousClasses

getSameAs

public Collection getSameAs()
Gets the values of the owl:sameAs property.

Returns:
a Collection of RDFResources

getURI

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

Returns:
the URI

getVersionInfo

public Collection getVersionInfo()
Gets the values of the owl:versionInfo property.

Returns:
the version info values

hasPropertyValue

public boolean hasPropertyValue(RDFProperty property)
Checks whether this has any (direct) property value.

Parameters:
property - the property
Returns:
true if this has any values for property

hasPropertyValue

public boolean hasPropertyValue(RDFProperty property,
                                boolean includingSubproperties)
Checks whether this has any property value.

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)
Checks whether this has a certain (direct) property value.

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 includingSubproperties)
Checks whether this has a certain property value. This is a shortcut for getPropertyValues(property).contains(value);.

Parameters:
property - the property
value - the value (possibly an RDFSLiteral)
includingSubproperties - 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)
Checks whether this resource has a given type. This is equivalent to hasProtegeType(type, false).

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

hasProtegeType

public boolean hasProtegeType(RDFSClass type,
                              boolean includingSuperclasses)

hasRDFType

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

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

hasRDFType

public boolean hasRDFType(RDFSClass type,
                          boolean includingSuperclasses)

isAnonymous

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

Returns:
true if this is an anonymous resource
See Also:
OWLModel.isAnonymousResourceName(java.lang.String)

isValidPropertyValue

public boolean isValidPropertyValue(RDFProperty property,
                                    Object object)
A convenience method to access the corresponding method in OWLModel.

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)

isVisible

public boolean isVisible()
Checks whether this resource has been declared to be invisible in the user interface.

Specified by:
isVisible in interface edu.stanford.smi.protege.model.Frame
Returns:
true if this is visible (default)
See Also:
setVisible(boolean)

listPropertyValues

public Iterator listPropertyValues(RDFProperty property)
Gets all direct values of a certain property as an Iterator.

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

listPropertyValuesAs

public Iterator listPropertyValuesAs(RDFProperty property,
                                     Class javaInterface)

listPropertyValues

public Iterator listPropertyValues(RDFProperty property,
                                   boolean includingSubproperties)
Gets all values of a certain property as an Iterator.

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:
getPropertyValues(edu.stanford.smi.protegex.owl.model.RDFProperty)

listRDFTypes

public Iterator listRDFTypes()
Gets an Iterator on the rdf:types of this.

Returns:
an Iterator of the types

removeComment

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

Parameters:
value - the comment to remove
See Also:
addComment(java.lang.String), getComments()

removeDifferentFrom

public void removeDifferentFrom(RDFResource resource)

removeIsDefinedBy

public void removeIsDefinedBy(RDFResource resource)

removeLabel

public void removeLabel(String label,
                        String language)
Removes a label that has been previously added.

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)

removePropertyValueListener

public void removePropertyValueListener(PropertyValueListener listener)

removeProtegeType

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

Parameters:
type - the type to remove
See Also:
addProtegeType(edu.stanford.smi.protegex.owl.model.RDFSClass), getProtegeTypes()

removeRDFType

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

Parameters:
type - the type to remove
See Also:
addRDFType(edu.stanford.smi.protegex.owl.model.RDFSClass), getRDFTypes()

removeResourceListener

public void removeResourceListener(ResourceListener listener)

removeSameAs

public void removeSameAs(RDFResource resource)

removeVersionInfo

public void removeVersionInfo(String versionInfo)

setComment

public void setComment(String comment)

setComments

public void setComments(Collection comments)

setInferredTypes

public void setInferredTypes(Collection types)

setName

public void setName(String newName)
Sets the Protege name of this resource. The new name must be valid, i.e. be well-formed and only refer to valid namespace prefixes. The new name must also be unique.

Specified by:
setName in interface edu.stanford.smi.protege.model.Frame
Parameters:
newName - the name name of this
See Also:
getName()

setPropertyValue

public void setPropertyValue(RDFProperty property,
                             Object value)

setPropertyValues

public void setPropertyValues(RDFProperty property,
                              Collection values)

setProtegeType

public void setProtegeType(RDFSClass type)

setProtegeTypes

public void setProtegeTypes(Collection types)

setRDFType

public void setRDFType(RDFSClass type)

setRDFTypes

public void setRDFTypes(Collection types)

setVisible

public void setVisible(boolean b)
Sets this resource visible or invisible.

Specified by:
setVisible in interface edu.stanford.smi.protege.model.Frame
Parameters:
b - true to make this visible
See Also:
isVisible()