|
Protege 3.5 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protege.model.ModelUtilities
public class ModelUtilities
Convenience utilities for dealing with the Knowledge Base. Most of these methods take frame names (strings) rather than frames and convert them. Note that there is a serious performance penalty for using these methods if they are used repeatedly to perform some operation. For repeat operations you should look up the needed frames once and then store them and use the stored values. Nevertheless, for some rare or one-off operations these methods can be useful and convenient.
Constructor Summary | |
---|---|
ModelUtilities()
|
Method Summary | |
---|---|
static void |
addOwnSlotValue(Frame frame,
String slotName,
Object value)
|
static Map |
createValueMap(KnowledgeBase sourceKB,
KnowledgeBase targetKB)
|
static Object |
getDirectOwnSlotValue(Frame frame,
String name)
|
static List |
getDirectOwnSlotValues(Frame frame,
String name)
|
static Object |
getOwnSlotValue(Frame frame,
String name)
|
static Collection |
getOwnSlotValues(Frame frame,
String name)
|
List<Cls> |
getPath(Cls cls,
List<Cls> list)
|
static Collection<List<Cls>> |
getPathsToRoot(Cls cls)
Computes all paths from a class to the root node by navigating on the direct superclasses slot. |
static List<Cls> |
getPathToRoot(Cls cls)
|
static Collection<List<Instance>> |
getPropertyClosureToRoot(Instance resource,
Slot parentSlot,
Instance rootResource)
Computes all paths from an instance to the "root instance" node by navigating on a given slot. |
static void |
getPropertyClosureToRoot(Instance resource,
Slot parentSlot,
Instance rootResource,
List<Instance> path,
Collection<List<Instance>> pathLists)
|
static Map<Object,List<Instance>> |
getPropertyValuesOnAllSuperclasses(Cls cls,
Slot slot)
Returns all own slot values for the slot slot for every superclass of a class. |
static Map<Object,List<Instance>> |
getPropertyValuesOnPropertyClosureToRoot(Instance resource,
Slot parentSlot,
Instance rootResource,
Slot slot)
Returns all own slot values for the slot slot for every instance
in any of the paths between an instance (resource ) and
a root instances (rootResource ) following the relationships
defined by the parentSlot slot. |
static Object |
getTemplateFacetValue(Cls cls,
Slot slot,
String facetName)
|
static Collection |
getTemplateFacetValues(Cls cls,
Slot slot,
String facetName)
|
static boolean |
isVisibleInGUI(Frame frame)
|
static void |
removeOwnSlotValue(Frame frame,
String slotName,
Object value)
|
static void |
setOwnSlotValue(Frame frame,
String slotName,
Object value)
|
static void |
setOwnSlotValues(Frame frame,
String slotName,
Collection values)
|
static void |
setTemplateFacetValue(Cls cls,
Slot slot,
String facetName,
Object value)
|
static void |
setTemplateFacetValues(Cls cls,
Slot slot,
String facetName,
Collection values)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelUtilities()
Method Detail |
---|
public static void addOwnSlotValue(Frame frame, String slotName, Object value)
public static Map createValueMap(KnowledgeBase sourceKB, KnowledgeBase targetKB)
public static Object getOwnSlotValue(Frame frame, String name)
public static Object getDirectOwnSlotValue(Frame frame, String name)
public static Collection getOwnSlotValues(Frame frame, String name)
public static List getDirectOwnSlotValues(Frame frame, String name)
public List<Cls> getPath(Cls cls, List<Cls> list)
public static void getPropertyClosureToRoot(Instance resource, Slot parentSlot, Instance rootResource, List<Instance> path, Collection<List<Instance>> pathLists)
public static Collection<List<Instance>> getPropertyClosureToRoot(Instance resource, Slot parentSlot, Instance rootResource)
resource
- - an instanceparentSlot
- - slot to navigate on towards a "root node"rootResource
- - an instance considered as the root of the navigation tree,
necessary to stop the navigation.
public static Map<Object,List<Instance>> getPropertyValuesOnPropertyClosureToRoot(Instance resource, Slot parentSlot, Instance rootResource, Slot slot)
slot
for every instance
in any of the paths between an instance (resource
) and
a root instances (rootResource
) following the relationships
defined by the parentSlot
slot.
resource
- - a resourceparentSlot
- - the slot that is used to traverse the instance graph to the rootResource
rootResource
- - the resource that is theslot
- - a slot
public static Map<Object,List<Instance>> getPropertyValuesOnAllSuperclasses(Cls cls, Slot slot)
slot
for every superclass of a class.
cls
- - a classslot
- - a slot
public static List<Cls> getPathToRoot(Cls cls)
public static Collection<List<Cls>> getPathsToRoot(Cls cls)
cls
- - the resource
public static Object getTemplateFacetValue(Cls cls, Slot slot, String facetName)
public static Collection getTemplateFacetValues(Cls cls, Slot slot, String facetName)
public static boolean isVisibleInGUI(Frame frame)
public static void removeOwnSlotValue(Frame frame, String slotName, Object value)
public static void setOwnSlotValue(Frame frame, String slotName, Object value)
public static void setOwnSlotValues(Frame frame, String slotName, Collection values)
public static void setTemplateFacetValue(Cls cls, Slot slot, String facetName, Object value)
public static void setTemplateFacetValues(Cls cls, Slot slot, String facetName, Collection values)
|
Protege 3.5 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |