Skip to content

dbs-leipzig/seraph-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Seraph query parser

An ANTLR4 parser for Seraph continuous graph queries.

This project is still under development.

Syntax

The syntax of Seraph extends the syntax of Cypher 9 as follows:

Usage example

Example query

REGISTER QUERY <query_name> STARTING AT 2019-09-07T15:50:30.022+01:00 {
MATCH (a) - [b] -> (c) WITHIN PT1H WHERE a = 1 OR b = 2
RETURN c
ON EXIT 
EVERY PT10M }

Resulting CQ-Object

id = <query_name>
starting_time = 2019-09-07T15:50:30.022+01:00
  match_clause:
      pattern = (a) - [b] -> (c)
      range = PT1H
      expression = a = 1 OR b = 2
  return_clause:
      expression = c
stream_operator = ON EXIT
range = PT10M

Using Java Methods

Create ContinuousQuery:

ContinuousQuery myQuery = QueryFactory.parse(queryString);

Get ID of ContinuousQuery:

myQuery.getId();    // <query_name>

Get match clause of ContinuousQuery:

ArrayList<MatchClause> matchClauses = myQuery.getMatchClauses();
matchClauses.get(0).getPattern();           // (a) - [b] -> (c)
matchClauses.get(0).getDuration();          // PT1H
matchClauses.get(0).getWhereExpression();   // a = 1 OR b = 2

Further application examples can be found in the Example class.

License

Licensed under the Apache License, Version 2.0.

About

A parser for Seraph continuous graph query language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published