-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlif.schema
107 lines (101 loc) · 2.26 KB
/
lif.schema
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
* The LAPPS Interchange Format.
*
* LAPPS web service exchange JSON data conforming to the LAPPS Interchange Format (LIF).
* Each LIF object consists of some metadata, a text, and an ordered list of views, where
* a view is a collection of annotations and (optionally) some metadata.
*
* Version 1.1.0
*
* This file is maintained with changelog and versioning information in the repository at
* https://github.com/lapps/schemata.
*
*/
title "LAPPS Interchange Format"
description "The JSON-LD objects exchanged by LAPPS web services."
type object
additionalProperties false
properties {
'$schema' { $ref '#/definitions/uri' }
'@context' {
oneOf([
{
type object
additionalProperties true
},
{
type string
format 'uri'
}
])
}
'@vocab' {
type string
format 'uri'
}
text {
type object
properties {
'@value' { type string }
'@language' { type string }
}
required '@value'
additionalProperties false
}
metadata { $ref '#/definitions/map' }
views {
type array
items { $ref '#/definitions/view' }
}
}
required '$schema', 'text'
/*
* Definitions of the object referenced above.
*/
definitions {
// A string value formatted as a URI.
uri {
type string
format 'uri'
}
// A HashMap. Used to store metadata at various levels.
map {
type object
additionalProperties true
}
// A View contains an id, a list of annotations, and possibly
// some metadata.
view {
type object
properties {
id { type string }
metadata { $ref '#/definitions/map' }
annotations { $ref '#/definitions/annotations' }
}
additionalProperties false
required 'id', 'annotations'
}
// An array of annotations.
annotations {
type array
items { $ref '#/definitions/annotation' }
}
// A single annotation.
annotation {
type object
properties {
id { type string }
'@type' { type string }
label { type string }
start {
type integer
minimum(-1)
}
end { type integer; minimum(-1) }
features { $ref '#/definitions/map' }
metadata { $ref '#/definitions/map' }
}
required 'id', '@type'
additionalProperties false
}
}