Package org.eclipse.epsilon.emc.graphml
Class GraphmlImporter
- java.lang.Object
-
- org.eclipse.epsilon.emc.graphml.GraphmlImporter
-
public class GraphmlImporter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected GraphmlConfiguration
configuration
protected Muddle
graph
protected org.jdom.Element
graphElement
protected org.jdom.Namespace
namespace
protected java.util.HashMap<MuddleElement,org.jdom.Element>
nodeElementMap
protected java.util.HashMap<java.lang.String,MuddleElement>
nodeMap
protected java.util.List<OrphanLink>
orphanEdges
protected java.util.List<MuddleElement>
referenceNodes
-
Constructor Summary
Constructors Constructor Description GraphmlImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addEdgeNodeToNode(MuddleElement edgeNode, MuddleElement node, Feature prototype)
protected void
addNodeToEdgeNode(MuddleElement edgeNode, MuddleElement node, Feature prototype)
protected Slot
addSlot(MuddleElement node, Feature prototype)
protected Feature
addSlotPrototype(MuddleElementType nodeType, Feature prototype)
protected void
adjustSlotPrototypeMultiplicitiesAndSlotValueTypes()
If single-valued slots are found to have multiple values, adjust the multiplicity accordingly.protected void
annihilate(MuddleElement node)
protected java.lang.Object
cast(java.lang.Object object, Type type)
protected Feature
clone(Feature prototype)
protected Feature
createEdgeTypeSlotPrototype(MuddleElement edgeNode, java.lang.String key)
protected void
createPrimaryPrototypeSlot(MuddleElement node, org.jdom.Element element, java.lang.String defaultSlotPrototypeNameKey)
protected LinkElementType
edgeTypeForName(java.lang.String name)
protected MuddleElement
findReferenceTarget(MuddleElement referenceNode)
protected Slot
findSlot(MuddleElement node, Feature slotPrototype)
protected Slot
findSuitableSlot(MuddleElement source, MuddleElement target)
protected Feature
findSuitableSlotPrototype(MuddleElementType type, MuddleElement value)
GraphmlConfiguration
getConfiguration()
protected java.util.List<org.jdom.Element>
getDescendants(org.jdom.Element node, java.lang.String name)
protected java.util.List<org.jdom.Element>
getEdgeElements()
protected java.lang.String
getElementData(org.jdom.Element e, java.lang.String key)
protected org.jdom.Element
getFirstAncestor(org.jdom.Element element, java.lang.String name)
protected java.lang.String
getFirstLabel(org.jdom.Element e)
protected java.util.List<java.lang.String>
getLabels(java.lang.String s)
protected java.util.List<java.lang.String>
getLabels(org.jdom.Element e)
protected java.lang.String
getNodeData(MuddleElement node, java.lang.String key)
protected java.util.List<org.jdom.Element>
getNodeElements()
protected Feature
getOrCreateFeature(MuddleElementType type, java.lang.String featureName)
protected Slot
getPrimarySlot(MuddleElement node)
Muddle
importGraph(java.io.File file)
Muddle
importGraph(java.lang.String uri)
protected boolean
isReferenceLabel(java.lang.String label)
protected boolean
isSlotValueLabel(java.lang.String label)
protected boolean
matches(MuddleElement node, MuddleElement referenceNode)
protected MuddleElementType
nodeTypeForName(java.lang.String name)
protected void
populateGraph()
protected void
populateSlots(MuddleElement node, org.jdom.Element element)
protected MuddleElementType
typeForName(java.lang.String name, boolean edgeType)
-
-
-
Field Detail
-
graph
protected Muddle graph
-
nodeMap
protected java.util.HashMap<java.lang.String,MuddleElement> nodeMap
-
nodeElementMap
protected java.util.HashMap<MuddleElement,org.jdom.Element> nodeElementMap
-
graphElement
protected org.jdom.Element graphElement
-
namespace
protected org.jdom.Namespace namespace
-
orphanEdges
protected java.util.List<OrphanLink> orphanEdges
-
configuration
protected GraphmlConfiguration configuration
-
referenceNodes
protected java.util.List<MuddleElement> referenceNodes
-
-
Method Detail
-
importGraph
public Muddle importGraph(java.io.File file) throws java.lang.Exception
- Throws:
java.lang.Exception
-
importGraph
public Muddle importGraph(java.lang.String uri) throws java.lang.Exception
- Throws:
java.lang.Exception
-
populateGraph
protected void populateGraph()
-
getOrCreateFeature
protected Feature getOrCreateFeature(MuddleElementType type, java.lang.String featureName)
-
createEdgeTypeSlotPrototype
protected Feature createEdgeTypeSlotPrototype(MuddleElement edgeNode, java.lang.String key)
-
addNodeToEdgeNode
protected void addNodeToEdgeNode(MuddleElement edgeNode, MuddleElement node, Feature prototype)
-
addEdgeNodeToNode
protected void addEdgeNodeToNode(MuddleElement edgeNode, MuddleElement node, Feature prototype)
-
getNodeData
protected java.lang.String getNodeData(MuddleElement node, java.lang.String key)
-
populateSlots
protected void populateSlots(MuddleElement node, org.jdom.Element element)
-
createPrimaryPrototypeSlot
protected void createPrimaryPrototypeSlot(MuddleElement node, org.jdom.Element element, java.lang.String defaultSlotPrototypeNameKey)
-
getElementData
protected java.lang.String getElementData(org.jdom.Element e, java.lang.String key)
-
annihilate
protected void annihilate(MuddleElement node)
-
findReferenceTarget
protected MuddleElement findReferenceTarget(MuddleElement referenceNode)
-
matches
protected boolean matches(MuddleElement node, MuddleElement referenceNode)
-
findSlot
protected Slot findSlot(MuddleElement node, Feature slotPrototype)
-
adjustSlotPrototypeMultiplicitiesAndSlotValueTypes
protected void adjustSlotPrototypeMultiplicitiesAndSlotValueTypes()
If single-valued slots are found to have multiple values, adjust the multiplicity accordingly. Also, adjust the type of slot values
-
cast
protected java.lang.Object cast(java.lang.Object object, Type type)
-
findSuitableSlot
protected Slot findSuitableSlot(MuddleElement source, MuddleElement target)
-
findSuitableSlotPrototype
protected Feature findSuitableSlotPrototype(MuddleElementType type, MuddleElement value)
-
isReferenceLabel
protected boolean isReferenceLabel(java.lang.String label)
-
isSlotValueLabel
protected boolean isSlotValueLabel(java.lang.String label)
-
addSlot
protected Slot addSlot(MuddleElement node, Feature prototype)
-
addSlotPrototype
protected Feature addSlotPrototype(MuddleElementType nodeType, Feature prototype)
-
getPrimarySlot
protected Slot getPrimarySlot(MuddleElement node)
-
getFirstLabel
protected java.lang.String getFirstLabel(org.jdom.Element e)
-
getLabels
protected java.util.List<java.lang.String> getLabels(org.jdom.Element e)
-
getFirstAncestor
protected org.jdom.Element getFirstAncestor(org.jdom.Element element, java.lang.String name)
-
getLabels
protected java.util.List<java.lang.String> getLabels(java.lang.String s)
-
getDescendants
protected java.util.List<org.jdom.Element> getDescendants(org.jdom.Element node, java.lang.String name)
-
getNodeElements
protected java.util.List<org.jdom.Element> getNodeElements()
-
getEdgeElements
protected java.util.List<org.jdom.Element> getEdgeElements()
-
edgeTypeForName
protected LinkElementType edgeTypeForName(java.lang.String name)
-
nodeTypeForName
protected MuddleElementType nodeTypeForName(java.lang.String name)
-
typeForName
protected MuddleElementType typeForName(java.lang.String name, boolean edgeType)
-
getConfiguration
public GraphmlConfiguration getConfiguration()
-
-