Protege 3.4

edu.stanford.smi.protege.model.framestore
Interface NarrowFrameStore

All Known Subinterfaces:
DatabaseFrameDb
All Known Implementing Classes:
AbstractDatabaseFrameDb, ClosureCachingBasicFrameStore, DefaultDatabaseFrameDb, ImmutableNamesNarrowFrameStore, InMemoryFrameDb, MergingNarrowFrameStore, PlaceHolderNarrowFrameStore, ValueCachingNarrowFrameStore

public interface NarrowFrameStore


Method Summary
 void addValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
           
 boolean beginTransaction(String name)
           
 void close()
           
 boolean commitTransaction()
           
 void deleteFrame(Frame frame)
           
 void executeQuery(Query query, QueryCallback callback)
          The executeQuery method allows for complex queries.
 Set getClosure(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 int getClsCount()
           
 NarrowFrameStore getDelegate()
           
 int getFacetCount()
           
 Frame getFrame(FrameID id)
           
 int getFrameCount()
           
 Set<Frame> getFrames()
           
 Set<Frame> getFrames(Slot slot, Facet facet, boolean isTemplate, Object value)
           
 Set<Frame> getFramesWithAnyValue(Slot slot, Facet facet, boolean isTemplate)
           
 Set<Frame> getMatchingFrames(Slot slot, Facet facet, boolean isTemplate, String value, int maxMatches)
           
 Set<Reference> getMatchingReferences(String value, int maxMatches)
           
 String getName()
          The Narrow Frame store has a standard set/get name interface.
 Set<Reference> getReferences(Object value)
           
 int getSimpleInstanceCount()
           
 int getSlotCount()
           
 TransactionMonitor getTransactionStatusMonitor()
          Retrieves a transaction status monitor for transactions.
 List getValues(Frame frame, Slot slot, Facet facet, boolean isTemplate)
          Obtains the values of a slot/facet to a frame.
 int getValuesCount(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 void moveValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int from, int to)
          Retrieves the list of values associated with the (frame, slot, facet, isTemplate) combination and moves the item at the position from to the position to.
 void reinitialize()
           
 void removeValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void replaceFrame(Frame frame)
          A complete hack to work around problems with the java packages feature
 void replaceFrame(Frame original, Frame replacement)
          Replace all references of the frame original with the frame replacement.
 boolean rollbackTransaction()
           
 void setName(String name)
          The Narrow Frame store has a standard set/get name interface.
 void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
           
 

Method Detail

getName

String getName()
The Narrow Frame store has a standard set/get name interface. One of the purposes of this interface is to allow the MergingNarrowFrameStore match names of the narrow frame stores of including and included projects. For this purpose the name of the narrow frame store is the string representation of the uri for the project.

Returns:
the name of this narrow frame store.

setName

void setName(String name)
The Narrow Frame store has a standard set/get name interface. One of the purposes of this interface is to allow the MergingNarrowFrameStore match names of the narrow frame stores of including and included projects. For this purpose the name of the narrow frame store is the string representation of the uri for the project.

Parameters:
name - - the name of the Narrow Frame Store.

getDelegate

NarrowFrameStore getDelegate()

getFrameCount

int getFrameCount()

getClsCount

int getClsCount()

getSlotCount

int getSlotCount()

getFacetCount

int getFacetCount()

getSimpleInstanceCount

int getSimpleInstanceCount()

getFrames

Set<Frame> getFrames()

getFrame

Frame getFrame(FrameID id)

getValues

List getValues(Frame frame,
               Slot slot,
               Facet facet,
               boolean isTemplate)
Obtains the values of a slot/facet to a frame. It consists of a list of Strings, Integers Floats and Frames. This call does one of several things. If facet == null then we are looking at a slot value. In this case, if isTemplate is true, then the frame is a class, the slot is a template slot and the value is a default facet value. If facet != null then we are looking at a facet value. In this case, if isTemplate is true then the frame is a class, the slot is a template slot and the value is a default facet value.

Parameters:
frame - - the frame
slot - the slot
facet - the facet. If this is non-null then we are looking at a facet value.
isTemplate - to be determined
Returns:
a list of the values of the slot of the frame.

getValuesCount

int getValuesCount(Frame frame,
                   Slot slot,
                   Facet facet,
                   boolean isTemplate)

addValues

void addValues(Frame frame,
               Slot slot,
               Facet facet,
               boolean isTemplate,
               Collection values)

moveValue

void moveValue(Frame frame,
               Slot slot,
               Facet facet,
               boolean isTemplate,
               int from,
               int to)
Retrieves the list of values associated with the (frame, slot, facet, isTemplate) combination and moves the item at the position from to the position to. Indexing is done starting from 0.

Parameters:
frame - the frame (as used in getValues)
slot - the slot (as used in getValues)
facet - the facet (as used in getValues)
isTemplate - whether it is a template (as used in getValues)
from - the starting position of a value
to - the position of the value after this call

removeValue

void removeValue(Frame frame,
                 Slot slot,
                 Facet facet,
                 boolean isTemplate,
                 Object value)

setValues

void setValues(Frame frame,
               Slot slot,
               Facet facet,
               boolean isTemplate,
               Collection values)

getFrames

Set<Frame> getFrames(Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)

getFramesWithAnyValue

Set<Frame> getFramesWithAnyValue(Slot slot,
                                 Facet facet,
                                 boolean isTemplate)

getMatchingFrames

Set<Frame> getMatchingFrames(Slot slot,
                             Facet facet,
                             boolean isTemplate,
                             String value,
                             int maxMatches)
Parameters:
slot - the slot
facet - the facet
isTemplate - whether we are looking at template values
value - the regexp to use for matching
maxMatches - the max number of matches (-1 for get all)
Returns:
See Also:
KnowledgeBase.getMatchingFrames

getReferences

Set<Reference> getReferences(Object value)

getMatchingReferences

Set<Reference> getMatchingReferences(String value,
                                     int maxMatches)

executeQuery

void executeQuery(Query query,
                  QueryCallback callback)
The executeQuery method allows for complex queries. It is asynchronous so that in server-client mode the server knowledge base lock will not be held for an excessive amount of time. The contract specifies that the implementor must call one of the QueryCallback methods in a separate thread. This makes it possible for the caller to know how to retrieve the results in a synchronous way without worrying about deadlock.

Parameters:
Query - the query to be executed.
QueryCallback - the callback that receives the results of the query.

deleteFrame

void deleteFrame(Frame frame)

close

void close()

getClosure

Set getClosure(Frame frame,
               Slot slot,
               Facet facet,
               boolean isTemplate)

replaceFrame

void replaceFrame(Frame frame)
A complete hack to work around problems with the java packages feature


beginTransaction

boolean beginTransaction(String name)

commitTransaction

boolean commitTransaction()

rollbackTransaction

boolean rollbackTransaction()

getTransactionStatusMonitor

TransactionMonitor getTransactionStatusMonitor()
Retrieves a transaction status monitor for transactions. If this call returns null then it means that transactions are not supported.

Returns:
A TransactionMonitor object that tracks the status of transactions.

reinitialize

void reinitialize()

replaceFrame

void replaceFrame(Frame original,
                  Frame replacement)
Replace all references of the frame original with the frame replacement. This (somewhat expensive) routine is used when the user wants to change the name of a frame. The result of this call is that the original frame is deleted and the replacement frame takes over in each position where the original frame occured. When the name of a frame is being changed, the caller will create a new frame (the replacement) with the new name and will then delete the original frame.

Parameters:
original - the frame in the database being replaced
replacement - the replacement frame that does not exist in the database before the call.

Protege 3.4

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