Skip to content

Commit

Permalink
Add ido
Browse files Browse the repository at this point in the history
  • Loading branch information
lszeremeta committed Dec 14, 2018
1 parent 6692e67 commit d57895b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 50 deletions.
14 changes: 11 additions & 3 deletions yarspg/YARSpg.g4
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*
[The "BSD licence"]
Copyright (c) 2018, Łukasz Szeremeta (@ University of Bialystok, http://www.uwb.edu.pl/)
Copyright (c) 2018, Dominik Tomaszuk (@ University of Bialystok, http://www.uwb.edu.pl/)
Copyright (c) 2018, Karol Litman (@ University of Bialystok, http://www.uwb.edu.pl/)
All rights reserved.
Based on YARS grammar
Expand Down Expand Up @@ -38,7 +40,7 @@ declaration
;

nodeDeclaration
: node_label (':' node_label)* ':' '{' prop (',' prop)* '}'
: ido ('[' node_label (':' node_label)* ']')? ':' '{' prop (',' prop)* '}'
;

relationship
Expand All @@ -47,17 +49,21 @@ relationship
;

directed
: '(' node_label (':' node_label)* ')' '-' '[' relationship_label ('{' prop (',' prop)* '}')* ']' '->' '(' node_label (':' node_label)* ')'
: '(' ido ')' '-' '[' relationship_label ('{' prop (',' prop)* '}')* ']' '->' '(' ido ')'
;

undirected
: '(' node_label (':' node_label)* ')' '-' '[' relationship_label ('{' prop (',' prop)* '}')* ']' '-' '(' node_label (':' node_label)* ')'
: '(' ido ')' '-' '[' relationship_label ('{' prop (',' prop)* '}')* ']' '-' '(' ido ')'
;

relationship_label
: ALNUM_PLUS
;

ido
: ALNUM_PLUS
;

node_label
: ALNUM_PLUS
;
Expand Down Expand Up @@ -103,6 +109,8 @@ TRUE_FALSE
| 'false'
;

/* FROM TURTLE ANTLR GRAMMAR */

STRING_LITERAL_QUOTE
: '"' (~ ["\\\r\n] | '\'' | '\\"')* '"'
;
Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions yarspg/examples/declaration-with-relations-with-properties.yarspg

This file was deleted.

10 changes: 0 additions & 10 deletions yarspg/examples/declaration-with-relations.yarspg

This file was deleted.

24 changes: 12 additions & 12 deletions yarspg/examples/example.yarspg
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Author01:{fname:"Dominik",lname:"Tomaszuk"}
Author02:{fname:"Renzo",lname:"Angles"}
Entry01:InProceedings01:{title:"Serialization for...",numpages:10,keyword:"Graph database"}
Entry02:Article01:{title:"Property Graph...",numpages:10,keyword:["Query", "Graph"]}
Proceedings01:{title:"BDAS",year:2018,month:"May"}
Journal01:{title:"J. DB",year:2020,vol:30}
Author01[Author]:{fname:"John",lname:"Smith"}
Author02[Author]:{fname:"Alice",lname:"Brown"}
EI01[Entry:InProc]:{title:"Serialization for...", numpages:10,keyword:"Graph database"}
EA01[Entry:Article]:{title:"Property Graph...", numpages:10,keyword:["Query", "Graph"]}
Proc01[Proceedings]:{title:"BDAS",year:2018,month:"May"}
Jour01[Journal]:{title:"J. DB",year:2020,vol:30}

(Entry01:InProceedings01)-[has_author {order:1}]->(Author01)
(Entry01:InProceedings01)-[has_author {order:2}]->(Author02)
(Entry02:Article01)-[has_author {order:1}]->(Author02)
(Entry02:Article01)-[cites]->(Entry01:InProceedings01)
(Entry01:InProceedings01)-[booktitle {pages:"111-121"}]->(Proceedings01)
(Entry02:Article01)-[published_in {pages:"222-232"}]->(Journal01)
(EI01)-[has_author {order:1}]->(Author01)
(EI01)-[has_author {order:2}]->(Author02)
(EA01)-[has_author {order:1}]->(Author02)
(EA01)-[cites]->(EI01)
(EI01)-[booktitle {pages:"111-121"}]->(Proc01)
(EA01)-[published_in {pages:"222-232"}]->(Jour01)
5 changes: 0 additions & 5 deletions yarspg/examples/vertex-declaration-values.yarspg

This file was deleted.

0 comments on commit d57895b

Please sign in to comment.