5.3.0 • Published 5 years ago

@xgraph/q v5.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

graph-q

A query language over the @xgraph/core graph.

Usage

const q = require('graph-q');
const graph = require('./graph');

// get all User typed vertices from the graph
const { users } = q(graph)`(users:User)`;
// embedding raw values
const { users } = q(graph)`(users:${q.raw('User')})`;
// get all vertices who have incoming edges from vertex id foo
const { results } = q(graph)`(#foo)-->(results)`;
// get all User typed vertices from the graph
// with the username "foobar"
q(graph)`(users:User{username:"foobar"})`;
// get all resources that have an edge into them
// from User typed vertices
q(graph)`(:User)-->(r:Resource)`;
// get all resources that are owned by users
q(graph)`(:User)-[:owns]->(r:Resource)`;
// get all users who own a resource
q(graph)`(?users:User)-[:owns]->(:Resource)`;
q(graph)`(:Resource)<-[:owns]-(users:User)`;
// use advanced mongo-like filtering
q(graph)`
  (users:User{
    name: {
      $size: 4
    }
  })
`;
// pass query as a parameter
q(
  graph,
  `(users:User{
      name: {
        $size: 4
      }
    })`
);
5.3.0

5 years ago

5.2.2

5 years ago

5.2.1

5 years ago

5.2.0

5 years ago

5.1.0

5 years ago

5.0.1

5 years ago

4.4.1

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

1.1.1

5 years ago