From ba72911a780d4889ebcd3551b0e0df8a28379742 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Fri, 9 Jul 2021 15:29:13 +0200 Subject: [PATCH] Unify product and project IDs and links (#445) --- gatsby/lobid/gatsby-node.js | 7 +++++-- gatsby/lobid/src/components/helpers.js | 8 ++------ gatsby/lobid/src/components/product.html.js | 15 ++++++++------- gatsby/lobid/src/components/project.html.js | 14 ++++++++------ gatsby/lobid/src/components/publications.html.js | 3 +-- gatsby/lobid/src/components/team.html.js | 8 ++++---- gatsby/lobid/src/templates/product.js | 1 + gatsby/lobid/src/templates/project.js | 1 + gatsby/lobid/static/product/lobid.json | 9 +++++---- gatsby/lobid/static/product/metafacture.json | 6 +++--- gatsby/lobid/static/product/nwbib.json | 7 ++++--- gatsby/lobid/static/product/skohub.json | 6 +++--- .../{Alma+Migration.json => alma-migration.json} | 8 ++++---- gatsby/lobid/static/project/lrmi-profile.json | 5 +++-- gatsby/lobid/static/project/metafacture-fix.json | 6 +++--- .../static/project/metafacture-playground.json | 8 ++++---- gatsby/lobid/static/project/oer-stoeberspecs.json | 5 +++-- gatsby/lobid/static/project/oersi.json | 8 ++++---- gatsby/lobid/static/project/rpb.json | 11 ++++++----- .../{skohub-io.json => skohub-project.json} | 5 +++-- gatsby/lobid/static/team.json | 8 ++++---- 21 files changed, 79 insertions(+), 70 deletions(-) rename gatsby/lobid/static/project/{Alma+Migration.json => alma-migration.json} (85%) rename gatsby/lobid/static/project/{skohub-io.json => skohub-project.json} (95%) diff --git a/gatsby/lobid/gatsby-node.js b/gatsby/lobid/gatsby-node.js index fe97acae..4352215e 100644 --- a/gatsby/lobid/gatsby-node.js +++ b/gatsby/lobid/gatsby-node.js @@ -42,6 +42,7 @@ exports.createPages = async ({ graphql, actions }) => { const shortMemberIds = members.membership.map(m => m.member.id) .filter(id => id.indexOf("lobid.org/team") != -1) .map(id => id.slice(id.lastIndexOf("/") + 1, id.lastIndexOf("!#") - 1)); + console.log("Creating member pages: ", shortMemberIds); addPages(shortMemberIds, "team", "./src/templates/member.js", createPage); // Pages for individual products listed in `makesOffer` @@ -60,7 +61,8 @@ exports.createPages = async ({ graphql, actions }) => { const shortProductIds = products.makesOffer.map(p => p.id) .filter(id => id.indexOf("/") != -1) - .map(id => id.slice(id.lastIndexOf("/") + 1, id.lastIndexOf("."))); + .map(id => id.slice(id.lastIndexOf("/") + 1)); + console.log("Creating product pages: ", shortProductIds); addPages(shortProductIds, "product", "./src/templates/product.js", createPage); // Pages for individual project files in /project @@ -78,10 +80,11 @@ exports.createPages = async ({ graphql, actions }) => { } } `); - + const shortProjectIds = projects.edges.map(e => e.node.id) .filter(id => id.indexOf("/") != -1) .map(id => id.slice(id.lastIndexOf("/") + 1)); + console.log("Creating project pages: ", shortProjectIds); addPages(shortProjectIds, "project", "./src/templates/project.js", createPage); }; diff --git a/gatsby/lobid/src/components/helpers.js b/gatsby/lobid/src/components/helpers.js index 158c7ea3..08343d0c 100644 --- a/gatsby/lobid/src/components/helpers.js +++ b/gatsby/lobid/src/components/helpers.js @@ -1,7 +1,3 @@ -export function simpleProductId(url) { - return url.slice(url.lastIndexOf("/") + 1, url.lastIndexOf(".")); -} - -export function simpleProjectId(url) { - return url.slice(url.lastIndexOf('/')+1); +export function simpleId(url) { + return url.slice(url.lastIndexOf("/") + 1); } diff --git a/gatsby/lobid/src/components/product.html.js b/gatsby/lobid/src/components/product.html.js index d75dbe0e..3df1f419 100644 --- a/gatsby/lobid/src/components/product.html.js +++ b/gatsby/lobid/src/components/product.html.js @@ -1,6 +1,6 @@ import React from "react"; import md5 from 'md5'; -import { simpleProductId } from './helpers.js' +import { simpleId } from './helpers.js' import Header from "./header.html"; import Footer from "./footer.html"; @@ -20,9 +20,10 @@ export class Product extends React.Component { } asLinks(field) { - return this.props.product[field] && {this.props[field]}{this.props.product[field].map((link) => -
{link.id.replace('https://', '').replace('http://', '')}
- )} + return this.props.product[field] && {this.props[field]}{this.props.product[field].map((link) => { + let linkId = link.id.replace(/https?:\/\/lobid.org\//, '/'); + return
{linkId}
+ })} } render() { @@ -43,19 +44,19 @@ export class Product extends React.Component { {this.props.product.name.label} {this.props.product.slogan && [this.props.product.slogan].map(s => — {s.label})} - JSON-LD + JSON-LD
-

{this.props.product.description.label}

+

{this.props.product.description.label}

- + {this.asLinks("hasPart")} {this.asLinks("isBasedOn")} {this.asLinks("isRelatedTo")} diff --git a/gatsby/lobid/src/components/project.html.js b/gatsby/lobid/src/components/project.html.js index 9f961fc7..3f45be6f 100644 --- a/gatsby/lobid/src/components/project.html.js +++ b/gatsby/lobid/src/components/project.html.js @@ -1,6 +1,6 @@ import React from "react"; import md5 from 'md5'; -import { simpleProjectId } from './helpers.js' +import { simpleId } from './helpers.js' import Header from "./header.html"; import Footer from "./footer.html"; @@ -20,8 +20,10 @@ export class Project extends React.Component { } asLinks(field) { - return this.props.project[field] && } @@ -43,19 +45,19 @@ export class Project extends React.Component { {this.props.project.name.label} {this.props.project.alternateName && this.props.project.alternateName.map(s => | {s})} - JSON-LD + JSON-LD
-

{this.props.project.description.label}

+

{this.props.project.description.label}

Website{this.props.product.id}
Website{this.props.product.url || this.props.product.id}
{this.props[field]}{this.props.project[field].map((link) => - + return this.props.project[field] &&
{this.props[field]}{this.props.project[field].map((link) => { + let linkId = link.id.replace(/https?:\/\/lobid.org\//, '/'); + return + } )}
- + {this.props.project.endDate && } {this.asLinks("hasPart")} {this.asLinks("isBasedOn")} diff --git a/gatsby/lobid/src/components/publications.html.js b/gatsby/lobid/src/components/publications.html.js index bb3583fe..e0dd92e3 100644 --- a/gatsby/lobid/src/components/publications.html.js +++ b/gatsby/lobid/src/components/publications.html.js @@ -1,5 +1,4 @@ import React from "react" -import { simpleProductId } from './helpers.js' import jsonLdPng from "./images/json-ld.png"; @@ -20,7 +19,7 @@ export default class Publications extends React.Component { diff --git a/gatsby/lobid/src/components/team.html.js b/gatsby/lobid/src/components/team.html.js index cc62096b..ac342e62 100644 --- a/gatsby/lobid/src/components/team.html.js +++ b/gatsby/lobid/src/components/team.html.js @@ -1,6 +1,6 @@ import React from "react"; import md5 from 'md5'; -import { simpleProductId, simpleProjectId } from './helpers.js' +import { simpleId } from './helpers.js' import Header from "./header.html"; import Footer from "./footer.html"; @@ -172,7 +172,7 @@ export class Team extends React.Component {
{this.getImage(offer.id, details.node.image)}

- + {offer.name}
@@ -188,8 +188,8 @@ export class Team extends React.Component {

{this.getImage(details.node.id, details.node.image)}

- - {details.node.alternateName || simpleProjectId(details.node.id)} + + {details.node.alternateName || simpleId(details.node.id)}
{(details.node.name && details.node.name[this.props.lang]) || details.node.alternateName} diff --git a/gatsby/lobid/src/templates/product.js b/gatsby/lobid/src/templates/product.js index 976e9097..ccf0c25b 100644 --- a/gatsby/lobid/src/templates/product.js +++ b/gatsby/lobid/src/templates/product.js @@ -30,6 +30,7 @@ export const query = graphql` edges { node { childProductJson { + url name { label: de } diff --git a/gatsby/lobid/src/templates/project.js b/gatsby/lobid/src/templates/project.js index a8fcd3fe..7e90da47 100644 --- a/gatsby/lobid/src/templates/project.js +++ b/gatsby/lobid/src/templates/project.js @@ -45,6 +45,7 @@ export const query = graphql` isBasedOn { id } + url alternateName endDate result { diff --git a/gatsby/lobid/static/product/lobid.json b/gatsby/lobid/static/product/lobid.json index c77d972e..5dc3831d 100644 --- a/gatsby/lobid/static/product/lobid.json +++ b/gatsby/lobid/static/product/lobid.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org", - "id": "https://lobid.org", + "id": "https://lobid.org/product/lobid", + "url": "https://lobid.org", "type": [ "Product" ], @@ -18,7 +19,7 @@ }, "startDate": "2010-08", "maintainer": { - "id": "http://stage.lobid.org/team#!", + "id": "http://lobid.org/team#!", "name": { "de": "Offene Infrastruktur", "en": "Open Infrastructure" @@ -38,12 +39,12 @@ ], "isBasedOn": [ { - "id": "https://metafacture.org" + "id": "https://lobid.org/product/metafacture" } ], "isRelatedTo": [ { - "id": "https://github.com/hbz/lobid-resources/milestone/1" + "id": "https://lobid.org/project/alma-migration" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/product/metafacture.json b/gatsby/lobid/static/product/metafacture.json index 203ba771..3db00349 100644 --- a/gatsby/lobid/static/product/metafacture.json +++ b/gatsby/lobid/static/product/metafacture.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org", - "id": "https://metafacture.org", + "id": "https://lobid.org/product/metafacture", + "url": "https://metafacture.org", "type": [ "Product" ], @@ -8,13 +9,12 @@ "en": "Metafacture", "de": "Metafacture" }, - "url": "https://metafacture.org", "description": { "en": "Metafacture is a toolkit for processing semi-structured data with a focus on library metadata. It provides a versatile set of tools for reading, writing and transforming data. Metafacture can be used as a stand-alone application or as a Java library in other applications. The name Metafacture is a portmanteau of the words meta data and manufacture.", "de": "Metafacture is ein Toolkit für die Verarbeitung von (semi-)strukturierten Daten mit dem Fokus auf bibliothekarische Metadaten. Es bietet ein vielseitiges Set an Werkzeugen für das Auslesen, Schreiben und Transformieren von Daten. Metafacture kann als alleinstehende Applikaiton oder als Java Library in anderen Applikationen genutzt werden. Der Name Metafacture ist eine Zusammensetzung der Wörter Metadaten und manufacture (eng.: herstellen)." }, "maintainer": { - "id": "http://stage.lobid.org/team#!", + "id": "http://lobid.org/team#!", "name": { "de": "Offene Infrastruktur", "en": "Open Infrastructure" diff --git a/gatsby/lobid/static/product/nwbib.json b/gatsby/lobid/static/product/nwbib.json index b9287d32..58243c42 100644 --- a/gatsby/lobid/static/product/nwbib.json +++ b/gatsby/lobid/static/product/nwbib.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org", - "id": "https://nwbib.de", + "id": "https://lobid.org/product/nwbib", + "url": "https://nwbib.de", "type": [ "Product" ], @@ -17,11 +18,11 @@ }, "isBasedOn": [ { - "id": "https://lobid.org" + "id": "https://lobid.org/product/lobid" } ], "maintainer": { - "id": "http://stage.lobid.org/team#!", + "id": "http://lobid.org/team#!", "name": { "de": "Offene Infrastruktur", "en": "Open Infrastructure" diff --git a/gatsby/lobid/static/product/skohub.json b/gatsby/lobid/static/product/skohub.json index 122ae2f4..9ac4c32f 100644 --- a/gatsby/lobid/static/product/skohub.json +++ b/gatsby/lobid/static/product/skohub.json @@ -1,5 +1,6 @@ { - "id": "https://skohub.io", + "id": "https://lobid.org/product/skohub", + "url": "https://skohub.io", "type": [ "Product" ], @@ -7,13 +8,12 @@ "en": "SkoHub", "de": "SkoHub" }, - "url": "https://skohub.io", "description": { "en": "SkoHub supports a novel approach for finding content on the web. The general idea is to extend the scope of Knowledge Organization Systems (KOS) to also act as communication hubs for publishers and information seekers. In effect, SkoHub allows to follow specific subjects in order to be notified when new content about that subject is published.", "de": "SkoHub unterstützt einen neuen Zugang, um Inhalte im Netz zu finden. Die allgemeine Idee von SkoHub ist die Reichweite von Knowledge Organization Systems (KOS) so zu erweitern, dass sie auch als communication hub (?) zwischen Metadatenbereitsteller:innen und Imformationssuchende eingesetzt werden können. In der Tat, ermöglicht SkoHub das Folgen bestimmter Themen, um benachrichtigt zu werden, wenn neue Inhalte veröffentlicht werden." }, "maintainer": { - "id": "http://stage.lobid.org/team#!", + "id": "http://lobid.org/team#!", "name": { "de": "Offene Infrastruktur", "en": "Open Infrastructure" diff --git a/gatsby/lobid/static/project/Alma+Migration.json b/gatsby/lobid/static/project/alma-migration.json similarity index 85% rename from gatsby/lobid/static/project/Alma+Migration.json rename to gatsby/lobid/static/project/alma-migration.json index f8bbba7a..e957b732 100644 --- a/gatsby/lobid/static/project/Alma+Migration.json +++ b/gatsby/lobid/static/project/alma-migration.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://service-wiki.hbz-nrw.de/display/SEM/Alma+Migration", + "id": "https://lobid.org/project/alma-migration", + "url": "https://github.com/hbz/lobid-resources/milestone/1", "type": [ "Project" ], @@ -12,15 +13,14 @@ "en": "Switch lobid-resources ETL and indexing from Aleph to Alma Marc21 XML", "de": "Der schrittweise Umstieg der hbz-Verbundbibliotheken auf das Bibliotheksmanagementsystem Alma im Rahmen des GO:AL-Projekts (GOAL) bringt auch für die Gruppe Offene Infrastruktur dauerhaft Aufgaben mit sich: lobid indexiert unter anderem die Verbunddaten des hbz, die nun schrittweise nach Alma wandern. Demenstprechend müssen sämtliche Prozesse zum Extrahieren, Transformieren und Laden (ETL) der Verbunddaten angepasst werden, damit sie (auch) auf Basis von Alma-Daten funktionieren." }, - "url": "https://github.com/hbz/lobid-resources/milestone/1", "enhances": [ { - "id": "https://lobid.org" + "id": "https://lobid.org/product/lobid" } ], "isBasedOn": [ { - "id": "https://metafacture.org" + "id": "https://lobid.org/product/metafacture" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/lrmi-profile.json b/gatsby/lobid/static/project/lrmi-profile.json index 315f0992..ee64b9da 100644 --- a/gatsby/lobid/static/project/lrmi-profile.json +++ b/gatsby/lobid/static/project/lrmi-profile.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://github.com/dini-ag-kim/lrmi-profile", + "id": "https://lobid.org/project/lrmi-profile", + "url": "https://github.com/dini-ag-kim/lrmi-profile", "type": [ "Project" ], @@ -14,7 +15,7 @@ }, "isBasedOn": [ { - "id": "https://github.com/dini-ag-kim/oer-stoeberspecs" + "id": "https://lobid.org/project/oer-stoeberspecs" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/metafacture-fix.json b/gatsby/lobid/static/project/metafacture-fix.json index 037c78a9..e857c4c9 100644 --- a/gatsby/lobid/static/project/metafacture-fix.json +++ b/gatsby/lobid/static/project/metafacture-fix.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://github.com/metafacture/metafacture-fix", + "id": "https://lobid.org/project/metafacture-fix", + "url": "https://github.com/metafacture/metafacture-fix", "type": [ "Project" ], @@ -12,10 +13,9 @@ "en": "Implementation of the Fix language for Metafacture as an alternative to configuring data transformations with Metamorph", "de": "Ziel des Projekts ist die Erleichterung der Metafacture-Konfiguration und damit die Erweiterung der Zielgruppe um Bibliothekar*innen und andere Metadatenfachleute, die keinen Programmierhintergrund haben.\n\nDies geschieht durch die Implementierung der Fix-DSL für die Konfiguration von Metadatenmappings als Alternative zum XML-basierten Metamorph. Zunächst wird die Erweiterung zur produktiven Nutzung im OERSI-Kontext und anderen neu zu erstellenden ETL-Prozessen entwickelt und dann auf die komplexeren Prozesse – etwa im lobid-Kontext – ausgeweitet.\n\nIn einem nächsten Schritt – voraussichtlich 2022 – wird an einer Standardisierung der Fix-Sprache gearbeitet mit dem Ziel, Kompatibilität zwischen Metafacture und Catmandu zu erreichen." }, - "url": "https://github.com/metafacture/metafacture-fix", "enhances": [ { - "id": "https://metafacture.org" + "id": "https://lobid.org/product/metafacture" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/metafacture-playground.json b/gatsby/lobid/static/project/metafacture-playground.json index 9b99387a..829b9bb4 100644 --- a/gatsby/lobid/static/project/metafacture-playground.json +++ b/gatsby/lobid/static/project/metafacture-playground.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://github.com/metafacture/metafacture-playground", + "id": "https://lobid.org/project/metafacture-playground", + "url": "https://github.com/metafacture/metafacture-playground", "type": [ "Project" ], @@ -12,15 +13,14 @@ "en": "This projects aims to provide a web application to play around with Metafactures languages Fix and Flux.", "de": "Der Metafacture Playground ist eine browserbasierte Umgebung, um an der Konfiguration von ETL-Prozessen mittels Metafacture zu arbeiten. Der Playground nutzt die [Metafacture-Fix-Erweiterung (MFF)](https://github.com/metafacture/metafacture-fix). Kurzfristig soll der Playground zum Teilen von ETL-Konfigurationen via URL und für aktive Arbeit in metafacture-Workshops Verwendung finden.\n\nMittelfristiges Ziel ist der Aufbau einer Plattform zum Teilen von ETL-Konfigurationen, um das Auffinden bestehender Lösungen und deren Nachnutzung zu erleichtern und damit Parallelarbeiten zu vermeiden." }, - "url": "https://github.com/metafacture/metafacture-playground", "enhances": [ { - "id": "https://metafacture.org" + "id": "https://lobid.org/product/metafacture" } ], "isBasedOn": [ { - "id": "https://github.com/metafacture/metafacture-fix" + "id": "https://lobid.org/project/metafacture-fix" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/oer-stoeberspecs.json b/gatsby/lobid/static/project/oer-stoeberspecs.json index c9d9093f..6712b1f2 100644 --- a/gatsby/lobid/static/project/oer-stoeberspecs.json +++ b/gatsby/lobid/static/project/oer-stoeberspecs.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://github.com/dini-ag-kim/oer-stoeberspecs", + "id": "https://lobid.org/project/oer-stoeberspecs", + "url": "https://github.com/dini-ag-kim/oer-stoeberspecs", "type": [ "Project" ], @@ -16,7 +17,7 @@ "endDate": "2020-01-31", "isBasedOn": [ { - "id": "https://skohub.io" + "id": "https://lobid.org/product/skohub" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/oersi.json b/gatsby/lobid/static/project/oersi.json index db16fbfd..4d12a56d 100644 --- a/gatsby/lobid/static/project/oersi.json +++ b/gatsby/lobid/static/project/oersi.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://gitlab.com/oersi", + "id": "https://lobid.org/project/oersi", + "url": "https://oersi.de", "type": [ "Project" ], @@ -15,13 +16,12 @@ "de": "Ein gemeinsames Projekt der TIB Hannover und des hbz zum Aufbau eines offenen Suchindex für Bildungsressourcen", "en": "Common project by TIB Hannover and hbz to create an open search index for educational resources" }, - "url": "https://oersi.de", "isBasedOn": [ { - "id": "https://metafacture.org" + "id": "https://lobid.org/product/metafacture" }, { - "id": "https://github.com/dini-ag-kim/lrmi-profile" + "id": "https://lobid.org/project/lrmi-profile" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/rpb.json b/gatsby/lobid/static/project/rpb.json index e35f5b6a..2bd25289 100644 --- a/gatsby/lobid/static/project/rpb.json +++ b/gatsby/lobid/static/project/rpb.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://github.com/hbz/rpb", + "id": "https://lobid.org/project/rpb", + "url": "https://github.com/hbz/rpb", "type": [ "Project" ], @@ -16,16 +17,16 @@ "endDate": "2022-03-31", "isBasedOn": [ { - "id": "https://metafacture.org" + "id": "https://lobid.org/product/metafacture" }, { - "id": "https://skohub.io" + "id": "https://lobid.org/product/skohub" }, { - "id": "https://nwbib.de" + "id": "https://lobid.org/product/nwbib" }, { - "id": "https://lobid.org" + "id": "https://lobid.org/product/lobid" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/project/skohub-io.json b/gatsby/lobid/static/project/skohub-project.json similarity index 95% rename from gatsby/lobid/static/project/skohub-io.json rename to gatsby/lobid/static/project/skohub-project.json index f0b3d5aa..d5f4530e 100644 --- a/gatsby/lobid/static/project/skohub-io.json +++ b/gatsby/lobid/static/project/skohub-project.json @@ -1,6 +1,7 @@ { "@context": "https://schema.org/", - "id": "https://github.com/skohub-io", + "id": "https://lobid.org/project/skohub-project", + "url": "https://github.com/skohub-io", "type": [ "Project" ], @@ -16,7 +17,7 @@ "endDate": "2020-03-31", "result": [ { - "id": "https://skohub.io" + "id": "https://lobid.org/product/skohub" } ] } \ No newline at end of file diff --git a/gatsby/lobid/static/team.json b/gatsby/lobid/static/team.json index 5e018b90..bf9e5b01 100644 --- a/gatsby/lobid/static/team.json +++ b/gatsby/lobid/static/team.json @@ -72,19 +72,19 @@ "url": "https://www.hbz-nrw.de/produkte/linked-open-data", "makesOffer": [ { - "id": "https://lobid.org", + "id": "https://lobid.org/product/lobid", "name": "lobid" }, { - "id": "https://nwbib.de", + "id": "https://lobid.org/product/nwbib", "name": "NWBib" }, { - "id": "https://metafacture.org", + "id": "https://lobid.org/product/metafacture", "name": "Metafacture" }, { - "id": "https://skohub.io", + "id": "https://lobid.org/product/skohub", "name": "SkoHub" } ],

Website{this.props.project.id}
Website{this.props.project.url || this.props.project.id}
Abgeschlossen{this.props.project.endDate}
{publication.datePublished} {publication.name.de || publication.name.en || publication.id} {publication.about && publication.about.map(a => -

 {simpleProductId(a.id)}

+

 {a.id.slice(a.id.lastIndexOf("/")+1, a.id.lastIndexOf("."))}

)}
{publication.type} JSON-LD