diff --git a/.changeset/grumpy-steaks-hear.md b/.changeset/grumpy-steaks-hear.md new file mode 100644 index 00000000..d6a95ef6 --- /dev/null +++ b/.changeset/grumpy-steaks-hear.md @@ -0,0 +1,5 @@ +--- +"@zazuko/trifid-plugin-ckan": patch +--- + +The CKAN harvester ignored blank node distributions. All distributions are named nodes now diff --git a/packages/ckan/src/xml.js b/packages/ckan/src/xml.js index e1a3eb0a..4f2c0c16 100644 --- a/packages/ckan/src/xml.js +++ b/packages/ckan/src/xml.js @@ -86,8 +86,9 @@ const toXML = (dataset) => { })) const copiedDistributions = dataset.out(ns.dcat.distribution) - .map(distribution => ({ + .map((distribution, index) => ({ 'dcat:Distribution': { + '@': { 'rdf:about': `${dataset.value}/distribution/${index + 1}` }, 'dcterms:issued': serializeTerm(dataset.out(ns.dcterms.issued)), 'dcterms:modified': serializeTerm(dataset.out(ns.dcterms.modified)), 'dcterms:license': serializeTerm(copyright), diff --git a/packages/ckan/test/ckan.test.js b/packages/ckan/test/ckan.test.js index 42da9e58..10f93262 100644 --- a/packages/ckan/test/ckan.test.js +++ b/packages/ckan/test/ckan.test.js @@ -208,7 +208,7 @@ describe('@zazuko/trifid-plugin-ckan', () => { expect(distributions).to.have.length(2) const expected = await parser.parseStringPromise(` - + 2024-02-01