-
Notifications
You must be signed in to change notification settings - Fork 8
/
graph.schema.json
84 lines (84 loc) · 2.49 KB
/
graph.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"$id": "https://github.com/hicsail/constellation-js/blob/master/schemas/graph.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "A JavaScript graph representation of a genetic design space",
"type": "object",
"patternProperties": {
"^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$": { "$ref": "#/definitions/node" }
},
"additionalProperties": false,
"definitions": {
"uuid": {
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"operator": {
"type": "string",
"enum": [
"OneOrMore", "ZeroOrMore", "ZeroOrOne",
"ZeroOrOneSBOL", "ZeroOrMoreSBOL",
"ReverseComp",
"Then", "Or", "And0", "And1", "And2", "Merge"
]
},
"node_type": {
"type": "string",
"enum": ["epsilon", "atom", "accept", "root"]
},
"edge_type": {
"type": "string",
"enum": ["epsilon", "atom"]
},
"edge_orientation": {
"type": "string",
"enum": ["Inline", "ReverseComp", "None"]
},
"edge_component": {
"type": "object",
"patternProperties": {
"^.*$": { "type": "array" }
}
},
"edge": {
"type": "object",
"required": ["src", "dest", "component", "type", "text"],
"properties": {
"src": { "$ref": "#/definitions/uuid" },
"dest": { "$ref": "#/definitions/uuid" },
"component": {
"oneOf": [
{"$ref": "#/definitions/edge_component"},
{"type": "string", "enum": ["epsilon"]}
]
},
"orientation": { "$ref": "#/definitions/edge_orientation" },
"type": { "$ref": "#/definitions/edge_type" },
"text": { "type": "string" }
}
},
"node": {
"type": "object",
"required": ["id", "text", "type", "edges"],
"properties": {
"id": { "$ref": "#/definitions/uuid" },
"text": {
"anyOf": [
{ "$ref": "#/definitions/node_type" },
{ "type": "string", "pattern": "^.*$"}
]
},
"type": { "$ref": "#/definitions/node_type" },
"edges": {
"anyOf": [
{"type": "array", "items": { "$ref": "#/definitions/edge" }},
{"type": "array", "items": { "$ref": "#/definitions/uuid" }}
]
},
"operator": {
"type": "array",
"items": { "$ref": "#/definitions/operator" }
}
}
}
}
}