From 075f0999f176b0600a469831c01ee26213072b04 Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Sun, 10 Dec 2023 15:09:19 +0100 Subject: [PATCH] rdfa --- Makefile | 4 ++++ index.html | 2 +- index.rdfa.html | 2 +- scripts/extract_rdf.py | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..75165ce --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +index.json: index.rdfa.html + python3 scripts/extract_rdf.py > $@ + + diff --git a/index.html b/index.html index 13fa319..e6fbe81 100644 --- a/index.html +++ b/index.html @@ -370,7 +370,7 @@
-
+

c_o_l_l_e_c_t_i_v_e_i_o_n_i_n_g

July 2020

diff --git a/index.rdfa.html b/index.rdfa.html index 03bb0f3..29ab6ee 100644 --- a/index.rdfa.html +++ b/index.rdfa.html @@ -368,7 +368,7 @@
-
+

c_o_l_l_e_c_t_i_v_e_i_o_n_i_n_g

July 2020

diff --git a/scripts/extract_rdf.py b/scripts/extract_rdf.py index f2fbe07..4ab1d6b 100644 --- a/scripts/extract_rdf.py +++ b/scripts/extract_rdf.py @@ -16,6 +16,7 @@ g.parse("https://project.xpub.nl/index.rdfa.html", format="rdfa") context = { "@context": { + "@vocab": "http://xpub.nl/terms/", "@language": "en", "xpub": "http://xpub.nl/terms/", "xpubproject": "https://project.xpub.nl/", @@ -26,7 +27,9 @@ context = { "image": {"@id": "dc:image", "@type": "@id" }, "title": "dc:title", "date": {"@id": "dc:date", "@type": "http://www.w3.org/2001/XMLSchema#date"}, - "hasPart": {"@id": "dc:hasPart", "@type": "@id"} + "hasPart": {"@id": "dc:hasPart", "@type": "@id"}, + "url": {"@id": "@id", "@type": "@id"}, + "type": {"@id": "@type", "@type": "@id"} } } print (g.serialize(format="json-ld", context=context, auto_compact=True))