Skip to content

Commit

Permalink
feat: Update to LDWizard v4 (#57)
Browse files Browse the repository at this point in the history
* Feat: Update to LDWizard v4

* Update to v4.0.1
  • Loading branch information
GerwinBosch authored Mar 26, 2024
1 parent a6d9613 commit 0952861
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 9,865 deletions.
73 changes: 33 additions & 40 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,11 @@ import favIcon from "./favicon.png";
// @ts-ignore
import homePage from "./homePage.md";

var sourceList=await getRefinementList();
async function initSources() {
var sourceList = await getRefinementList();

const refinements:ColumnRefinement[] = [
{
label: "Verwerk als URI/IRI",
type: "single",
description:
"In this transformation the returned value should be an IRI, this can be applied to the 'IRIs' column in the example.csv file",
transformation: async (term: string) => {
return `${term}`;
},
yieldsIri: true,
keepOriginalValue: {
keepValue: false,
},
},
/*
{
label: "Termennetwerk - Concepten",
type:"single",
description:
"Deze transformatie gebruikt het Termennetwerk om waardes in deze kolom te vervangen door de AAT-URIs van deze termen mits exact gematched. Zie de 'enriched csv' voor de details van deze matching. Voer de definitieve conversie hierop uit na controle van de matches.",
transformation: async (searchTerm: string) => {
const sources = [
"http://vocab.getty.edu/aat/sparql",
"https://data.cultureelerfgoed.nl/PoolParty/sparql/term/id/cht",
];
return getUriOfSearchTerm(sources, searchTerm);
},
yieldsIri: true
},
*/
];

const list = refinements.concat(sourceList);
globalThis.wizardConfig.columnRefinements.push(...sourceList);
}

const wizardConfig: WizardConfig = {
appName: "LDWizard - Erfgoed",
Expand All @@ -55,8 +25,14 @@ const wizardConfig: WizardConfig = {
publishOrder: ["download"],
icon: img,
favIcon: favIcon,
classConfig: { method:"elastic", endpoint: "https://api.data.netwerkdigitaalerfgoed.nl/datasets/NDE/ldwizard/services/ldwizard/_search" },
predicateConfig: { method:"elastic", endpoint: "https://api.data.netwerkdigitaalerfgoed.nl/datasets/NDE/ldwizard/services/ldwizard/_search" },
classConfig: {
method: "elastic",
endpoint: "https://api.data.netwerkdigitaalerfgoed.nl/datasets/NDE/ldwizard/services/ldwizard/_search",
},
predicateConfig: {
method: "elastic",
endpoint: "https://api.data.netwerkdigitaalerfgoed.nl/datasets/NDE/ldwizard/services/ldwizard/_search",
},
dataplatformLink: "https://data.netwerkdigitaalerfgoed.nl/",
repositoryLink: "https://github.com/netwerk-digitaal-erfgoed/LDWizard-ErfgoedWizard",
getAllowedPrefixes: async () => {
Expand All @@ -65,9 +41,26 @@ const wizardConfig: WizardConfig = {
const prefixes: PrefixEntry[] = await response.json();
return prefixes;
}
console.error("Prefixes retrieval failed")
console.error("Prefixes retrieval failed");
return [];
},
columnRefinements: list
}
export default globalThis.wizardConfig = wizardConfig;
columnRefinements: [
{
label: "Verwerk als URI/IRI",
type: "single",
description:
"In this transformation the returned value should be an IRI, this can be applied to the 'IRIs' column in the example.csv file",
transformation: async (term: string) => {
return `${term}`;
},
yieldsIri: true,
keepOriginalValue: {
keepValue: false,
owlSameAsRelationship: false,
},
},
],
};

export default globalThis.wizardConfig = wizardConfig;
initSources();
15 changes: 6 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
FROM node:18-alpine as build
FROM node:20-alpine as build

RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python3 git
RUN npm install --quiet node-gyp -g
WORKDIR /app

COPY package.json ./
COPY yarn.lock ./
COPY .yarn ./app/
COPY .yarnrc ./app/
RUN yarn
COPY package-lock.json ./
RUN npm ci

COPY . .
RUN yarn build
RUN npm run build --omit=dev

ARG CONFIG_FILE
# RUN yarn add "@pldn/ldwizard"
RUN yarn ldwizard-build ${CONFIG_FILE}

RUN npm exec ldwizard-build ${CONFIG_FILE}


FROM nginx:stable-alpine
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"homepage": "https://github.com/netwerk-digitaal-erfgoed/LDWizard-ErfgoedWizard#readme",
"dependencies": {
"@pldn/ldwizard": "^3.0.7",
"@pldn/ldwizard": "^4.0.1",
"graphql": "^15.5.0",
"graphql-request": "^3.4.0"
}
Expand Down
Loading

0 comments on commit 0952861

Please sign in to comment.