Skip to content

Commit 45933e8

Browse files
committed
remove node/edge ids
closes #11
1 parent e4e6556 commit 45933e8

5 files changed

Lines changed: 15 additions & 62 deletions

File tree

README.rst

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,6 @@ Design principles
1515
- Properties that allow a ``null`` value can be omitted.
1616
- Define a `JSON graph schema`_ for content validation purposes.
1717

18-
.. _properties:
19-
20-
Common Properties
21-
-----------------
22-
23-
.. _id property:
24-
25-
**id property**
26-
27-
An `id` property is a primary key for an object (see Objects_) that is unique for the object type. Its value is defined as a *JSON string* for flexibility.
28-
29-
**label property**
30-
31-
A `label` property provides a text display for an object. Its value is defined as a *JSON string*.
32-
33-
**type property**
34-
35-
A `type` property provides a classification for an object. Its value is defined as a *JSON string*.
36-
37-
**metadata property**
38-
39-
A `metadata` property allows for custom data on an object. Its values is defined as a *JSON object*.
40-
41-
4218
.. _objects:
4319

4420
Objects
@@ -52,7 +28,10 @@ A node object represents a node in a graph.
5228

5329
**node properties**
5430

55-
- Includes all `Common Properties`_
31+
- An `id` property is a primary key for an object (see Objects_) that is unique for the object type. Its value is defined as a *JSON string* for flexibility.
32+
- A `label` property provides a text display for an object. Its value is defined as a *JSON string*.
33+
- A `type` property provides a classification for an object. Its value is defined as a *JSON string*.
34+
- A `metadata` property allows for custom data on an object. Its values is defined as a JSON object.
5635

5736
.. _edge object:
5837

@@ -62,10 +41,11 @@ An edge object represents an edge in a graph.
6241

6342
**edge properties**
6443

65-
- Includes all `Common Properties`_
6644
- A `source` property provides the `id` value of the source `node object`_. Its value is defined as a *JSON string*.
45+
- A `relation` property provides the interaction between `source` and `target` nodes. Its value is defined as a *JSON string*.
6746
- A `target` property provides the `id` value of the target `node object`_. Its value is defined as a *JSON string*.
6847
- A `directed` property provides the edge mode (e.g. directed or undirected). Its value is *JSON true* for directed and *JSON false* for undirected. The edge direction is determined by *graph.directed* property if not present.
48+
- A `metadata` property allows for custom data on an object. Its values is defined as a JSON object.
6949

7050
.. _graph object:
7151

@@ -75,20 +55,19 @@ A graph object represents a single conceptual graph.
7555

7656
**graph properties**
7757

78-
- Includes all `Common Properties`_
58+
- A `type` property provides a classification for an object. Its value is defined as a *JSON string*.
59+
- A `label` property provides a text display for an object. Its value is defined as a *JSON string*.
7960
- A `directed` property provides the graph mode (e.g. directed or undirected). Its value is *JSON true* for directed and *JSON false* for undirected. This property default to *JSON true* indicating a directed graph.
8061
- A `nodes` property provides the nodes in the graph. Its value is an array of `node object`_.
8162
- An `edges` property provides the edges in the graph. Its value is an array of `edge object`_.
63+
- A `metadata` property allows for custom data on an object. Its values is defined as a JSON object.
8264

8365
.. _graphs object:
8466

8567
**graphs object**
8668

8769
A graphs object groups zero or more `graph object`_ into one JSON document.
8870

89-
**graphs properties**
90-
91-
- Includes all `Common Properties`_. The `id` is not required.
9271
- The `graphs object`_ is defined as a *JSON array*.
9372

