-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocument-schema.sling
129 lines (109 loc) · 2.17 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
; 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: true
}
role: {=theme :slot
name: "theme"
description: "Thematic frame"
source: document
multi: true
}
}
; 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: true
}
}
; Document schema family
{=/schema/document :schema_family
name: "Document schemas"
precompute_ancestors: true
member_schema: document
member_schema: token
member_schema: phrase
}