Protege 3.4.5

edu.stanford.smi.protege.model
Interface Frame

All Superinterfaces:
Comparable<Frame>
All Known Subinterfaces:
Cls, Facet, Instance, SimpleInstance, Slot
All Known Implementing Classes:
DefaultCls, DefaultFacet, DefaultFrame, DefaultInstance, DefaultSimpleInstance, DefaultSlot

public interface Frame
extends Comparable<Frame>

A container for slot and facet values. This definition of a Frame is roughly consistent with the OKBC notion. OKBC introduces a notion of a slot being attached to a frame as either an "own-slot" or as a "template-slot". A "template-slot" is a slot on a class which is automatically attached to subclasses and is automatically attached at all instances of the class. An "own-slot" is a slot on any frame (either a class or not) which is not automatically attached to subclasses and is not automatically attached to instances of the frame. Note that the difference between these two things is only relavent for class frames and we only support template slots on class frames. OKBC ascribes no meaning to template slots on non-classes. Own-slot values, even on a class, are not inherited to subclasses and do not occur on instances of the class. If a template slot has a value, this value is necessarily inherited to subclasses and appears on instances of the class. get/set slot and facet value methods return/take a collection of objects. The type of object returned or required depends on the value-type of the slot. The mapping between Protege value-types and Java object type is given below:

 
  Boolean    --> java.lang.Boolean
  Class      --> edu.stanford.smi.protege.model.Cls
  Float      --> java.lang.Float
  Instance   --> edu.stanford.smi.protege.model.Instance
  Integer    --> java.lang.Integer
  Symbol     --> java.lang.String
  String     --> java.lang.String
  
 

Author:
Ray Fergerson

Method Summary
 void addFrameListener(FrameListener listener)
           
 boolean addOwnFacetValue(Slot slot, Facet facet, Object value)
           
 void addOwnSlotValue(Slot slot, Object value)
           
 boolean areValidOwnSlotValues(Slot slot, Collection values)
           
 void assertFrameName()
          This call ensures that the name slot for the frame has the frame name as its value.
 Frame copy(KnowledgeBase kb, Map valueMap, boolean isDeep)
           
 Frame deepCopy(KnowledgeBase kb, Map valueMap)
          Create a "deep copy" of the frame.
 void delete()
           
 String getBrowserText()
           
 Object getDirectOwnSlotValue(Slot slot)
          see Frame for a description of the return type
 List getDirectOwnSlotValues(Slot slot)
          See Frame for a description of the return type.
 Collection getDocumentation()
           
 FrameID getFrameID()
           
 Icon getIcon()
           
 String getInvalidOwnSlotValuesText(Slot slot, Collection values)
           
 String getInvalidOwnSlotValueText(Slot slot, Object value)
           
 KnowledgeBase getKnowledgeBase()
           
 String getName()
           
 Object getOwnFacetValue(Slot slot, Facet facet)
          see Framefor a description of the return type
 Collection getOwnFacetValues(Slot slot, Facet facet)
          see Framefor a description of the return type
 boolean getOwnSlotAllowsMultipleValues(Slot slot)
           
 Collection getOwnSlotAndSubslotValues(Slot slot)
          Returns the own slot values for this slot and all of its subslots.
 Collection getOwnSlotDefaultValues(Slot slot)
          see Framefor a description of the return type
 Collection getOwnSlotFacets(Slot slot)
           
 Collection getOwnSlotFacetValues(Slot slot, Facet facet)
           
 Collection<Slot> getOwnSlots()
          Gets the collection of own slots for a frame.
 Object getOwnSlotValue(Slot slot)
          see Frame for a description of the return type
 int getOwnSlotValueCount(Slot slot)
           
 Collection getOwnSlotValues(Slot slot)
          see Frame for a description of the return type
 ValueType getOwnSlotValueType(Slot slot)
           
 Project getProject()
           
 Collection<Reference> getReferences()
           
 Collection getReferences(int maxReferences)
           
 boolean hasOwnSlot(Slot slot)
           
 boolean isBeingDeleted()
           
 boolean isDeleted()
           
 boolean isEditable()
           
 boolean isIncluded()
           
 boolean isSystem()
           
 boolean isValid()
          Deprecated. Use #isDeleted()
 boolean isValidOwnSlotValue(Slot slot, Object item)
           
 boolean isVisible()
           
 void markDeleted(boolean deleted)
           
 void markDeleting()
           
 void moveDirectOwnSlotValue(Slot slot, int fromIndex, int toIndex)
           
 void removeFrameListener(FrameListener listener)
           
 void removeOwnSlotValue(Slot slot, Object value)
          Remove _all_ occurrences of this value.
 Frame rename(String name)
          This is as close as we come to renaming a frame.
 void setDirectOwnSlotValue(Slot slot, Object value)
          Same as #setOwnSlotValue(Slot, Object)
 void setDirectOwnSlotValues(Slot slot, Collection values)
          Same as #setOwnSlotValues(Slot, Collection)
 void setDocumentation(Collection documentation)
           
 void setDocumentation(String documentation)
           
 void setEditable(boolean b)
           
 void setIncluded(boolean b)
           
 void setOwnFacetValue(Slot slot, Facet facet, Object value)
          See Framefor a description of the value type.
 void setOwnFacetValues(Slot slot, Facet facet, Collection values)
          See Framefor a description of the value type.
 void setOwnSlotValue(Slot slot, Object value)
          See Framefor a description of the value type.
 void setOwnSlotValues(Slot slot, Collection values)
          See Framefor a description of the value type.
 void setVisible(boolean b)
           
 Frame shallowCopy(KnowledgeBase kb, Map valueMap)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

