-
Notifications
You must be signed in to change notification settings - Fork 923
/
json-ld.html
257 lines (247 loc) · 5.79 KB
/
json-ld.html
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
---
layout: page
title: TeSS LD+JSON Tester
---
<p>
Here you can test how data from a page will be mapped to <a href="https://tess.elixir-europe.org/">TeSS</a> fields. This is based on <a href="https://docs.google.com/document/d/1qLbSgJmXA0xnuXaQl4gTvH0IR5K4sHNcGXsOQS5AMno/edit">this TeSS Document</a>
</p>
<div class="input-group">
<input class="form-control" id="input-url" type="text" value="topics/admin/tutorials/ansible-galaxy/tutorial.html">
<button id="submit" class="btn btn-primary">Submit</button>
</div>
<p>If you supply a full URL, your request will be proxied via <a href="https://cors.apps.galaxyproject.eu/">cors.apps.galaxyproject.eu</a></p>
<table class="table table-striped">
<thead>
<tr>
<th>Profile Property</th>
<th>marginality</th>
<th>Maps to TeSS</th>
<th>Notes/Vocab</th>
<th>🔍 Observed Value</th>
</tr>
</thead>
<tbody>
<tr id="t-name">
<td>name</td>
<td>minimum</td>
<td>Title</td>
<td>String</td>
<td></td>
</tr>
<tr id="t-description">
<td>description</td>
<td>minimum</td>
<td>Description</td>
<td>String: markdown-compatible</td>
<td></td>
</tr>
<tr id="t-url">
<td>url</td>
<td>recommended</td>
<td>URL</td>
<td></td>
<td></td>
</tr>
<tr id="t-keywords">
<td>keywords</td>
<td>minimum</td>
<td>Keywords</td>
<td>String: a comma separated list of keywords</td>
<td></td>
</tr>
<tr id="t-dateCreated">
<td>dateCreated</td>
<td>optional</td>
<td>Date</td>
<td></td>
<td></td>
</tr>
<tr id="t-license">
<td>license</td>
<td>recommended</td>
<td>License</td>
<td>Expects a SPDX identifier</td>
<td></td>
</tr>
<tr id="t-learningResourceType">
<td>learningResourceType</td>
<td>recommended</td>
<td>Resource Type</td>
<td>E.g. hands-on tutorials, etc</td>
<td></td>
</tr>
<tr id="t-about">
<td>about</td>
<td>recommended</td>
<td>Scientific Topics</td>
<td>Expects a DefinedTerm with a name property. EDAM</td>
<td></td>
</tr>
<tr id="t-audience">
<td>audience</td>
<td>recommended</td>
<td>Target Audience</td>
<td>Picks the audienceType property from the Audience</td>
<td></td>
</tr>
<tr id="t-author">
<td>author</td>
<td>recommended</td>
<td>Authors</td>
<td>Picks the name property from the Person</td>
<td></td>
</tr>
<tr id="t-contributor">
<td>contributor</td>
<td>optional</td>
<td>Contributors</td>
<td>Picks the name property from the Person</td>
<td></td>
</tr>
<tr id="t-identifier">
<td>identifier</td>
<td>recommended</td>
<td>DOI</td>
<td>Only recognizes DOI identifiers</td>
<td></td>
</tr>
<tr id="t-educationalLevel">
<td>educationalLevel</td>
<td>recommended</td>
<td>Difficulty Level</td>
<td>Beginner<br>Intermediate<br>Advanced</td>
<td></td>
</tr>
<tr id="t-abstract">
<td>abstract</td>
<td>recommended</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr id="t-competencyRequired">
<td>competencyRequired</td>
<td>recommended</td>
<td>Prerequisites</td>
<td>Available in 1.4</td>
<td></td>
</tr>
<tr id="t-inLanguage">
<td>inLanguage</td>
<td>recommended</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr id="t-mentions">
<td>mentions</td>
<td>recommended</td>
<td></td>
<td>Seems to relate to External Resources</td>
<td></td>
</tr>
<tr id="t-teaches">
<td>teaches</td>
<td>recommended</td>
<td>Learning Objectives</td>
<td>Available in 1.4</td>
<td></td>
</tr>
<tr id="t-timeRequired">
<td>timeRequired</td>
<td>recommended</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr id="t-accessibilitySummary">
<td>accessibilitySummary</td>
<td>optional</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr id="t-dateModified">
<td>dateModified</td>
<td>optional</td>
<td>Date modified</td>
<td>Available in 1.4</td>
<td></td>
</tr>
<tr id="t-datePublished">
<td>datePublished</td>
<td>optional</td>
<td>Date published</td>
<td>Available in 1.4</td>
<td></td>
</tr>
<tr id="t-creativeWorkStatus">
<td>creativeWorkStatus</td>
<td>optional</td>
<td>Status</td>
<td>Available in 1.4</td>
<td></td>
</tr>
<tr id="t-version">
<td>version</td>
<td>optional</td>
<td>Version</td>
<td>Available in 1.4</td>
<td></td>
</tr>
<tr id="t-workTranslation">
<td>workTranslation</td>
<td>optional</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr id="t-recordedAt">
<td>recordedAt</td>
<td>optional</td>
<td></td>
<td>‘Link’ to Event via name, url pair of CourseInstance</td>
<td></td>
</tr>
<tr id="t-hasPart">
<td>hasPart</td>
<td>optional</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr id="t-isPartOf">
<td>isPartOf</td>
<td>optional</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<script>
document.getElementById("submit").onclick = function(){
var url = document.getElementById("input-url").value
if(url.slice(0, 8) === "https://") {
url = `https://cors.apps.galaxyproject.eu/${url}`
}
fetch(url).then(function(response) {
// Once the page is loaded convert it to text
return response.text();
}).then(function(html) {
// Replace newlines to allow parsing more easily.
html = html.replaceAll(/[\n\r]/g, '');
// Parse the json-ld from the page
jsonld = JSON.parse(html.match(/<script type="application\/ld\+json">([^<]*)<\/script>/)[1]);
Object.keys(jsonld).forEach(k => {
e = document.getElementById(`t-${k}`)?.lastElementChild
if(e){e.innerText = JSON.stringify(jsonld[k])}
})
});
}
</script>
<style>
table tr :nth-child(5) {
font-family: monospace;
}
</style>