From 666fc60b6e332cee4389cae0f06b50cb764edd1c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Jul 2022 22:29:40 -0400 Subject: Use the same set of external vocabulary prefixes everywhere The RDFa in specification pages doesn't actually use prefixed names for the documented resources. So, simplify things by trimming the namespaces down to a consistent set that is actually used in the LV2 universe. --- lv2specgen/DTD/xhtml-rdfa-1.dtd | 40 +++++++++++----------------------------- lv2specgen/lv2specgen.py | 22 +++++----------------- lv2specgen/template.html | 8 +++++--- 3 files changed, 21 insertions(+), 49 deletions(-) diff --git a/lv2specgen/DTD/xhtml-rdfa-1.dtd b/lv2specgen/DTD/xhtml-rdfa-1.dtd index dcfbf09..bd3479e 100644 --- a/lv2specgen/DTD/xhtml-rdfa-1.dtd +++ b/lv2specgen/DTD/xhtml-rdfa-1.dtd @@ -437,36 +437,18 @@ - - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index a07bdf3..a37ad32 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -86,20 +86,14 @@ spec_pre = None spec_bundle = None specgendir = None ns_list = { + "http://ontologi.es/doap-changeset#": "dcs", + "http://purl.org/dc/terms/": "dcterms", + "http://usefulinc.com/ns/doap#": "doap", + "http://xmlns.com/foaf/0.1/": "foaf", + "http://www.w3.org/2002/07/owl#": "owl", "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", "http://www.w3.org/2000/01/rdf-schema#": "rdfs", - "http://www.w3.org/2002/07/owl#": "owl", "http://www.w3.org/2001/XMLSchema#": "xsd", - "http://rdfs.org/sioc/ns#": "sioc", - "http://xmlns.com/foaf/0.1/": "foaf", - "http://purl.org/dc/elements/1.1/": "dc", - "http://purl.org/dc/terms/": "dcterms", - "http://purl.org/rss/1.0/modules/content/": "content", - "http://www.w3.org/2003/01/geo/wgs84_pos#": "geo", - "http://www.w3.org/2004/02/skos/core#": "skos", - "http://lv2plug.in/ns/lv2core#": "lv2", - "http://usefulinc.com/ns/doap#": "doap", - "http://ontologi.es/doap-changeset#": "dcs", } rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#") @@ -1377,12 +1371,6 @@ def specgen( ) template = template.replace("@URI@", spec) template = template.replace("@PREFIX@", spec_pre) - if spec_pre == "lv2": - template = template.replace("@XMLNS@", "") - else: - template = template.replace( - "@XMLNS@", 'xmlns:%s="%s"' % (spec_pre, spec_ns_str) - ) filename = os.path.basename(specloc) basename = os.path.splitext(filename)[0] diff --git a/lv2specgen/template.html b/lv2specgen/template.html index 879a109..4eb3d96 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -2,12 +2,14 @@ @TITLE@ -- cgit v1.2.1