Data and Tools‎ > ‎

Metagraph Query Format

A metagraph query file describes a list of metagraphs of a larger input graph. The query file is part of the input to the subgraph matching algorithm SubMatch, which queries the larger input graph using each metagraph and outputs the instances of each metagraph. The definition and details of metagraph can be found in our paper:

Y. Fang, W. Lin, V. W. Zheng, M. Wu, K. C.-C. Chang and X. Li. Semantic Proximity Search on Graphs with Metagraph-based Learning. In ICDE 2016, pp. 277--288. [PDF] [BibTex]

The file is a space delimited text file, as illustrated in the sample below.

t #
v 0 0
v 1 1
v 2 0
e 0 1 0
e 1 2 0
a 0 2
a 1
a 0 2
t #
v 0 0
v 1 1
v 2 0
v 3 1
e 0 1 0
e 1 2 0
e 2 3 0
a 0
a 1
a 2
a 3

Each metagraph begins with a header line starting with "t #". In other words, two metagraphs are separated by this header line.

Each of the next few lines starting with "v" or "e" represents a node or edge, respectively, with the same specification as explained in the Labeled Graph Format.

Each of the subsequent lines starting with "a" represents the symmetry information of the metagraph: a <NodeID> <NodeID> .... Each node n would have a corresponding "a" line, which lists the NodeID of all nodes that are symmetric to n. Refer to our citation above for the definition of symmetry.