edu.stanford.smi.protege.model
Class ModelUtilities
java.lang.Object
edu.stanford.smi.protege.model.ModelUtilities
public class ModelUtilities
- extends Object
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.
- Author:
- Ray Fergerson
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 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 |
ModelUtilities
public ModelUtilities()
addOwnSlotValue
public static void addOwnSlotValue(Frame frame,
String slotName,
Object value)
createValueMap
public static Map createValueMap(KnowledgeBase sourceKB,
KnowledgeBase targetKB)
getOwnSlotValue
public static Object getOwnSlotValue(Frame frame,
String name)
getDirectOwnSlotValue
public static Object getDirectOwnSlotValue(Frame frame,
String name)
getOwnSlotValues
public static Collection getOwnSlotValues(Frame frame,
String name)
getDirectOwnSlotValues
public static List getDirectOwnSlotValues(Frame frame,
String name)
getPath
public List<Cls> getPath(Cls cls,
List<Cls> list)
getPathToRoot
public static List<Cls> getPathToRoot(Cls cls)
getPathsToRoot
public static Collection<List<Cls>> getPathsToRoot(Cls cls)
- Computes all paths from a class to the root node by navigating on the
direct superclasses slot.
- Parameters:
cls
- - the resource
- Returns:
- a collection of the paths from the resource to the root
getTemplateFacetValue
public static Object getTemplateFacetValue(Cls cls,
Slot slot,
String facetName)
getTemplateFacetValues
public static Collection getTemplateFacetValues(Cls cls,
Slot slot,
String facetName)
isVisibleInGUI
public static boolean isVisibleInGUI(Frame frame)
removeOwnSlotValue
public static void removeOwnSlotValue(Frame frame,
String slotName,
Object value)
setOwnSlotValue
public static void setOwnSlotValue(Frame frame,
String slotName,
Object value)
setOwnSlotValues
public static void setOwnSlotValues(Frame frame,
String slotName,
Collection values)
setTemplateFacetValue
public static void setTemplateFacetValue(Cls cls,
Slot slot,
String facetName,
Object value)
setTemplateFacetValues
public static void setTemplateFacetValues(Cls cls,
Slot slot,
String facetName,
Collection values)
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2011 Stanford University.