@gram-data/tree-sitter-gram 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -51
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,61 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tree-sitter-gram
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A [tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar
|
|
4
|
+
for [gram](https://gram-data.github.io) notation.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
is a sequence of graph elements.
|
|
7
|
-
|
|
8
|
-
## Graph elements - nodes
|
|
9
|
-
|
|
10
|
-
The smallest graph pattern is an empty node.
|
|
11
|
-
```
|
|
12
|
-
()
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Nodes may include properties using classic curly-braces-styled notation. This expression
|
|
16
|
-
is like an anonymous object that appears inside some other data structure, perhaps a list
|
|
17
|
-
like `const people = [{name:ABK}]`:
|
|
6
|
+
Gram is a subject based notation for structured data.
|
|
18
7
|
|
|
8
|
+
If this is an object:
|
|
19
9
|
```
|
|
20
|
-
|
|
10
|
+
{
|
|
11
|
+
"name":"Andreas",
|
|
12
|
+
"roles":["author"]
|
|
13
|
+
}
|
|
21
14
|
```
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
(abk {name:"ABK"})
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Or, the identity could be considered the representative value of the node as in these examples:
|
|
30
|
-
```
|
|
31
|
-
(1), (true), (`heir to the Iron Throne`)
|
|
32
|
-
```
|
|
16
|
+
Implicitly it is about a person. To become a subject, the implicit
|
|
17
|
+
information can be explicit.
|
|
33
18
|
|
|
34
|
-
|
|
35
|
-
introspectable object in a programming language -- `const abk:Person = {name:"ABK"}`:
|
|
19
|
+
As a subject:
|
|
36
20
|
```
|
|
37
|
-
|
|
21
|
+
[:Person {
|
|
22
|
+
name: "Andreas",
|
|
23
|
+
roles: ["author"]
|
|
24
|
+
}]
|
|
38
25
|
```
|
|
39
26
|
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
(abk:Person:Author {name:"ABK"}), (one:Person:King:Fictional {name: "John Snow"}),
|
|
43
|
-
(drogon:Dragon:Fictional {name:"Drogon"})
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## FAQ
|
|
48
|
-
|
|
49
|
-
- Annotation vs self-loop?
|
|
50
|
-
|
|
51
|
-
Q: What is the difference between an annotation and a self-loop?
|
|
52
|
-
A: An annotation provides extra information about a single target, while a self-loop provides
|
|
53
|
-
information about a source,target pair where either the source or target may have been different,
|
|
54
|
-
but happen to be the same.
|
|
55
|
-
|
|
56
|
-
For example, `@physics("rigid")(a:Player)` annotates a player entity with information for the physics subsystem.
|
|
57
|
-
The information is particular to the player and not about how the player relates to itself.
|
|
58
|
-
|
|
59
|
-
As a self-loop, `(a:Player)-[:MESSAGE]->(a:Player)` is a message a player sent to themselves that could've
|
|
60
|
-
been sent to another player. The message has a specific source and target, which happen to be the same.
|
|
61
|
-
|
|
27
|
+
Learn more about `gram` at the [gram-data github org](https://github.com/gram-data) notation.
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gram-data/tree-sitter-gram",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.1.6",
|
|
3
|
+
"version": "0.1.7",
|
|
5
4
|
"description": "subject-oriented notation for structured data",
|
|
5
|
+
"homepage": "https://gram-data.github.io",
|
|
6
|
+
"repository": "github:gram-data/tree-sitter-gram",
|
|
6
7
|
"main": "bindings/node",
|
|
7
8
|
"types": "bindings/node",
|
|
8
9
|
"scripts": {
|