addFrameListener

void addFrameListener(FrameListener listener)

addOwnFacetValue

boolean addOwnFacetValue(Slot slot,
                         Facet facet,
                         Object value)

addOwnSlotValue

void addOwnSlotValue(Slot slot,
                     Object value)

areValidOwnSlotValues

boolean areValidOwnSlotValues(Slot slot,
                              Collection values)

deepCopy

Frame deepCopy(KnowledgeBase kb,
               Map valueMap)
Create a "deep copy" of the frame. If a frame has slot values that refer to SimpleInstances then these instances are duplicated as well. References to classes, slots, and facets are not duplicated. The copy of the frame is placed in the "kb" KnowledgeBase. To duplicate an instance into its own knowledgeBase you can pass in null for the kb. Always pass in null for the valueMap argument.


shallowCopy

Frame shallowCopy(KnowledgeBase kb,
                  Map valueMap)

copy

Frame copy(KnowledgeBase kb,
           Map valueMap,
           boolean isDeep)

delete

void delete()

getBrowserText

String getBrowserText()

getIcon

Icon getIcon()

getDocumentation

Collection getDocumentation()

getFrameID

FrameID getFrameID()

getInvalidOwnSlotValuesText

String getInvalidOwnSlotValuesText(Slot slot,
                                   Collection values)

getInvalidOwnSlotValueText

String getInvalidOwnSlotValueText(Slot slot,
                                  Object value)

getKnowledgeBase

KnowledgeBase getKnowledgeBase()

getName

String getName()

getOwnFacetValue

Object getOwnFacetValue(Slot slot,
                        Facet facet)
see Framefor a description of the return type


getOwnFacetValues

Collection getOwnFacetValues(Slot slot,
                             Facet facet)
see Framefor a description of the return type


getOwnSlotAllowsMultipleValues

boolean getOwnSlotAllowsMultipleValues(Slot slot)

getOwnSlotAndSubslotValues

Collection getOwnSlotAndSubslotValues(Slot slot)
Returns the own slot values for this slot and all of its subslots. See Frame for a description of the return type.


getOwnSlotDefaultValues

Collection getOwnSlotDefaultValues(Slot slot)
see Framefor a description of the return type


getOwnSlotFacets

Collection getOwnSlotFacets(Slot slot)

getOwnSlotFacetValues

Collection getOwnSlotFacetValues(Slot slot,
                                 Facet facet)

