Querying Triples
Basic Queries
# Find all facts about Alice
query {
triples(where: { subjectId: "alice_atom_id" }) {
predicate
object {
data
}
}
}
# Find all friendship relationships
query {
triples(where: { predicate: "isFriendOf" }) {
subject { data }
object { data }
}
}
Traversing the Graph
# Find where Alice's friends live
query {
triples(where: {
subjectId: "alice_atom_id",
predicate: "isFriendOf"
}) {
object {
triples(where: { predicate: "livesIn" }) {
object { data }
}
}
}
}