From 1a59b6ff7d3906648a14726e020a196a2f311abd Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Sun, 10 Dec 2023 14:26:07 +0100 Subject: [PATCH] more rdfa --- index.rdfa.html | 140 +++++++++++++++-------------------------- scripts/insert_rdfa.py | 59 +++++++++++++---- 2 files changed, 98 insertions(+), 101 deletions(-) diff --git a/index.rdfa.html b/index.rdfa.html index 51564df..6835f1a 100644 --- a/index.rdfa.html +++ b/index.rdfa.html @@ -14,26 +14,17 @@
-

XPUB is the Master of Arts in Fine Art and Design: Experimental -Publishing of the Piet Zwart Institute. XPUB focuses on the acts of -making things public and creating publics in the age of -post-digital networks. XPUB's interests in publishing are -twofold:
+

XPUB is the Master of Arts in Fine Art and Design: Experimental Publishing of the Piet Zwart Institute. XPUB focuses on the acts of making things public and creating publics in the age of post-digital networks. XPUB's interests in publishing are twofold:

--> first, publishing as the inquiry and participation into the -technological frameworks, political context and cultural processes -through which things are made public;
+-> first, publishing as the inquiry and participation into the technological frameworks, political context and cultural processes through which things are made public;

--> and second, how these are, or can be, used to create publics -by expanding the means of discourse circulation beyond print media -and its direct digital translation.
+-> and second, how these are, or can be, used to create publics by expanding the means of discourse circulation beyond print media and its direct digital translation.

go back
-
- +
-
-
-

Making things Bubblic

-

June 2023

+
+
+
+

Making things Bubblic

+

June 2023

@@ -253,8 +229,7 @@ CollectivityX

@@ -269,10 +244,10 @@ Tool of Expression

-
-
-

Walkie-Talkie

-

June 2022

+
+
+

Walkie-Talkie

+

June 2022

📻 Collective Publication

📻 Video documentation

@@ -301,8 +276,7 @@ Tool of Expression

@@ -333,10 +307,10 @@ Sentimental eXperience

-
-
-

blue links

-

July 2021

+
+
+

blue links

+

July 2021

+

PDF

Bohye Woo

Parallel Colonialism

-

PDF -

+

PDF

Artemis Gryllaki

@@ -446,33 +415,28 @@ Speculation

-
-
-

UPSETTING SETTINGS

-

July 2019

+ -
-
-

Ex, XPUB

-

July 2018

+
+
+

Ex, XPUB

+

July 2018

@@ -509,8 +472,7 @@ eat?

Karina Dukalska

-

Back It -Up

+

Back It Up

PDF // IMG

@@ -520,8 +482,7 @@ Up

@@ -531,8 +492,7 @@ faces

diff --git a/scripts/insert_rdfa.py b/scripts/insert_rdfa.py index 1fe99d0..fd5ed70 100644 --- a/scripts/insert_rdfa.py +++ b/scripts/insert_rdfa.py @@ -1,17 +1,9 @@ import html5lib from xml.etree import ElementTree as ET +import datetime -with open("index.html") as fin: - t = html5lib.parse(fin.read(), namespaceHTMLElements=False) - -body = t.find(".//body") -body.attrib['xmlns:xpub'] = "http://xpub.nl/terms/" -body.attrib['xmlns:dc'] = "http://purl.org/dc/terms/" - -count = 0 -for div in t.findall('.//div[@class="subrow"]'): - count += 1 +def patch_project_div (div): div.attrib['typeof'] = "xpub:project" student, title = None, None for i, p in enumerate(div.findall("./p")): @@ -38,7 +30,52 @@ for div in t.findall('.//div[@class="subrow"]'): else: raise Exception(f"{title}: too many p columns") -print (f"count: {count}") +def patch_year_div(div): + div.attrib["typeof"] = "xpub:gradshow" + col1 = div.find('.//div[@class="col1"]') + logo = col1.find('.//img[@class="logo"]') + if logo is None: + print ('no logo') + return + logo.attrib["property"] = "dc:image" + for pi, p in enumerate(col1.findall("./p")): + print (f"{pi}: {p}: {p.text}") + if pi == 0: + p.attrib['property'] = "dc:title" + elif pi == 1: + # p.attrib['property'] = "dc:date" + month, year = p.text.split(" ") + year = int(year) + if month == "June": + month = 6 + else: + month = 7 + print (year, month) + dt = ET.SubElement(p, "datetime") + dt.text = p.text + p.text = "" + dt.attrib['datetime'] = datetime.date(year, month, 1).isoformat() + dt.attrib['property'] = "dc:date" + # p_gradshow = col1.find('.//p[@class="gradShow"]') + # p_gradshow.attrib["property"] = "dc:title" + # title = p_gradshow.text + # print (f"patch_gradshow: {title}") + for project_div in div.findall('.//div[@class="subrow"]'): + patch_project_div(project_div) + return True + +def patch_page (t): + for div in t.findall('.//div[@class="row"]'): + patch_year_div(div) + + +with open("index.html") as fin: + t = html5lib.parse(fin.read(), namespaceHTMLElements=False) +body = t.find(".//body") +body.attrib['xmlns:xpub'] = "http://xpub.nl/terms/" +body.attrib['xmlns:dc'] = "http://purl.org/dc/terms/" +patch_page(t) +# print (f"count: {count}") with open("index.rdfa.html", "w") as fout: print (ET.tostring(t, method="html", encoding="unicode"), file=fout)