Skip to content

Commit

Permalink
node_id and edge_id without " (ALNUM_PLUS)
Browse files Browse the repository at this point in the history
  • Loading branch information
lszeremeta committed Aug 21, 2020
1 parent c0532c1 commit a538ee0
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 80 deletions.
4 changes: 2 additions & 2 deletions other-notations/YARSpg.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ section ::= '%' SECTION_NAME
directed ::= '(' node_id ')' '-' '(' edge_id? ( '{' ( edge_label ( ',' edge_label )* )? '}' )? props_list? ')' '->' '(' node_id ')' graphs_list? annotations_list?
undirected
::= '(' node_id ')' '-' '(' edge_id? ( '{' ( edge_label ( ',' edge_label )* )? '}' )? props_list? ')' '-' '(' node_id ')' graphs_list? annotations_list?
node_id ::= STRING
node_id ::= ALNUM_PLUS
node_label
::= STRING
prop ::= key ':' value meta_prop*
edge_id ::= STRING
edge_id ::= ALNUM_PLUS
edge_label
::= STRING
graph_label
Expand Down
4 changes: 2 additions & 2 deletions yarspg/YARSpg.g4
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ undirected
;

node_id
: STRING
: ALNUM_PLUS
;

node_label
Expand All @@ -146,7 +146,7 @@ prop
;

edge_id
: STRING
: ALNUM_PLUS
;

