From 19f9dc12032d1e03d1c63dd02ceb8d23896aa8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Szeremeta?= Date: Mon, 3 Aug 2020 20:06:29 +0200 Subject: [PATCH] Add id_keys --- yarspg/YARSpg.g4 | 6 +++++- yarspg/examples/test-example.yarspg | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/yarspg/YARSpg.g4 b/yarspg/YARSpg.g4 index 83f386e..43d3f15 100644 --- a/yarspg/YARSpg.g4 +++ b/yarspg/YARSpg.g4 @@ -170,7 +170,11 @@ prop_list_schema ; prop_schema - : key ':' value_schema + : key ':' value_schema id_key? + ; + +id_key + : 'ID' ; value_schema diff --git a/yarspg/examples/test-example.yarspg b/yarspg/examples/test-example.yarspg index 30ad687..ce95606 100644 --- a/yarspg/examples/test-example.yarspg +++ b/yarspg/examples/test-example.yarspg @@ -22,12 +22,14 @@ S{"label333","c"}["value": String,"lang": String,"valid": Bool]/"graph2"/+: , foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", : "Test annotation", "cdf": "fgh", foaf:maker: <"c">{"label333","c"}["value":"male","lang":"en","valid":false]/"graph2", "graph3"/+: , foaf:maker: "Łukasz Szeremeta and Dominik Tomaszuk", : "Test annotation", "cdf": "fgh", foaf:maker: S{"label546"}["key": Float] +S{"label546"}["key": Float ID] <"d">{"label546"}["key":442.1333] <"e">{"ef22","y","v"}["key44":[true,false,"some text", null, 11, 11.2231]] <"f">["node":"node without label"]+foaf:maker: <"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]]] S{"label"}["keyword": Struct(String)] +S{"label"}["keyword": Struct(String) ID] <"i">{"label"}["keyword": {"name": "abc", "title": "xyz"}] S{"2label4"}["keyword2": Struct(Struct(String))] <"2i44">{"2label4"}["keyword2": {"names": {"name": "abc", "title": "xyz"}, "names2": {"name2": "abc2", "title2": "xyz2"}, "names3": {"name3": "abc3", "title3": "xyz3"}}]