getOwnSlots

Collection<Slot> getOwnSlots()
Gets the collection of own slots for a frame. These consist of the template slots of all of its direct types as well as the slots :NAME and :DIRECT-TYPE. See the Protege documentation (or the OKBC spec) for additional information about "own" and "template" slots.

Returns:
a collection of #Slot for this frame

getDirectOwnSlotValue

Object getDirectOwnSlotValue(Slot slot)
see Frame for a description of the return type


getOwnSlotValue

Object getOwnSlotValue(Slot slot)
see Frame for a description of the return type


getOwnSlotValueCount

int getOwnSlotValueCount(Slot slot)

getOwnSlotValues

Collection getOwnSlotValues(Slot slot)
see Frame for a description of the return type


getDirectOwnSlotValues

List getDirectOwnSlotValues(Slot slot)
See Frame for a description of the return type.


getOwnSlotValueType

ValueType getOwnSlotValueType(Slot slot)

getProject

Project getProject()

getReferences

Collection<Reference> getReferences()

getReferences

Collection getReferences(int maxReferences)

hasOwnSlot

boolean hasOwnSlot(Slot slot)

isEditable

boolean isEditable()

isIncluded

boolean isIncluded()

isSystem

boolean isSystem()

isValid

boolean isValid()
Deprecated. Use #isDeleted()


markDeleting

void markDeleting()

markDeleted

void markDeleted(boolean deleted)

isDeleted

boolean isDeleted()

isBeingDeleted

boolean isBeingDeleted()

isValidOwnSlotValue

boolean isValidOwnSlotValue(Slot slot,
                            Object item)

isVisible

boolean isVisible()

moveDirectOwnSlotValue

void moveDirectOwnSlotValue(Slot slot,
                            int fromIndex,
                            int toIndex)

removeFrameListener

void removeFrameListener(FrameListener listener)

removeOwnSlotValue

void removeOwnSlotValue(Slot slot,
                        Object value)
Remove _all_ occurrences of this value.


setDocumentation

void setDocumentation(String documentation)

setDocumentation

void setDocumentation(Collection documentation)

setEditable

void setEditable(boolean b)

setIncluded

void setIncluded(boolean b)

setOwnFacetValue

void setOwnFacetValue(Slot slot,
                      Facet facet,
                      Object value)
See Framefor a description of the value type.


setOwnFacetValues

void setOwnFacetValues(Slot slot,
                       Facet facet,
                       Collection values)
See Framefor a description of the value type.


setOwnSlotValue

void setOwnSlotValue(Slot slot,
                     Object value)
See Framefor a description of the value type. This method sets the value of an own slot at a frame to a single value. The value passed in cannot be a Collection. To pass in a collection instead use setOwnSlotValues(Slot, Collection)(note the final "s"). This method can be called for either cardinality-single slots or cardinality-multiple slots.


setDirectOwnSlotValue

void setDirectOwnSlotValue(Slot slot,
                           Object value)
Same as #setOwnSlotValue(Slot, Object)


setOwnSlotValues

void setOwnSlotValues(Slot slot,
                      Collection values)
See Framefor a description of the value type. This method sets the value of an own slot at a frame to a collection of values. This method can be called for either cardinality-single slots or cardinality-multiple slots. For a cardinality single slot the collection passed in must have no more than one element.


setDirectOwnSlotValues

void setDirectOwnSlotValues(Slot slot,
                            Collection values)
Same as #setOwnSlotValues(Slot, Collection)


setVisible

void setVisible(boolean b)

rename

Frame rename(String name)
This is as close as we come to renaming a frame. Creates a clone of this with the new name and deletes this.


assertFrameName

void assertFrameName()
This call ensures that the name slot for the frame has the frame name as its value. This can be important when constructing a frame from scratch and then trying to ensure that the frame actually appears in the knowledge base. The frame will not appear in the knowledge base until the knowledge base has an assertion about the frame. Sometimes frames are created without any type information and then later the needed assertions are added.


Protege 3.4.5

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2011 Stanford University.