Package dev.roanh.gmark.util
Class SchemaGraph
The schema graph is a graph that has selectivity types
as its nodes. These nodes represent the combination of
some node type and some selectivity class. There are
directed labelled edges present between these selectivity
type nodes. These edges indicate that it is possible to
extend a path query with an edge with a certain label to
end up at the target selectivity type.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.roanh.gmark.util.UniqueGraph
UniqueGraph.GraphEdge<V,
E>, UniqueGraph.GraphNode<V, E> -
Field Summary
Modifier and TypeFieldDescriptionEfficient lookup index from selectivity type to graph node. -
Constructor Summary
ConstructorDescriptionSchemaGraph
(Schema schema) Constructs a new schema graph from the given schema. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Prints all the edges in the schema graph to the standard output.void
Prints all the nodes in the schema graph to the standard output.void
Removes all nodes (and associated edges) from the schema graph that are not reachable when drawing paths.resolve
(Type type, SelectivityClass sel) Resolves the given selectivity type presented as a type and selectivity class to the associated graph node adding a new node if required.Methods inherited from class dev.roanh.gmark.util.UniqueGraph
addUniqueEdge, addUniqueEdge, addUniqueEdge, addUniqueEdge, addUniqueEdge, addUniqueEdge, addUniqueEdge, addUniqueEdge, addUniqueNode, copy, getEdge, getEdge, getEdgeCount, getEdges, getNode, getNodeCount, getNodes, removeNodeIf, toAdjacencyList
-
Field Details
-
index
Efficient lookup index from selectivity type to graph node.
-
-
Constructor Details
-
SchemaGraph
Constructs a new schema graph from the given schema.- Parameters:
schema
- The graph schema to build the schema graph from.
-
-
Method Details
-
resolve
Resolves the given selectivity type presented as a type and selectivity class to the associated graph node adding a new node if required.- Parameters:
type
- The type of the selectivity type.sel
- The selectivity of the selectivity type.- Returns:
- The graph node associated with the given selectivity type.
-
removeUnreachable
public void removeUnreachable()Removes all nodes (and associated edges) from the schema graph that are not reachable when drawing paths. All valid paths should start at a node with a selectivity class ofSelectivityClass.ONE_ONE
orSelectivityClass.EQUALS
. Any node that is not reachable from a node with one of these selectivity classes is removed together with all the edges connected to it. -
printNodes
public void printNodes()Prints all the nodes in the schema graph to the standard output. -
printEdges
public void printEdges()Prints all the edges in the schema graph to the standard output.
-