17. The non-transitory computer-readable medium of claim 16 , wherein clustering the plurality of inputs further comprises generating a linegraph for each merger input in the selected pair of merger inputs by: creating a linegraph node for each predicate edge in the set of predicate edges associated with the merger input; identifying pairs of linegraph nodes where for each identified pair of linegraph nodes the subject node or object node contained in the merger input graph pattern and connected by a first predicate in that identified pair of linegraph nodes and the subject node or object node contained in the merger input graph pattern and connected by a second predicate in that identified pair of linegraph nodes comprise a common variable; and creating linegraph edges between each identified pair of linegraph nodes.
17. The non-transitory computer-readable medium of claim 16 , wherein clustering the plurality of inputs further comprises generating a linegraph for each merger input in the selected pair of merger inputs by: creating a linegraph node for each predicate edge in the set of predicate edges associated with the merger input; identifying pairs of linegraph nodes where for each identified pair of linegraph nodes the subject node or object node contained in the merger input graph pattern and connected by a first predicate in that identified pair of linegraph nodes and the subject node or object node contained in the merger input graph pattern and connected by a second predicate in that identified pair of linegraph nodes comprise a common variable; and creating linegraph edges between each identified pair of linegraph nodes. 18. The non-transitory computer-readable storage medium of claim 17 , wherein clustering the plurality of inputs further comprises: reducing a number of nodes in the generated linegraphs; and using structural similarities among the nodes and edges of the generated linegraphs to determine if the merger input graphs patterns associated with the linegraphs should be merged.