edge_label
Expand Down
24 changes: 12 additions & 12 deletions yarspg/examples/canonical-real-example.yarspg
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ S("Entry")-({"cities"})->("Entry")
S("InProceedings")-({"booktitle"}["pages":String])->("Proceedings")
S("Article")-({"published_in"}["pages":String])->("Journal")
%NODES
("Author01"{"Author"}["fname":"John","lname":"Smith"])#Author01
("Author02"{"Author"}["fname":"Alice","lname":"Brown"])
("EI01"{"Entry","InProceedings"}["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])
(Author01{"Author"}["fname":"John","lname":"Smith"])#Author01
(Author02{"Author"}["fname":"Alice","lname":"Brown"])
(EI01{"Entry","InProceedings"}["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])
%EDGES
("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")
(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)
24 changes: 12 additions & 12 deletions yarspg/examples/real-example.yarspg
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ S("InProceedings")-({"booktitle"}["pages": String])->("Proceedings")
S("Article")-({"published_in"}["pages": String])->("Journal")

# Nodes
("Author01" {"Author"}["fname": "John", "lname": "Smith"]) #Author01
("Author02" {"Author"}["fname": "Alice", "lname": "Brown"])
("EI01" {"Entry", "InProceedings"}["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])
(Author01 {"Author"}["fname": "John", "lname": "Smith"]) #Author01
(Author02 {"Author"}["fname": "Alice", "lname": "Brown"])
(EI01 {"Entry", "InProceedings"}["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])

# Edge
("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")
(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)
104 changes: 52 additions & 52 deletions yarspg/examples/test-example.yarspg
Original file line number Diff line number Diff line change
Expand Up @@ -32,89 +32,89 @@ $graph2_prop = "prop2": "Abc"@"ok": false
% NODES
% NODE SCHEMAS
$var44 = "aa1a":true,"a2aa":"text"
("a" {"a1d","x"}[$var44,"aa3aa":null])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
("a" {"a1d","x"}["aa1a":true,"a2aa":"text","aa3aa":null])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
("b43b" {}[])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk"] #b43b
("b43b" {"label1"}["value":5])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk"] #b43b
(a {"a1d","x"}[$var44,"aa3aa":null])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
(a {"a1d","x"}["aa1a":true,"a2aa":"text","aa3aa":null])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
(b43b {}[])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk"] #b43b
(b43b {"label1"}["value":5])+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk"] #b43b
S({}[])/"graph2"/
$var44_schema = "value": String,"lang": String
S({"label333","c"}[$var44_schema,"valid": Bool])/"graph2"/+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>, foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation", "cdf": "fgh", foaf:maker: <http://example.com/me>]
S({"label333","c"}["value": String,"lang": String,"valid": Bool ID])/"graph2"/+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>, foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation", "cdf": "fgh", foaf:maker: <http://example.com/me>]
S({"label333","c"}["value": String ID,"lang": String,"valid": Bool])/"graph2"/+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>, foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation", "cdf": "fgh", foaf:maker: <http://example.com/me>]
("c" {"label333","c"}["value":"male","lang":"en","valid":false])/"graph2", "graph3"/+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>, foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation", "cdf": "fgh", foaf:maker: <http://example.com/me>]
(c {"label333","c"}["value":"male","lang":"en","valid":false])/"graph2", "graph3"/+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>, foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation", "cdf": "fgh", foaf:maker: <http://example.com/me>]
S({"label546"}["key": Float])
S({"label546"}["key": Float ID])
("d" {"label546"}["key":.1333])
("d" {"label546"}["key":.1333e+5])
("d" {"label546"}["key":1333E-2])
("d" {"label546"}["key":442.1333])
(d {"label546"}["key":.1333])
(d {"label546"}["key":.1333e+5])
(d {"label546"}["key":1333E-2])
(d {"label546"}["key":442.1333])
S({"label546"}["key": Float@"source": String])
("d" {"label546"}["key":442.1333@"source": "XZYNews"])
("e" {"ef22","y","v"}["key44":[true,false,"some text", null, 11, 11.2231]])
("f" ["node":"node without label"])+[foaf:maker: <http://example.com/me>]
("g" {"df2","z","q"}["key664":[false,["another list", 52, 44.1]]])+["abc": "value33"]
("h" {"label"}["key664":[false,["another list2", ["another list3", 54, false, true] , 52, 44.1]]])
("h" {"label"}["key664":[false,["another list2"@"info": {"source": "ABC", "trust": "XYZ"}, ["another list3", 54, false, true] , 52, 44.1]]])
("h" {"label"}["key664":[false,["another list2"@"info": {"source": "ABC", "trust": "XYZ"}, ["another list3", 54, false, true]@"access": [0, 1, 1, 0] @"ok": true, 52, 44.1]@"good": false]])
(d {"label546"}["key":442.1333@"source": "XZYNews"])
(e {"ef22","y","v"}["key44":[true,false,"some text", null, 11, 11.2231]])
(f ["node":"node without label"])+[foaf:maker: <http://example.com/me>]
(g {"df2","z","q"}["key664":[false,["another list", 52, 44.1]]])+["abc": "value33"]
(h {"label"}["key664":[false,["another list2", ["another list3", 54, false, true] , 52, 44.1]]])
(h {"label"}["key664":[false,["another list2"@"info": {"source": "ABC", "trust": "XYZ"}, ["another list3", 54, false, true] , 52, 44.1]]])
(h {"label"}["key664":[false,["another list2"@"info": {"source": "ABC", "trust": "XYZ"}, ["another list3", 54, false, true]@"access": [0, 1, 1, 0] @"ok": true, 52, 44.1]@"good": false]])
S({"label"}["keyword": Struct(String)])
("i" {"label"}["keyword": {"name": "abc", "title": "xyz"}])
(i {"label"}["keyword": {"name": "abc", "title": "xyz"}])
S({"label"}["keyword": Struct(String)@"ok": Integer])
("i" {"label"}["keyword": {"name": "abc"@"info": "ok", "title": "xyz"}@"ok": 1])
(i {"label"}["keyword": {"name": "abc"@"info": "ok", "title": "xyz"}@"ok": 1])
S({"2label4"}["keyword2": Struct(Struct(String))])
("2i44" {"2label4"}["keyword2": {"names": {"name": "abc", "title": "xyz"}, "names2": {"name2": "abc2", "title2": "xyz2"}, "names3": {"name3": "abc3", "title3": "xyz3"}}])
(2i44 {"2label4"}["keyword2": {"names": {"name": "abc", "title": "xyz"}, "names2": {"name2": "abc2", "title2": "xyz2"}, "names3": {"name3": "abc3", "title3": "xyz3"}}])
S({"2label4"}["keyword2": Struct(Struct(String)@"struct": String)@"struct": String @"ok": Bool])
("2i44" {"2label4"}["keyword2": {"names": {"name": "abc", "title": "xyz"}@"rating": 5, "names2": {"name2": "abc2"@"more": "ok", "title2": "xyz2"}, "names3": {"name3": "abc3", "title3": "xyz3"}@"struct": "inside"}@"struct": "outside" @"ok": true])
("i2" {"label"}["keyword": {"name": "abc", "title": {"name2": "abc2", "title2": "xyz2"}}])
(2i44 {"2label4"}["keyword2": {"names": {"name": "abc", "title": "xyz"}@"rating": 5, "names2": {"name2": "abc2"@"more": "ok", "title2": "xyz2"}, "names3": {"name3": "abc3", "title3": "xyz3"}@"struct": "inside"}@"struct": "outside" @"ok": true])
(i2 {"label"}["keyword": {"name": "abc", "title": {"name2": "abc2", "title2": "xyz2"}}])
S({"432f"}["set": Set(String)])/"graphname"/
("z" {"432f"}["set": {"name", "title"}])/"graphname"/
("z" {"432f"}["set": {"name", "title"}@"test":"test3"])/"graphname"/
(z {"432f"}["set": {"name", "title"}])/"graphname"/
(z {"432f"}["set": {"name", "title"}@"test":"test3"])/"graphname"/
S({"432f2"}["set": Set(Set(String))])
("z2" {"432f2"}["set": {{"set2", "title"}}])
(z2 {"432f2"}["set": {{"set2", "title"}}])
S({"3432f2"}["set": Set(Set(String))])
("3z2" {"3432f2"}["set": {{"set2", "title"}, {"set3", "title3"}}])
(3z2 {"3432f2"}["set": {{"set2", "title"}, {"set3", "title3"}}])
S({"1ad32"}["list": List(String)])
("1dsc" {"1ad32"}["list": ["name55", "name3"]])
(1dsc {"1ad32"}["list": ["name55", "name3"]])
S({"1ad32"}["list": List(String NULL)])
("1dsc" {"1ad32"}["list": ["name55", null]])
(1dsc {"1ad32"}["list": ["name55", null]])
S({"1ad32"}["list": List(String) NULL])
("1dsc" {"1ad32"}["list": null])
(1dsc {"1ad32"}["list": null])
S({"ad3"}["list": List(List(String))])
("ds" {"ad3"}["list": [["name55", "name3"]]])
(ds {"ad3"}["list": [["name55", "name3"]]])
S({"ad32"}["list": List(List(String))])
("dsc" {"ad32"}["list": [["name55", "name3"], ["name11", "name2"]]])
(dsc {"ad32"}["list": [["name55", "name3"], ["name11", "name2"]]])

S({"ZYT"}["date": Date])
S({"ZYT2"}["time": Time])
S({"ZYT3"}["timezp": Time])
S({"ZYT4"}["timezm": Time])
S({"ZYT5"}["datetime": DateTime])
("ABC" {"ZYT"}["date": 1999-01-01])
("ABC2" {"ZYT2"}["time": 11:15:32])
("ABC3" {"ZYT3"}["timezp": 11:15:32+01:30])
("ABC4" {"ZYT4"}["timezm": 09:32:11-08:00])
("ABC5" {"ZYT5"}["datetime": 1999-01-01T11:15:32])
("ABC5" {"ZYT5"}["datetimetzp": 1999-01-01T11:15:32+01:30])
("ABC5" {"ZYT5"}["datetimetzm": 1999-01-01T11:15:32-08:00])
(ABC {"ZYT"}["date": 1999-01-01])
(ABC2 {"ZYT2"}["time": 11:15:32])
(ABC3 {"ZYT3"}["timezp": 11:15:32+01:30])
(ABC4 {"ZYT4"}["timezm": 09:32:11-08:00])
(ABC5 {"ZYT5"}["datetime": 1999-01-01T11:15:32])
(ABC5 {"ZYT5"}["datetimetzp": 1999-01-01T11:15:32+01:30])
(ABC5 {"ZYT5"}["datetimetzm": 1999-01-01T11:15:32-08:00])

% EDGES
% EDGE SCHEMAS
S("a1d")-({}[])->("label333")
S("a1d")-({"aaa1a"}["key": String, "aab2bc": List(Integer)])->("label333")
S("a1d")-({"aaa1a"}["key": String ID, "aab2bc": List(Integer)])->("label333")
("a")-("ferf" {}[])->("c")
("a")-("ferf" {"aaa1a"}["key": "value", "aab2bc": [44, 22]])->("c")+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>]
(a)-(ferf {}[])->(c)
(a)-(ferf {"aaa1a"}["key": "value", "aab2bc": [44, 22]])->(c)+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>]
$var_e344 = "aab2bc": [44, 22]@"list name": "alph"
("a")-("ferf" {"aaa1a"}["key": "value"@"ok": "no", $var_e344])->("c")+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>]
("a")-("ferf" {"aaa1a"}["key": "value"@"ok": "no", "aab2bc": [44, 22]@"list name": "alph"])->("c")+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>]
("a")-("id341" {"aaa2a"})->("c")
(a)-(ferf {"aaa1a"}["key": "value"@"ok": "no", $var_e344])->(c)+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>]
(a)-(ferf {"aaa1a"}["key": "value"@"ok": "no", "aab2bc": [44, 22]@"list name": "alph"])->(c)+[<http://xmlns.com/dc/0.5/zyz>: <http://xmlns.com/dc/0.5/qtv>]
(a)-(id341 {"aaa2a"})->(c)
S("label1")-({"bbb23b"})-("ef22")
("b43b")-({"bbb23b"})-("e")
(b43b)-({"bbb23b"})-(e)
$var_234e_schema = "bbbd32d": Bool ID
S("label1")-({"bbb23b"}["bbbd32d": Bool, "value": String NULL])-("ef22")
S("label1")-({"bbb23b"}[$var_234e_schema, "value": String NULL])-("ef22")
S("label1")-({"bbb23b"}["bbbd32d": Bool ID, "value": String NULL])-("ef22")
("b43b")-({"bbbb53b"}["bbbd32d": false, "value": null])-("e")+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
("b43b")-({"bbbb53b"}["bbbd32d": false, "value": null@"psod": {"dff": 1, "ewf": 55}])-("e")+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
(b43b)-({"bbbb53b"}["bbbd32d": false, "value": null])-(e)+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]
(b43b)-({"bbbb53b"}["bbbd32d": false, "value": null@"psod": {"dff": 1, "ewf": 55}])-(e)+[foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", <http://xmlns.com/dc/0.5/zyz>: "Test annotation"]

S("A")-({"label"}["date": Date])->("Z")
S("A2")-({"label2"}["time": Time])->("Z2")
Expand All @@ -124,10 +124,10 @@ S("A5")-({"label5"}["datetime": DateTime])->("Z5")
S("A5")-({"label5"}["datetime": DateTime ID])->("Z5")
S("A6")-({"label6"}["datetimetzp": DateTime])->("Z6")
S("A7")-({"label7"}["datetimetzm": DateTime])->("Z7")
("ABC")-({"label"}["date": 1999-01-01])->("XYZ")
("ABC2")-({"label2"}["time": 11:15:32])->("XYZ2")
("ABC3")-({"label3"}["timezp": 11:15:32+01:30])->("XYZ3")
("ABC4")-({"label4"}["timezm": 09:32:11-08:00])->("XYZ4")
("ABC5")-({"label5"}["datetime": 1999-01-01T11:15:32])->("XYZ5")
("ABC6")-({"label6"}["datetimetzp": 1999-01-01T11:15:32+01:30])->("XYZ6")
("ABC7")-({"label7"}["datetimetzm": 1999-01-01T11:15:32-08:00])->("XYZ7")
(ABC)-({"label"}["date": 1999-01-01])->(XYZ)
(ABC2)-({"label2"}["time": 11:15:32])->(XYZ2)
(ABC3)-({"label3"}["timezp": 11:15:32+01:30])->(XYZ3)
(ABC4)-({"label4"}["timezm": 09:32:11-08:00])->(XYZ4)
(ABC5)-({"label5"}["datetime": 1999-01-01T11:15:32])->(XYZ5)
(ABC6)-({"label6"}["datetimetzp": 1999-01-01T11:15:32+01:30])->(XYZ6)
(ABC7)-({"label7"}["datetimetzm": 1999-01-01T11:15:32-08:00])->(XYZ7)

0 comments on commit a538ee0

Please sign in to comment.