In apacheAGE we are not dealing with tables, but with nodes and edges.
Those nodes/edges hold information though their labels and/or properties. For example :
SELECT * FROM cypher('test_graph', $$
CREATE (u:Person {name: 'John'})
CREATE (v:Person {name: 'Jake'})
CREATE (k:Person {name: 'Alice'})
CREATE (l:Person {name: 'Anna'}) $$)
AS (u agtype);
Here we create 4 different nodes with Person
as the label, and their respective name
as property. If we want to find a node through its label we can do:
SELECT * FROM cypher ('test_graph', $$
MATCH (u:Person)
RETURN u $$)
as (u agtype);
This will return all the nodes in our graph that belong to the Person
label. Similarly we can filter through a property of a node for example:
SELECT * FROM cypher ('test_graph', $$
MATCH (u:Person)
WHERE u.name = 'John'
RETURN u $$)
as (u agtype);
Here this will return only the nodes that have the property name
and it equals 'John'
.