Get started

Introduction to the Internet Yellow Pages.

This guide will show you how to retrieve and display data from IYP. Let's start simple.








References

:help MATCH :help WHERE :help Cypher

The below query finds which IXPs AS2497 is member of. Click on the icon to run the query:

 MATCH (iij:AS)-[:MEMBER_OF]-(ix:IXP) WHERE iij.asn = 2497 RETURN iij, ix

The MATCH clause describes a pattern in the graph.

The pattern is given in a ASCII art representation where nodes are depicted by a pair of parentheses, (), and relationship are depicted with two dashes -- sometimes including more information in square brackets -[]-.

Thus (iij:AS)-[:MEMBER_OF]-(ix:IXP) describes a path that starts from a node we'll call iij that connects to another node we'll call ix. iij and ix are arbitrary identifiers that allow us to refer to a certain node later on.

In IYP all nodes and relationships have a type (called labels for nodes) that convey what the nodes and relationships represent. The labels/types are given after the colon, for example (:AS) is a node representing an AS, and, -[:MEMBER_OF]- is relationship of type member of.

The WHERE clause describe conditions for nodes or relationship that match the pattern. Here we specify that the node called iij should have a property asn that equals to 2497.

The RETURN clause describes the nodes and links we want to display.

Title two

Same query different syntaxes

MATCH (iij:AS {asn: 2497})-->(ix:IXP) RETURN iij, ix
Find the produce suppliers.
CREATE INDEX ON :Category(categoryID)
CREATE INDEX ON :Supplier(supplierID)

More code

...

You can list all existing node labels and relationship types are by clicking on the top right database icon on this page. So putting all of this together, our pattern means that we are looking for links that connect an AS and an IXP with the relationship MEMBER_OF.