Package dev.roanh.gmark.lang.cpq
Class QueryGraphCPQ.PartialMap
java.lang.Object
dev.roanh.gmark.lang.cpq.QueryGraphCPQ.PartialMap
- Enclosing class:
- QueryGraphCPQ
Object used to store partial mapping required for the
query homomorphism testing algorithm.
-
Field Summary
Modifier and TypeFieldDescriptionprivate List<QueryGraphCPQ.QueryGraphComponent>
The left hand side of the map, this is the side of the map with graph parts that need to be matched to equivalent parts in the other graph.private QueryGraphCPQ.Row[]
The parts of the other graph that are equivalent to theleft
part of the original graph. -
Constructor Summary
ModifierConstructorDescriptionprivate
Constructs a new partial map with the given set of graph parts to match to parts of the other graph. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
semiJoin
(QueryGraphCPQ.PartialMap other) Performs a natural left semi join of this partial map with the given other partial map.private void
Performs a natural left semi join of this partial map with the given other partial map.private void
sort()
Sorts the relation for this map on attribute names.private int
swap
(int i, int j) toString()
-
Field Details
-
left
The left hand side of the map, this is the side of the map with graph parts that need to be matched to equivalent parts in the other graph. This list essentially represents the attribute names of the relation for this map. -
matches
The parts of the other graph that are equivalent to theleft
part of the original graph. This array is essentially a list of rows in the relation, each representing a valid way of mapping all attributes.
-
-
Constructor Details
-
PartialMap
Constructs a new partial map with the given set of graph parts to match to parts of the other graph.- Parameters:
left
- The parts of the graph to match for.
-
-
Method Details
-
sort
private void sort() -
swap
private int swap(int i, int j) - Parameters:
i
- The first element position.j
- The second element position.- Returns:
- The
QueryGraphCPQ.QueryGraphComponent.getID()
of the element originally at the j-th position.
-
semiJoinSingle
Performs a natural left semi join of this partial map with the given other partial map. This is effectively a filtering operation where anything in this map is dropped if it does not have any overlap with at least one list in the given other partial map. The result of the semi join is stored in this map. Both maps are required to be sorted before running this join.- Parameters:
other
- The other partial map to join with.- See Also:
-
semiJoin
Performs a natural left semi join of this partial map with the given other partial map. This is effectively a filtering operation where anything in this map is dropped if it does not have any overlap with at least one list in the given other partial map. The result of the semi join is stored in this map. Both maps are required to be sorted before running this join.Information about attributes from the given other map that did not appear in this map is also collected and attached to the rows in the
matches
stored at this map. As a result this join makes it possible to reconstruct complete graph homomorphism mappings.- Parameters:
other
- The other partial map to join with.- See Also:
-
toString
-