This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 266
/
Copy pathdocument-schema.sling
173 lines (146 loc) · 2.93 KB
/
document-schema.sling
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
; SLING document schema definitions.
; Document schema.
{=document +named :schema
name: "Document"
family: document
role: {=url :slot
name: "url"
description: "Document URL"
source: document
target: string
}
role: {=title :slot
name: "title"
description: "Document title"
source: document
target: string
}
role: {=text :slot
name: "text"
description: "Document text"
source: document
target: string
}
role: {=tokens :slot
name: "tokens"
description: "Document tokens"
source: document
target: token
}
role: {=mention :slot
name: "mention"
description: "Mention phrase"
source: document
target: phrase
multi: 1
}
role: {=theme :slot
name: "theme"
description: "Thematic frame"
source: document
multi: 1
}
}
; Token schema.
{=token :schema
name: "Phrase"
family: /schema/document
role: {=index :slot
name: "index"
description: "Index of token in document"
source: token
target: int
}
role: {=start :slot
name: "start"
description: "First byte for token in document text"
source: token
target: int
}
role: {=size :slot
name: "size"
description: "Length of token in document text in bytes"
source: token
target: int
}
role: {=break :slot
name: "break"
description: "Break type before token"
source: token
target: int
}
role: {=word :slot
name: "word"
description: "Token word"
source: token
target: string
}
}
; Phrase schema.
{=phrase :schema
name: "Phrase"
family: /schema/document
role: {=begin :slot
name: "begin"
description: "First token in document for phrase"
source: phrase
target: int
}
role: {=length :slot
name: "length"
description: "Number of tokens in phrase"
source: phrase
target: int
}
role: {=evokes :slot
name: "evokes"
description: "Frame evoked by phrase"
source: phrase
multi: 1
}
}
; Profile schema.
{=profile +knowledge :schema
name: "Profile"
family: /schema/document
role: {=alias :slot
name: "alias"
description: "Entity name"
source: profile
target: alias
multi: 1
}
}
# TODO: 'alias' conflicts with profile.alias
{=alias +named :schema
name: "Alias"
family: /schema/document
role: {=sources :slot
name: "Alias sources"
description: "Bitmask for sources of alias"
source: profile
target: int
}
role: {=count :slot
name: "Alias count"
description: "Number of alias occurences"
source: profile
target: int
}
role: {=form :slot
name: "Case form"
description: "Most common case variant for alias"
source: profile
target: int
}
}
; Document schema family
{=/schema/document :schema_family
name: "Document schemas"
precompute_ancestors: 1
member_schema: document
member_schema: token
member_schema: phrase
member_schema: profile
member_schema: alias
}