Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
316 lines (245 loc) · 8.21 KB
/
Copy pathindex.html
File metadata and controls
316 lines (245 loc) · 8.21 KB
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>French DBpedia Knowledge Graph Portal</title>
<link rel="stylesheet" href="./css/styles.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<!-- =====================================
HERO SECTION
====================================== -->
<section class="hero">
<div class="container hero-content">
<h1>French DBpedia Knowledge Graph</h1>
<p id="kgAbstract">
todo paragraph description
</p>
<p>
<i>Note: this is a first prototype of the DBpedia Knowledge Graph Cards</i>
</p>
<div class="hero-badges">
<div class="badge">Semantic Web</div>
<div class="badge">Knowledge Graphs</div>
<div class="badge">Open Science</div>
<div class="badge">Linked Data</div>
</div>
</div>
</section>
<!-- =====================================
MAIN CONTENT
====================================== -->
<div class="container">
<!-- =====================================
INFO CARDS
====================================== -->
<div class="cards">
<div class="card">
<h3>KG Evolution</h3>
<p>
Explore the growth of the ORKG through longitudinal statistics
and versioned snapshots of the knowledge graph.
</p>
</div>
<div class="card">
<h3>Version Archive</h3>
<p>
Browse downloadable releases published on DBpedia Databus,
including metadata and dataset distributions.
</p>
</div>
<div class="card">
<h3>Research Infrastructure</h3>
<p>
ORKG enables machine-readable scholarly communication and supports
FAIR knowledge publishing practices.
</p>
</div>
</div>
<!-- =====================================
TABS
====================================== -->
<div class="tabs">
<button class="tab-button"
onclick="openTab(event, 'kgEvolutionTab')">
KG Evolution Module
</button>
<!-- <button class="tab-button"
onclick="openTab(event, 'kgVersionsTab')">
KG Versons
</button>
-->
<button class="tab-button"
onclick="openTab(event, 'helloTab')">
Hello World Module
</button>
<!--
New KG/Tab: add a button for your new tab
-->
<button class="tab-button"
onclick="openTab(event, 'newTab')">
... other module
</button>
</div>
<!-- =====================================
TAB 1 : KG Evolution module
====================================== -->
<div id="kgEvolutionTab" class="tab-content active" >
<div id="kgEvolutionModule"></div>
</div>
<!-- =====================================
TAB 2 : KG Versions module
====================================== -->
<!--
<div id="kgVersionsTab" class="tab-content">
<div id="kgVersionsModule"></div>
</div>
-->
<!-- =====================================
TAB 3 : Hello World TAB
====================================== -->
<div id="helloTab" class="tab-content">
<h2>Hello World Module</h2>
<div id="helloModule"></div>
</div>
<!-- =====================================
TAB 4 : NEW TAB
====================================== -->
<!--
New KG/Tab: Add div for your new module
-->
<div id="newTab" class="tab-content">
<h2>New Feature</h2>
<p class="section-description">
Feature description ....
</p>
</div>
</div>
<footer class="footer">
<div class="footer-content">
<div class="footer-item">
<strong>About</strong>
<p>
The <b>DBpedia Knowledge Graph Cards</b> is a modular interface for exploring Knowledge Graphs published via the DBpedia Knowledge Graph Intelligence Studio.
</p>
</div>
<div class="footer-item">
<strong>Modules</strong>
<p>
Contribute new <a href="https://github.com/m1ci/kg-modules" target="_blank">modules</a> for DBpedia KG Cards.
</p>
</div>
<div class="footer-item">
<strong>Create a KG Card</strong>
<p>
Check <a href="#">how to integrate your KG</a> and create DBpedia Knowledge Graph cards.
</p>
</div>
<div class="footer-item">
<strong>Version</strong>
<p>v0.1</p>
</div>
</div>
<div class="footer-bottom">
© 2026 DBpedia Knowledge Graph Cards · Built for Knowledge Graph research, development, innovation & exploration.
</div>
</footer>
<!-- ================= CORE SCRIPT ================= -->
<script type="module">
// ---------------------------------------------
// TAB SYSTEM
// ---------------------------------------------
window.openTab = function(evt, tabId) {
document.querySelectorAll(".tab-content")
.forEach(t => t.classList.remove("active"));
document.querySelectorAll(".tab-button")
.forEach(b => b.classList.remove("active"));
document.getElementById(tabId).classList.add("active");
evt.currentTarget.classList.add("active");
};
// ---------------------------------------------
// KG CONTEXT
// ---------------------------------------------
const context = {
kgId: "fr-dbpedia",
kgName: "French DBpedia",
databus_endpoint: "https://databus.dev.dbpedia.link/sparql",
group: "https://databus.dev.dbpedia.link/fhofer/dbpedia-wikipedia-kg-dump",
variant: "fr-dbpedia-org"
};
const databusEndpoint = context.databus_endpoint;
// ---------------------------------------------
// FETCH ABSTRACT
// ---------------------------------------------
const queryAbstract = `
PREFIX dct: <http://purl.org/dc/terms/>
SELECT ?abstract WHERE {
<https://databus.dbpedia.org/knowledge-graph-catalog/${context.kgId}>
dct:abstract ?abstract .
}
`;
async function fetchAbstract() {
const url =
databusEndpoint +
"?query=" +
encodeURIComponent(queryAbstract) +
"&format=json";
const res = await fetch(url);
const data = await res.json();
if (data?.results?.bindings?.length > 0) {
return data.results.bindings[0].abstract.value;
}
return "No description available.";
}
// ---------------------------------------------
// MODULE LOADER
// ---------------------------------------------
async function loadModule(url, el) {
const mod = await import(url);
mod.default(el, context);
}
loadModule(
"https://m1ci.github.io/kg-modules/kg-evolution/index_v2.js",
document.getElementById("kgEvolutionModule")
);
// loadModule(
// "https://m1ci.github.io/kg-modules/kg-versions/index.js",
// document.getElementById("kgVersionsModule")
// );
// New KG/Tab: load your new module
loadModule(
"https://m1ci.github.io/kg-modules/kg-hello-world/index.js",
document.getElementById("helloModule")
);
// ---------------------------------------------
// INIT ON PAGE LOAD
// ---------------------------------------------
document.addEventListener("DOMContentLoaded", async () => {
// -------------------------
// DEFAULT TAB FIX
// -------------------------
// New KG/Tab: update default tab
const defaultTabId = "kgEvolutionTab";
const defaultButton = Array.from(document.querySelectorAll(".tab-button"))
.find(btn => btn.getAttribute("onclick")?.includes(defaultTabId));
if (defaultButton) {
window.openTab({ currentTarget: defaultButton }, defaultTabId);
}
// -------------------------
// LOAD ABSTRACT
// -------------------------
// const el = document.getElementById("kgAbstract");
//
// try {
// const abstract = await fetchAbstract();
// el.textContent = abstract;
// } catch (e) {
// el.textContent = "Failed to load description.";
// console.error(e);
// }
});
</script>
</body>
</html>