All Projects → oracle → Pgql Lang

oracle / Pgql Lang

Licence: other
PGQL is an SQL-based query language for the Property Graph data model

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Pgql Lang

Eliasdb
EliasDB a graph-based database.
Stars: ✭ 611 (+435.96%)
Mutual labels:  graphql, query-language, graph-database
grafito
Portable, Serverless & Lightweight SQLite-based Graph Database in Arturo
Stars: ✭ 95 (-16.67%)
Mutual labels:  graph-database, query-language
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+11470.18%)
Mutual labels:  graphql, oracle
Jseg
A super simple, in-memory, JS graph database.
Stars: ✭ 344 (+201.75%)
Mutual labels:  graphql, graph-database
Graphik
Graphik is a Backend as a Service implemented as an identity-aware document & graph database with support for gRPC and graphQL
Stars: ✭ 277 (+142.98%)
Mutual labels:  graphql, graph-database
Hypergraphql
GraphQL interface for querying and serving linked data on the Web.
Stars: ✭ 120 (+5.26%)
Mutual labels:  graphql, query-language
Dgraph
Native GraphQL Database with graph backend
Stars: ✭ 17,127 (+14923.68%)
Mutual labels:  graphql, graph-database
Grakn
TypeDB: a strongly-typed database
Stars: ✭ 2,947 (+2485.09%)
Mutual labels:  query-language, graph-database
Neo4j Graphql
GraphQL bindings for Neo4j, generates and runs Cypher
Stars: ✭ 429 (+276.32%)
Mutual labels:  graphql, graph-database
Openrecord
Make ORMs great again!
Stars: ✭ 474 (+315.79%)
Mutual labels:  graphql, oracle
Atomspace
The OpenCog (hyper-)graph database and graph rewriting system
Stars: ✭ 495 (+334.21%)
Mutual labels:  query-language, graph-database
Askql
AskQL is a query language that can express any data request
Stars: ✭ 352 (+208.77%)
Mutual labels:  graphql, query-language
Neo4j Python Driver
Neo4j Bolt driver for Python
Stars: ✭ 607 (+432.46%)
Mutual labels:  query-language, graph-database
Hypergraphql
GraphQL interface for querying and serving linked data on the Web.
Stars: ✭ 112 (-1.75%)
Mutual labels:  graphql, query-language
Kubeiql
A GraphQL interface for Kubernetes.
Stars: ✭ 112 (-1.75%)
Mutual labels:  graphql
Crudl Example Django
CRUDL with Django, DRF/Graphene and SQLite
Stars: ✭ 113 (-0.88%)
Mutual labels:  graphql
Pragma
Build GraphQL APIs In No Time
Stars: ✭ 111 (-2.63%)
Mutual labels:  graphql
Nestjs Graphql
nest-js starter which implement graphql module
Stars: ✭ 111 (-2.63%)
Mutual labels:  graphql
Graphql Codegen Hasura
code-generator plugins for hasura/apollo-gql/typescript development
Stars: ✭ 113 (-0.88%)
Mutual labels:  graphql
Graphql Metrics
Extract as much much detail as you want from GraphQL queries, served up from your Ruby app and the graphql gem.
Stars: ✭ 113 (-0.88%)
Mutual labels:  graphql

PGQL - Property Graph Query Language

PGQL is an SQL-based query language for the property graph data model, bringing graph pattern matching capabilities to SQL and NoSQL users.

See the website for a language specification and any newsworthy updates:

PGQL Home

PGQL Parser and Static Query Validator

This Git repository contains a parser for PGQL with the following features:

  • Easy-to-understand IR: Given a query string, the parser returns an easy-to-understand intermediate representation (IR) of the query as a set of Java objects

  • Query validation: built-in to the parser is a static query validator that provides meaningful caret-style (e.g. ^^^) error messages:

    Example 1

    SELECT n.name, o.name
      FROM MATCH (n) -[e]-> (m)
    
    Error(s) in line 1:
    
        SELECT n.name, o.name
                       ^
        Unresolved variable
    

    Example 2

    SELECT AVG(n.age), n
      FROM MATCH (n:Person)
    
    Error(s) in line 1:
    
        SELECT AVG(n.age), n
                           ^
        Aggregation expected here since SELECT has other aggregation
    
  • Pretty printing: invoking GraphQuery.toString() will "pretty print" the graph query, which turns unformatted queries into formatted ones:

    SELECT n.name FROM MATCH
    (n:Person) WHERE n.name = 'Anthony'
    OR n.name = 'James'
    
    SELECT n.name
      FROM MATCH (n:person)
     WHERE n.name = 'Anthony'
        OR n.name = 'James'
    
  • Code completion: given a (partial) query string and a cursor position, the parser can suggest a set of code completions, including built-in functions, labels and properties. These completions can for example be used by an interactive web editor. By providing the parser with metadata about the graph (existing properties and labels), the completions will also include label and property suggestions.

Build and Install the Parser

PGQL's parser can be built on Linux, macOS or Window.

First install JDK 1.8 or higher and Maven 3.5.4 or higher. Then, follow these instructions:

On Linux or macOS:

  • Build and install to your local Maven repository by running sh install.sh

On Windows:

  • Open System Properties and add a new variable JAVA_OPTS with value -Xms512m -Xmx1024m -Xss16m
  • Build and install to your local Maven repository by running install_on_windows.bat

Getting Started

After you have installed the parser like explained above, parse two example queries:

  • On Linux or macOS execute cd example; sh run.sh
  • On Windows execute:
    cd example
    mvn clean package exec:java -Dexec.mainClass="oracle.pgql.lang.example.Main" -Dexec.cleanupDaemonThreads=false
    
public class Main {

  public static void main(String[] args) throws PgqlException {

    try (Pgql pgql = new Pgql()) {

      // parse query and print graph query
      PgqlResult result1 = pgql.parse("SELECT n FROM MATCH (n:Person) -[e:likes]-> (m:Person) WHERE n.name = 'Dave'");
      System.out.println(result1.getPgqlStatement());

      // parse query with errors and print error messages
      PgqlResult result2 = pgql.parse("SELECT x, y, FROM MATCH (n) -[e]-> (m)");
      System.out.println(result2.getErrorMessages());

    }
  }
}

The AST returned by the parser is a GraphQuery object. This would be the input to your query planner.

Documentation

See PGQL 1.3 Specification.

Development

  • Download Eclipse with Spoofax 2.5.11 pre-installed here
  • Import the following projects into Eclipse (File>Import...>Maven>Existing Maven Projects>Browse...):
    • graph-query-ir: Java representation of graph queries
    • pqgl-spoofax: Spoofax implementation of PGQL (parser + error checks)
    • pgql-lang: translation of Spoofax AST into graph-query-ir

Contributions

PGQL is an open source project. See Contributing for details.

Oracle gratefully acknowledges the contributions to PGQL made by the community.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].