-
Notifications
You must be signed in to change notification settings - Fork 1
/
views.http
117 lines (103 loc) · 4.36 KB
/
views.http
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
### Get the views for bodyId=urn:mondriaan:letter:17583
# Calls for views 'title' and 'textTrans':
# - name: title
# anno:
# - path: body.type
# value: tei:Title
# - name: textTrans
# anno:
# - path: body.type
# value: tei:Div
# - path: body.metadata.type
# value: translation
#
# First, get the subject itself (i.c. a letter):
POST https://mondriaan.annorepo.dev.clariah.nl/services/mondriaan-letters-0.8.11-1/search
Content-Type: application/json
{
"body.id": "urn:mondriaan:letter:17583"
}
### Now, we have {source,start,end} for the entire subject ('letter'):
# source=https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents
# selector={start=2928, end=3426}
### Next up, for each view (pretend only 'title' for now): find view within this source+selector:
POST https://mondriaan.annorepo.dev.clariah.nl/services/mondriaan-letters-0.8.11-1/search
Content-Type: application/json
{
":isWithinTextAnchorRange": {
"source": "https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents",
"start": 2928,
"end": 3426
},
"body.type": "tei:Title"
}
### From these annos, get the body.id, the text (via text-target-without-selector), and {source,start,end} of the title
# body.id: urn:mondriaan:title:18650
# text @ https://mondriaan.tt.di.huc.knaw.nl/textrepo/view/versions/e0869654-3c77-428c-bb3a-d401323f37b5/segments/index/2929/2942
# source=https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents
# selector={start=2929, end=2942}
#
# now there /could/ be, e.g., tei:Rs (entity) in this title, so fetch all annotations 'within' this title
POST https://mondriaan.annorepo.dev.clariah.nl/services/mondriaan-letters-0.8.11-1/search
Content-Type: application/json
{
":isWithinTextAnchorRange": {
"source": "https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents",
"start": 2929,
"end": 2942
},
"body.type": {
":isIn": [
"tei:Rs"
]
}
}
###
# body.id=urn:mondriaan:rs:18271 (== bio.xml#iongh_aletta_de, text="Aletta de Iongh")
# text @ https://mondriaan.tt.di.huc.knaw.nl/textrepo/view/versions/e0869654-3c77-428c-bb3a-d401323f37b5/segments/index/2931/2933
# source="https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents"
# selector={start=2931, end=2933}
### Finally, {start,end} in these 'anno-within-view', need to be relocated by subtracting the view's start from it.
# In this case, the start of the 'title' needs to be subtracted from the tei:Rs annos found in the title.
# This relocates the tei:Rs relative to the start of its surrounding tei:Title
# => relocate 2931 to (2931 - 2929) = 2; 2933 to (2933 - 2929) = 4
### Another, more complicated view is 'textTrans':
POST https://mondriaan.annorepo.dev.clariah.nl/services/mondriaan-letters-0.8.11-1/search
Content-Type: application/json
{
":isWithinTextAnchorRange": {
"source": "https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents",
"start": 2928,
"end": 3426
},
"body.type": "tei:Div",
"body.metadata.type": "translation"
}
###
# body.id=urn:mondriaan:div:17291
# text @ https://mondriaan.tt.di.huc.knaw.nl/textrepo/view/versions/e0869654-3c77-428c-bb3a-d401323f37b5/segments/index/3185/3274
# source=https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents
# selector={start=3185, end=3274}
### Get tei:Rs from translation:
POST https://mondriaan.annorepo.dev.clariah.nl/services/mondriaan-letters-0.8.11-1/search
Content-Type: application/json
{
":isWithinTextAnchorRange": {
"source": "https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents",
"start": 3185,
"end": 3274
},
"body.type": {
":isIn": [
"tei:Div",
"tei:Letter",
"tei:Rs"
]
}
}
###
# body.id=urn:mondriaan:rs:18273 (== bio.xml#spoor_kees, text="Spoor")
# text @ https://mondriaan.tt.di.huc.knaw.nl/textrepo/view/versions/e0869654-3c77-428c-bb3a-d401323f37b5/segments/index/3200/3200
# source=https://mondriaan.tt.di.huc.knaw.nl/textrepo/rest/versions/e0869654-3c77-428c-bb3a-d401323f37b5/contents
# selector={start=3200,end=3200}
# => relocate 3200 to (3200 - 3185 =) 15