edu.stanford.smi.protege.model.framestore
Class SimpleFrameStore
java.lang.Object
edu.stanford.smi.protege.model.framestore.SimpleFrameStore
- All Implemented Interfaces:
- FrameStore
- Direct Known Subclasses:
- DatabaseFrameStore, DatabaseFrameStore, InMemoryFrameStore
- public class SimpleFrameStore
- extends Object
- implements FrameStore
Method Summary |
protected void |
addCls(Cls cls,
String name,
Collection directTypes,
Collection directSuperclasses,
boolean loadDefaults)
|
void |
addDirectOwnSlotValue(Frame frame,
Slot slot,
Object value)
|
void |
addDirectOwnSlotValues(Frame frame,
Slot slot,
Collection values)
|
void |
addDirectSuperclass(Cls cls,
Cls superclass)
|
void |
addDirectSuperslot(Slot slot,
Slot superslot)
|
void |
addDirectTemplateSlot(Cls cls,
Slot slot)
|
void |
addDirectType(Instance instance,
Cls type)
|
protected void |
addSlot(Slot slot,
String name,
Collection directTypes,
Collection directSuperslots,
boolean loadDefaults)
|
protected void |
addSystemFrames()
|
boolean |
beginTransaction(String name)
|
void |
close()
|
boolean |
commitTransaction()
|
protected Cls |
createCls(FrameID id,
Collection directTypes)
|
Cls |
createCls(FrameID id,
String name,
Collection directTypes,
Collection directSuperclasses,
boolean loadDefaults)
|
protected Facet |
createFacet(FrameID id,
Collection directTypes)
|
Facet |
createFacet(FrameID id,
String name,
Collection directTypes,
boolean loadDefaults)
|
protected SimpleInstance |
createSimpleInstance(FrameID id,
Collection directTypes)
|
SimpleInstance |
createSimpleInstance(FrameID id,
String name,
Collection directTypes,
boolean loadDefaults)
|
protected Slot |
createSlot(FrameID id,
Collection directTypes)
|
Slot |
createSlot(FrameID id,
String name,
Collection directTypes,
Collection directSuperslots,
boolean loadDefaults)
|
void |
deleteCls(Cls cls)
Delete a single leaf class. |
void |
deleteFacet(Facet facet)
|
void |
deleteSimpleInstance(SimpleInstance simpleInstance)
|
void |
deleteSlot(Slot slot)
|
static boolean |
equals(Object o1,
Object o2)
|
Set |
executeQuery(Query query)
|
protected String |
generateUniqueName(String baseName)
|
int |
getClsCount()
|
Set |
getClses()
|
static Collection |
getClsesToBeDeleted(Cls cls,
FrameStore fs)
This method should not be down here in the frame store chain. |
Set |
getClsesWithAnyDirectTemplateSlotValue(Slot slot)
|
Set |
getClsesWithDirectTemplateFacetValue(Slot slot,
Facet facet,
Object value)
|
Set |
getClsesWithDirectTemplateSlotValue(Slot slot,
Object value)
|
Set |
getClsesWithMatchingDirectTemplateFacetValue(Slot slot,
Facet facet,
String value,
int maxMatches)
|
Set |
getClsesWithMatchingDirectTemplateSlotValue(Slot slot,
String value,
int maxMatches)
|
FrameStore |
getDelegate()
|
List |
getDirectDomain(Slot slot)
|
List |
getDirectInstances(Cls cls)
|
Set |
getDirectlyOverriddenTemplateFacets(Cls cls,
Slot slot)
|
Set |
getDirectlyOverriddenTemplateSlots(Cls cls)
|
List |
getDirectOwnSlotValues(Frame frame,
Slot slot)
|
Set |
getDirectOwnSlotValuesClosure(Frame frame,
Slot slot)
|
int |
getDirectOwnSlotValuesCount(Frame frame,
Slot slot)
|
List |
getDirectSubclasses(Cls cls)
|
List |
getDirectSubslots(Slot slot)
|
List |
getDirectSuperclasses(Cls cls)
|
List |
getDirectSuperslots(Slot slot)
|
List |
getDirectTemplateFacetValues(Cls cls,
Slot slot,
Facet facet)
|
List |
getDirectTemplateSlots(Cls cls)
|
List |
getDirectTemplateSlotValues(Cls cls,
Slot slot)
|
List |
getDirectTypes(Instance instance)
|
Set |
getDomain(Slot slot)
|
List |
getEvents()
|
int |
getFacetCount()
|
Set |
getFacets()
|
Frame |
getFrame(FrameID id)
|
Frame |
getFrame(String name)
|
int |
getFrameCount()
|
String |
getFrameName(Frame frame)
|
Set |
getFrames()
|
Set |
getFramesWithAnyDirectOwnSlotValue(Slot slot)
|
Set |
getFramesWithDirectOwnSlotValue(Slot slot,
Object value)
|
Set |
getFramesWithMatchingDirectOwnSlotValue(Slot slot,
String value,
int maxMatches)
|
protected BasicFrameStore |
getHelper()
|
Set |
getInstances(Cls cls)
|
Set |
getMatchingReferences(String value,
int maxMatches)
|
Set |
getOverriddenTemplateFacets(Cls cls,
Slot slot)
|
Set |
getOverriddenTemplateSlots(Cls cls)
|
Set |
getOwnFacets(Frame frame,
Slot slot)
|
Collection |
getOwnFacetValues(Frame frame,
Slot slot,
Facet facet)
|
Set |
getOwnSlots(Frame frame)
|
Collection |
getOwnSlotValues(Frame frame,
Slot slot)
|
Set |
getReferences(Object value)
|
int |
getSimpleInstanceCount()
|
int |
getSlotCount()
|
Set |
getSlots()
|
Set |
getSubclasses(Cls cls)
|
Set |
getSubslots(Slot slot)
|
Set |
getSuperclasses(Cls cls)
|
Set |
getSuperslots(Slot slot)
|
Set |
getTemplateFacets(Cls cls,
Slot slot)
|
Collection |
getTemplateFacetValues(Cls localCls,
Slot slot,
Facet facet)
|
Set |
getTemplateSlots(Cls cls)
|
Collection |
getTemplateSlotValues(Cls cls,
Slot slot)
|
Set |
getTypes(Instance instance)
|
void |
moveDirectOwnSlotValue(Frame frame,
Slot slot,
int from,
int to)
|
void |
moveDirectSubclass(Cls cls,
Cls subclass,
int index)
|
void |
moveDirectSubslot(Slot slot,
Slot subslot,
int index)
|
void |
moveDirectTemplateSlot(Cls cls,
Slot slot,
int index)
|
void |
reinitialize()
|
void |
removeDirectOwnSlotValue(Frame frame,
Slot slot,
Object value)
|
void |
removeDirectSuperclass(Cls cls,
Cls superclass)
|
void |
removeDirectSuperslot(Slot slot,
Slot superslot)
|
void |
removeDirectTemplateFacetOverrides(Cls cls,
Slot slot)
|
void |
removeDirectTemplateSlot(Cls cls,
Slot slot)
|
void |
removeDirectType(Instance instance,
Cls type)
|
boolean |
rollbackTransaction()
|
void |
setDelegate(FrameStore fs)
|
void |
setDirectOwnSlotValues(Frame frame,
Slot slot,
Collection newValues)
|
void |
setDirectTemplateFacetValues(Cls cls,
Slot slot,
Facet facet,
Collection values)
|
void |
setDirectTemplateSlotValues(Cls cls,
Slot slot,
Collection values)
|
void |
setFrameName(Frame frame,
String name)
|
protected void |
setHelper(BasicFrameStore helper)
|
String |
toString()
|
protected String |
uniqueName(String name,
String baseName)
|
SimpleFrameStore
public SimpleFrameStore(KnowledgeBase kb,
BasicFrameStore helper)
reinitialize
public void reinitialize()
- Specified by:
reinitialize
in interface FrameStore
setHelper
protected void setHelper(BasicFrameStore helper)
getHelper
protected BasicFrameStore getHelper()
executeQuery
public Set executeQuery(Query query)
- Specified by:
executeQuery
in interface FrameStore
deleteCls
public void deleteCls(Cls cls)
- Description copied from interface:
FrameStore
- Delete a single leaf class. The operation fails if the class has subclasses or instances.
- Specified by:
deleteCls
in interface FrameStore
- Parameters:
cls
- Class to be deleted
getClsesToBeDeleted
public static Collection getClsesToBeDeleted(Cls cls,
FrameStore fs)
- This method should not be down here in the frame store chain.
- Returns:
- Collection of Clses
deleteSlot
public void deleteSlot(Slot slot)
- Specified by:
deleteSlot
in interface FrameStore
deleteFacet
public void deleteFacet(Facet facet)
- Specified by:
deleteFacet
in interface FrameStore
deleteSimpleInstance
public void deleteSimpleInstance(SimpleInstance simpleInstance)
- Specified by:
deleteSimpleInstance
in interface FrameStore
getReferences
public Set getReferences(Object value)
- Specified by:
getReferences
in interface FrameStore
close
public void close()
- Specified by:
close
in interface FrameStore
getMatchingReferences
public Set getMatchingReferences(String value,
int maxMatches)
- Specified by:
getMatchingReferences
in interface FrameStore
getClsCount
public int getClsCount()
- Specified by:
getClsCount
in interface FrameStore
getSlotCount
public int getSlotCount()
- Specified by:
getSlotCount
in interface FrameStore
getFacetCount
public int getFacetCount()
- Specified by:
getFacetCount
in interface FrameStore
getSimpleInstanceCount
public int getSimpleInstanceCount()
- Specified by:
getSimpleInstanceCount
in interface FrameStore
getFrameCount
public int getFrameCount()
- Specified by:
getFrameCount
in interface FrameStore
getClses
public Set getClses()
- Specified by:
getClses
in interface FrameStore
getSlots
public Set getSlots()
- Specified by:
getSlots
in interface FrameStore
getFacets
public Set getFacets()
- Specified by:
getFacets
in interface FrameStore
getFrames
public Set getFrames()
- Specified by:
getFrames
in interface FrameStore
getDirectTemplateSlots
public List getDirectTemplateSlots(Cls cls)
- Specified by:
getDirectTemplateSlots
in interface FrameStore
getDirectSuperclasses
public List getDirectSuperclasses(Cls cls)
- Specified by:
getDirectSuperclasses
in interface FrameStore
getDirectSuperslots
public List getDirectSuperslots(Slot slot)
- Specified by:
getDirectSuperslots
in interface FrameStore
getDirectSubslots
public List getDirectSubslots(Slot slot)
- Specified by:
getDirectSubslots
in interface FrameStore
getSuperslots
public Set getSuperslots(Slot slot)
- Specified by:
getSuperslots
in interface FrameStore
getSubslots
public Set getSubslots(Slot slot)
- Specified by:
getSubslots
in interface FrameStore
getSuperclasses
public Set getSuperclasses(Cls cls)
- Specified by:
getSuperclasses
in interface FrameStore
getDirectSubclasses
public List getDirectSubclasses(Cls cls)
- Specified by:
getDirectSubclasses
in interface FrameStore
getSubclasses
public Set getSubclasses(Cls cls)
- Specified by:
getSubclasses
in interface FrameStore
getTemplateFacets
public Set getTemplateFacets(Cls cls,
Slot slot)
- Specified by:
getTemplateFacets
in interface FrameStore
getTemplateFacetValues
public Collection getTemplateFacetValues(Cls localCls,
Slot slot,
Facet facet)
- Specified by:
getTemplateFacetValues
in interface FrameStore
getTemplateSlotValues
public Collection getTemplateSlotValues(Cls cls,
Slot slot)
- Specified by:
getTemplateSlotValues
in interface FrameStore
getDirectOwnSlotValuesClosure
public Set getDirectOwnSlotValuesClosure(Frame frame,
Slot slot)
- Specified by:
getDirectOwnSlotValuesClosure
in interface FrameStore
equals
public static boolean equals(Object o1,
Object o2)
getDirectTypes
public List getDirectTypes(Instance instance)
- Specified by:
getDirectTypes
in interface FrameStore
getDirectInstances
public List getDirectInstances(Cls cls)
- Specified by:
getDirectInstances
in interface FrameStore
getInstances
public Set getInstances(Cls cls)
- Specified by:
getInstances
in interface FrameStore
getTypes
public Set getTypes(Instance instance)
- Specified by:
getTypes
in interface FrameStore
getFrame
public Frame getFrame(String name)
- Specified by:
getFrame
in interface FrameStore
getFrame
public Frame getFrame(FrameID id)
- Specified by:
getFrame
in interface FrameStore
getOwnSlots
public Set getOwnSlots(Frame frame)
- Specified by:
getOwnSlots
in interface FrameStore
getTemplateSlots
public Set getTemplateSlots(Cls cls)
- Specified by:
getTemplateSlots
in interface FrameStore
getDomain
public Set getDomain(Slot slot)
- Specified by:
getDomain
in interface FrameStore
getDirectDomain
public List getDirectDomain(Slot slot)
- Specified by:
getDirectDomain
in interface FrameStore
addDirectSuperclass
public void addDirectSuperclass(Cls cls,
Cls superclass)
- Specified by:
addDirectSuperclass
in interface FrameStore
removeDirectSuperclass
public void removeDirectSuperclass(Cls cls,
Cls superclass)
- Specified by:
removeDirectSuperclass
in interface FrameStore
addDirectSuperslot
public void addDirectSuperslot(Slot slot,
Slot superslot)
- Specified by:
addDirectSuperslot
in interface FrameStore
removeDirectSuperslot
public void removeDirectSuperslot(Slot slot,
Slot superslot)
- Specified by:
removeDirectSuperslot
in interface FrameStore
addDirectType
public void addDirectType(Instance instance,
Cls type)
- Specified by:
addDirectType
in interface FrameStore
removeDirectType
public void removeDirectType(Instance instance,
Cls type)
- Specified by:
removeDirectType
in interface FrameStore
moveDirectSubclass
public void moveDirectSubclass(Cls cls,
Cls subclass,
int index)
- Specified by:
moveDirectSubclass
in interface FrameStore
moveDirectSubslot
public void moveDirectSubslot(Slot slot,
Slot subslot,
int index)
- Specified by:
moveDirectSubslot
in interface FrameStore
addDirectTemplateSlot
public void addDirectTemplateSlot(Cls cls,
Slot slot)
- Specified by:
addDirectTemplateSlot
in interface FrameStore
moveDirectTemplateSlot
public void moveDirectTemplateSlot(Cls cls,
Slot slot,
int index)
- Specified by:
moveDirectTemplateSlot
in interface FrameStore
removeDirectTemplateSlot
public void removeDirectTemplateSlot(Cls cls,
Slot slot)
- Specified by:
removeDirectTemplateSlot
in interface FrameStore
addDirectOwnSlotValue
public void addDirectOwnSlotValue(Frame frame,
Slot slot,
Object value)
removeDirectOwnSlotValue
public void removeDirectOwnSlotValue(Frame frame,
Slot slot,
Object value)
moveDirectOwnSlotValue
public void moveDirectOwnSlotValue(Frame frame,
Slot slot,
int from,
int to)
addDirectOwnSlotValues
public void addDirectOwnSlotValues(Frame frame,
Slot slot,
Collection values)
createCls
public Cls createCls(FrameID id,
String name,
Collection directTypes,
Collection directSuperclasses,
boolean loadDefaults)
- Specified by:
createCls
in interface FrameStore
createSimpleInstance
public SimpleInstance createSimpleInstance(FrameID id,
String name,
Collection directTypes,
boolean loadDefaults)
- Specified by:
createSimpleInstance
in interface FrameStore
createFacet
public Facet createFacet(FrameID id,
String name,
Collection directTypes,
boolean loadDefaults)
- Specified by:
createFacet
in interface FrameStore
addCls
protected void addCls(Cls cls,
String name,
Collection directTypes,
Collection directSuperclasses,
boolean loadDefaults)
addSlot
protected void addSlot(Slot slot,
String name,
Collection directTypes,
Collection directSuperslots,
boolean loadDefaults)
createSlot
public Slot createSlot(FrameID id,
String name,
Collection directTypes,
Collection directSuperslots,
boolean loadDefaults)
- Specified by:
createSlot
in interface FrameStore
uniqueName
protected String uniqueName(String name,
String baseName)
generateUniqueName
protected String generateUniqueName(String baseName)
getOwnSlotValues
public Collection getOwnSlotValues(Frame frame,
Slot slot)
- Specified by:
getOwnSlotValues
in interface FrameStore
getDirectOwnSlotValues
public List getDirectOwnSlotValues(Frame frame,
Slot slot)
- Specified by:
getDirectOwnSlotValues
in interface FrameStore
getDirectOwnSlotValuesCount
public int getDirectOwnSlotValuesCount(Frame frame,
Slot slot)
- Specified by:
getDirectOwnSlotValuesCount
in interface FrameStore
setDirectOwnSlotValues
public void setDirectOwnSlotValues(Frame frame,
Slot slot,
Collection newValues)
- Specified by:
setDirectOwnSlotValues
in interface FrameStore
getDirectTemplateSlotValues
public List getDirectTemplateSlotValues(Cls cls,
Slot slot)
- Specified by:
getDirectTemplateSlotValues
in interface FrameStore
setDirectTemplateSlotValues
public void setDirectTemplateSlotValues(Cls cls,
Slot slot,
Collection values)
- Specified by:
setDirectTemplateSlotValues
in interface FrameStore
getDirectTemplateFacetValues
public List getDirectTemplateFacetValues(Cls cls,
Slot slot,
Facet facet)
- Specified by:
getDirectTemplateFacetValues
in interface FrameStore
setDirectTemplateFacetValues
public void setDirectTemplateFacetValues(Cls cls,
Slot slot,
Facet facet,
Collection values)
- Specified by:
setDirectTemplateFacetValues
in interface FrameStore
getFramesWithDirectOwnSlotValue
public Set getFramesWithDirectOwnSlotValue(Slot slot,
Object value)
- Specified by:
getFramesWithDirectOwnSlotValue
in interface FrameStore
getFramesWithAnyDirectOwnSlotValue
public Set getFramesWithAnyDirectOwnSlotValue(Slot slot)
- Specified by:
getFramesWithAnyDirectOwnSlotValue
in interface FrameStore
getClsesWithDirectTemplateSlotValue
public Set getClsesWithDirectTemplateSlotValue(Slot slot,
Object value)
- Specified by:
getClsesWithDirectTemplateSlotValue
in interface FrameStore
getClsesWithAnyDirectTemplateSlotValue
public Set getClsesWithAnyDirectTemplateSlotValue(Slot slot)
- Specified by:
getClsesWithAnyDirectTemplateSlotValue
in interface FrameStore
getClsesWithDirectTemplateFacetValue
public Set getClsesWithDirectTemplateFacetValue(Slot slot,
Facet facet,
Object value)
- Specified by:
getClsesWithDirectTemplateFacetValue
in interface FrameStore
getFramesWithMatchingDirectOwnSlotValue
public Set getFramesWithMatchingDirectOwnSlotValue(Slot slot,
String value,
int maxMatches)
- Specified by:
getFramesWithMatchingDirectOwnSlotValue
in interface FrameStore
getClsesWithMatchingDirectTemplateSlotValue
public Set getClsesWithMatchingDirectTemplateSlotValue(Slot slot,
String value,
int maxMatches)
- Specified by:
getClsesWithMatchingDirectTemplateSlotValue
in interface FrameStore
getClsesWithMatchingDirectTemplateFacetValue
public Set getClsesWithMatchingDirectTemplateFacetValue(Slot slot,
Facet facet,
String value,
int maxMatches)
- Specified by:
getClsesWithMatchingDirectTemplateFacetValue
in interface FrameStore
getFrameName
public String getFrameName(Frame frame)
- Specified by:
getFrameName
in interface FrameStore
setFrameName
public void setFrameName(Frame frame,
String name)
- Specified by:
setFrameName
in interface FrameStore
addSystemFrames
protected void addSystemFrames()
createCls
protected Cls createCls(FrameID id,
Collection directTypes)
createSlot
protected Slot createSlot(FrameID id,
Collection directTypes)
createFacet
protected Facet createFacet(FrameID id,
Collection directTypes)
createSimpleInstance
protected SimpleInstance createSimpleInstance(FrameID id,
Collection directTypes)
getOwnFacets
public Set getOwnFacets(Frame frame,
Slot slot)
- Specified by:
getOwnFacets
in interface FrameStore
getOwnFacetValues
public Collection getOwnFacetValues(Frame frame,
Slot slot,
Facet facet)
- Specified by:
getOwnFacetValues
in interface FrameStore
getOverriddenTemplateSlots
public Set getOverriddenTemplateSlots(Cls cls)
- Specified by:
getOverriddenTemplateSlots
in interface FrameStore
getDirectlyOverriddenTemplateSlots
public Set getDirectlyOverriddenTemplateSlots(Cls cls)
- Specified by:
getDirectlyOverriddenTemplateSlots
in interface FrameStore
getOverriddenTemplateFacets
public Set getOverriddenTemplateFacets(Cls cls,
Slot slot)
- Specified by:
getOverriddenTemplateFacets
in interface FrameStore
getDirectlyOverriddenTemplateFacets
public Set getDirectlyOverriddenTemplateFacets(Cls cls,
Slot slot)
- Specified by:
getDirectlyOverriddenTemplateFacets
in interface FrameStore
removeDirectTemplateFacetOverrides
public void removeDirectTemplateFacetOverrides(Cls cls,
Slot slot)
- Specified by:
removeDirectTemplateFacetOverrides
in interface FrameStore
beginTransaction
public boolean beginTransaction(String name)
- Specified by:
beginTransaction
in interface FrameStore
commitTransaction
public boolean commitTransaction()
- Specified by:
commitTransaction
in interface FrameStore
rollbackTransaction
public boolean rollbackTransaction()
- Specified by:
rollbackTransaction
in interface FrameStore
getEvents
public List getEvents()
- Specified by:
getEvents
in interface FrameStore
setDelegate
public void setDelegate(FrameStore fs)
- Specified by:
setDelegate
in interface FrameStore
getDelegate
public FrameStore getDelegate()
- Specified by:
getDelegate
in interface FrameStore
toString
public String toString()
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2004 Stanford University.