Skip to content

Commit a32bf20

Browse files
committed
definitions for node and edge schema; refs #13
1 parent 5f7f4ac commit a32bf20

1 file changed

Lines changed: 61 additions & 55 deletions

File tree

json-graph-schema.json

Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,65 @@
3939
}
4040
],
4141
"definitions": {
42+
"node": {
43+
"type": "object",
44+
"additionalProperties": false,
45+
"properties": {
46+
"id": {
47+
"type": "string"
48+
},
49+
"label": {
50+
"type": "string"
51+
},
52+
"metadata": {
53+
"type": [
54+
"object",
55+
"null"
56+
]
57+
}
58+
},
59+
"required": [
60+
"id"
61+
]
62+
},
63+
"edge": {
64+
"type": "object",
65+
"additionalProperties": false,
66+
"properties": {
67+
"id": {
68+
"type": "string"
69+
},
70+
"source": {
71+
"type": "string"
72+
},
73+
"target": {
74+
"type": "string"
75+
},
76+
"relation": {
77+
"type": "string"
78+
},
79+
"directed": {
80+
"type": [
81+
"boolean",
82+
"null"
83+
],
84+
"default": true
85+
},
86+
"label": {
87+
"type": "string"
88+
},
89+
"metadata": {
90+
"type": [
91+
"object",
92+
"null"
93+
]
94+
}
95+
},
96+
"required": [
97+
"source",
98+
"target"
99+
]
100+
},
42101
"graph": {
43102
"type": "object",
44103
"additionalProperties": false,
@@ -68,25 +127,7 @@
68127
"null"
69128
],
70129
"items": {
71-
"type": "object",
72-
"additionalProperties": false,
73-
"properties": {
74-
"id": {
75-
"type": "string"
76-
},
77-
"label": {
78-
"type": "string"
79-
},
80-
"metadata": {
81-
"type": [
82-
"object",
83-
"null"
84-
]
85-
}
86-
},
87-
"required": [
88-
"id"
89-
]
130+
"$ref": "#/definitions/node"
90131
}
91132
},
92133
"edges": {
@@ -95,42 +136,7 @@
95136
"null"
96137
],
97138
"items": {
98-
"type": "object",
99-
"additionalProperties": false,
100-
"properties": {
101-
"id": {
102-
"type": "string"
103-
},
104-
"source": {
105-
"type": "string"
106-
},
107-
"target": {
108-
"type": "string"
109-
},
110-
"relation": {
111-
"type": "string"
112-
},
113-
"directed": {
114-
"type": [
115-
"boolean",
116-
"null"
117-
],
118-
"default": true
119-
},
120-
"label": {
121-
"type": "string"
122-
},
123-
"metadata": {
124-
"type": [
125-
"object",
126-
"null"
127-
]
128-
}
129-
},
130-
"required": [
131-
"source",
132-
"target"
133-
]
139+
"$ref": "#/definitions/edge"
134140
}
135141
}
136142
}

0 commit comments

Comments
 (0)