9473
.. _examples:
@@ -103,9 +82,7 @@ Examples
10382
.. code-block:: json
10483
10584
{
106-
"graph": {
107-
"id": "default"
108-
}
85+
"graph": {}
10986
}
11087
11188
.. _empty multi graph:
@@ -126,7 +103,6 @@ Examples
126103
127104
{
128105
"graph": {
129-
"id": "default",
130106
"nodes": [
131107
{
132108
"id": "A",
@@ -146,7 +122,6 @@ Examples
146122
147123
{
148124
"graph": {
149-
"id": "default",
150125
"nodes": [
151126
{
152127
"id": "A",
@@ -157,7 +132,6 @@ Examples
157132
],
158133
"edges": [
159134
{
160-
"id": "A - B",
161135
"source": "A",
162136
"target": "B"
163137
}
@@ -173,7 +147,6 @@ Examples
173147
174148
{
175149
"graph": {
176-
"id": "default",
177150
"directed": false,
178151
"type": "graph type",
179152
"label": "graph label",
@@ -200,11 +173,10 @@ Examples
200173
],
201174
"edges": [
202175
{
203-
"id": "0",
204176
"source": "0",
177+
"relation": "edge relationship",
205178
"target": "1",
206179
"directed": false,
207-
"rel": "edge relationship",
208180
"label": "edge label",
209181
"metadata": {
210182
"user-defined": "values"
@@ -223,7 +195,6 @@ Examples
223195
{
224196
"graphs": [
225197
{
226-
"id": "graph0",
227198
"directed": true,
228199
"type": "graph type",
229200
"label": "graph label",
@@ -250,11 +221,10 @@ Examples
250221
],
251222
"edges": [
252223
{
253-
"id": "0",
254224
"source": "0",
225+
"relation": "edge relationship",
255226
"target": "1",
256227
"directed": true,
257-
"rel": "edge relationship",
258228
"label": "edge label",
259229
"metadata": {
260230
"user-defined": "values"
@@ -263,7 +233,6 @@ Examples
263233
]
264234
},
265235
{
266-
"id": "graph1",
267236
"directed": true,
268237
"type": "graph type",
269238
"label": "graph label",
@@ -290,11 +259,10 @@ Examples
290259
],
291260
"edges": [
292261
{
293-
"id": "0",
294262
"source": "1",
263+
"relation": "edge relationship",
295264
"target": "0",
296265
"directed": true,
297-
"rel": "edge relationship",
298266
"label": "edge label",
299267
"metadata": {
300268
"user-defined": "values"

examples/car_graphs.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"graphs": [
33
{
4-
"id": "car-manufacturer-relationships",
54
"type": "car",
65
"label": "Car Manufacturer Relationships",
76
"nodes": [
@@ -24,21 +23,18 @@
2423
],
2524
"edges": [
2625
{
27-
"id": "2",
2826
"source": "nissan",
2927
"target": "infiniti",
3028
"relation": "has_luxury_division"
3129
},
3230
{
33-
"id": "1",
3431
"source": "toyota",
3532
"target": "lexus",
3633
"relation": "has_luxury_division"
3734
}
3835
]
3936
},
4037
{
41-
"id": "car-manufacturer-countries",
4238
"type": "car",
4339
"label": "Car Manufacturer Countries",
4440
"nodes": [
@@ -57,13 +53,11 @@
5753
],
5854
"edges": [
5955
{
60-
"id": "1",
6156
"source": "nissan",
6257
"target": "japan",
6358
"relation": "country_of_origin"
6459
},
6560
{
66-
"id": "2",
6761
"source": "nissan",
6862
"target": "japan",
6963
"relation": "country_of_origin"

examples/les_miserables.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"graph": {
3-
"id": "les_miserables",
3+
"type": "les miserables",
44
"nodes": [
55
{
66
"metadata": {

examples/usual_suspects.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"graph": {
3-
"id": "default",
43
"type": "movie characters",
54
"label": "Usual Suspects",
65
"nodes": [
@@ -22,7 +21,6 @@
2221
],
2322
"edges": [
2423
{
25-
"id": "Roger Kint (is) Keyser Söze",
2624
"source": "Roger Kint",
2725
"target": "Keyser Söze",
2826
"relation": "is"

json-graph-schema.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
"type": "object",
4747
"additionalProperties": false,
4848
"properties": {
49-
"id": {
50-
"type": "string"
51-
},
5249
"label": {
5350
"type": "string"
5451
},
@@ -134,16 +131,12 @@
134131
}
135132
},
136133
"required": [
137-
"id",
138134
"source",
139135
"target"
140136
]
141137
}
142138
}
143-
},
144-
"required": [
145-
"id"
146-
]
139+
}
147140
}
148141
}
149142
}

0 commit comments

Comments
 (0)