Skip to content

Commit

Permalink
feat: Add dataset language (#1133)
Browse files Browse the repository at this point in the history
* Simplify structure

* Fix Iconclass language

* Add API test
  • Loading branch information
ddeboer committed Oct 11, 2023
1 parent 0d8f4ae commit 3e53bc0
Show file tree
Hide file tree
Showing 50 changed files with 66 additions and 11 deletions.
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export default {
],
coverageThreshold: {
global: {
lines: 90.87,
statements: 90.87,
branches: 95.86,
lines: 90.89,
statements: 90.89,
branches: 95.89,
functions: 91.52,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Selectie van AAT termen voor het beschrijven van materialen in architectuur-, kunst- en cultuurhistorische collecties"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://vocab.getty.edu/aat/sparql/materials",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Selectie van AAT termen voor het beschrijven van processen en technieken in architectuur-, kunst- en cultuurhistorische collecties"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://vocab.getty.edu/aat/sparql/processes-and-techniques",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Selectie van AAT termen voor het beschrijven van stijlen en periodes in architectuur-, kunst- en cultuurhistorische collecties"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://vocab.getty.edu/aat/sparql/styles-and-periods",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Onderwerpen voor het beschrijven van architectuur-, kunst- en cultuurhistorische collecties"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://vocab.getty.edu/aat/sparql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Onderwerpen voor het beschrijven van onderzoeken, vondsten en sporen"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.cultureelerfgoed.nl/PoolParty/sparql/term/id/abr",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Straten in Amsterdam"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://druid.datalegend.net/AdamNet/Geography/sparql#streets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Gebouwen in de provincie Noord-Brabant, vooralsnog met een religieuze functie, zoals kloosters"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.brabantcloud.nl/gebouwen/query/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Onderwerpen die de Koninklijke Bibliotheek aan publicaties toekent"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://data.bibliotheken.nl/thes/brinkman/sparql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Onderwerpen voor het beschrijven van materiaal kenmerken van cultureel erfgoed objecten."
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.cultureelerfgoed.nl/PoolParty/sparql/term/id/cht/materials",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Onderwerpen voor het beschrijven van stijl en periode kenmerken van cultureel erfgoed objecten."
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.cultureelerfgoed.nl/PoolParty/sparql/term/id/cht/styles-and-periods",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Onderwerpen voor het beschrijven van cultureel erfgoed"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.cultureelerfgoed.nl/PoolParty/sparql/term/id/cht",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Onderwerpen over alle gebieden waarop de Europese Unie actief is. De nadruk ligt op de parlementaire activiteiten van de EU"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://publications.europa.eu/webapi/rdf/sparql#eurovoc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Selectie van geografische namen zoals plaatsen, administratieve eenheden (gemeentes, provincies) en waterlichamen (rivieren, beken, meren etc.)"
}
],
"inLanguage": "en",
"distribution": [
{
"@id": "https://demo.netwerkdigitaalerfgoed.nl/geonames",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@value": "Straten in Gouda"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://www.goudatijdmachine.nl/id/straten#streets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Classificaties voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0027",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Genres voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0028",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Geografische namen voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0029",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Diverse soorten eigennamen voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0030",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Onderwerpen die slechts voor shots/clips/geluiden worden toegepast voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0032",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Onderwerpen voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0031",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Personen voor het beschrijven van audiovisueel materiaal"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.beeldengeluid.nl/id/datadownload/0026",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Termen voor het beschrijven van LHBTIQ (Lesbisch/Homo/Biseksueel/Transgender/Intersekse/Queer)-publicaties en -erfgoed"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.ihlia.nl/PoolParty/sparql/homosaurus",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Termen voor het beschrijven van de inhoud van afbeeldingen"
}
],
"inLanguage": "en",
"distribution": [
{
"@id": "https://iconclass.org/sparql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Termen voor het beschrijven van collecties uit de periode 1930–1970 rondom voormalig Nederlands-Indië, onafhankelijk Indonesië en de postkoloniale migratie van personen naar Nederland"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://digitaalerfgoed.poolparty.biz/PoolParty/sparql/ied",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Termen voor het beschrijven van museale collecties over het koloniaal verleden"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.cultureelerfgoed.nl/PoolParty/sparql/koloniaalverleden",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Onderwerpen in de catalogus van de bladmuziekcollectie van Stichting Omroep Muziek"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.muziekschatten.nl/sparql/#onderwerpen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Personen in de catalogus van de bladmuziekcollectie van Stichting Omroep Muziek"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.muziekschatten.nl/sparql/#personen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Genres en stijlen in de collectie van Muziekweb"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.muziekweb.nl/MuziekwebOrganization/Muziekweb/sparql/Muziekweb#mw-genresstijlen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Artiesten, zowel personen als groepen, in de collectie van Muziekweb"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.muziekweb.nl/MuziekwebOrganization/Muziekweb/sparql/Muziekweb#mw-personengroepen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Onderwerpen verdeeld over de facetten Functie, Cultuur, Geografische herkomst, Object, Materiaal & Techniek"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.netwerkdigitaalerfgoed.nl/NMVW/thesaurus/sparql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@value": "Naams- en andere persoonsgegevens van auteurs"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://data.bibliotheken.nl/thesp/sparql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@value": "Biografische gegevens van Nederlandse en buitenlandse kunstenaars van de middeleeuwen tot heden"
}
],
"distribution": [
"inLanguage": "nl", "distribution": [
{
"@id": "https://data.netwerkdigitaalerfgoed.nl/rkd/rkdartists/sparql",
"@type": "DataDownload",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Uitgevers, een subset van Short-Title Catalogue Netherlands (STCN)"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "http://data.bibliotheken.nl/thes/drukkers/sparql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Termen voor het beschrijven van muziekinstrumenten, zangstemmen en ensembles (in enkelvoudige en meervoudige bezetting)"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.muziekschatten.nl/sparql/#uitvoeringsmedium",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Alle entiteiten in Wikidata, zoals beroepen, films of kunstwerken"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://query.wikidata.org/sparql#entities-all",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Personen"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://query.wikidata.org/sparql#entities-persons",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Plaatsen in Nederland en België"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://query.wikidata.org/sparql#entities-places",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Straten in Nederland"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://query.wikidata.org/sparql#entities-streets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Korte biografieën van personen die een sleutelrol speelden in de Tweede Wereldoorlog"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.niod.nl/PoolParty/sparql/WO2_biografieen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@value": "Gebeurtenissen, plaatsen, begrippen en objecten uit de Tweede Wereldoorlog"
}
],
"inLanguage": "nl",
"distribution": [
{
"@id": "https://data.niod.nl/PoolParty/sparql/WO2_Thesaurus",
Expand Down
6 changes: 6 additions & 0 deletions packages/network-of-terms-catalog/shacl/dataset.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
},
"sh:minCount": 0
},
{
"sh:path": {
"@id": "schema:inLanguage"
},
"sh:minCount": 1
},
{
"sh:path": {
"@id": "schema:url"
Expand Down
10 changes: 6 additions & 4 deletions packages/network-of-terms-catalog/src/getCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export async function getCatalog(path?: string): Promise<Catalog> {
export async function fromStore(store: RDF.Store[]): Promise<Catalog> {
// Collect all properties for SELECT and GROUP BY so we can flatten the schema:url values into a single value.
const properties =
'?dataset ?name ?description ?creator ?creatorName ?creatorAlternateName ?distribution ?endpointUrl ?searchQuery ?lookupQuery ?reconciliationUrlTemplate ?alternateName';
'?dataset ?name ?description ?creator ?creatorName ?creatorAlternateName ?distribution ?endpointUrl ?searchQuery ?lookupQuery ?reconciliationUrlTemplate ?alternateName ?inLanguage';
const query = `
PREFIX schema: <http://schema.org/>
SELECT ${properties} (GROUP_CONCAT(?url) as ?url) WHERE {
?dataset a schema:Dataset ;
schema:name ?name ;
schema:description ?description ;
schema:inLanguage ?inLanguage ;
schema:creator ?creator ;
schema:distribution ?distribution ;
schema:url ?url .
OPTIONAL { ?dataset schema:alternateName ?alternateName . }
?creator schema:name ?creatorName ;
schema:alternateName ?creatorAlternateName .
?distribution schema:encodingFormat "application/sparql-query" ;
Expand All @@ -52,7 +52,8 @@ export async function fromStore(store: RDF.Store[]): Promise<Catalog> {
?distribution schema:potentialAction/schema:target ?entryPoint .
?entryPoint schema:actionApplication ?reconciliationIri ;
schema:urlTemplate ?reconciliationUrlTemplate .
}
}
OPTIONAL { ?dataset schema:alternateName ?alternateName . }
}
GROUP BY ${properties}
ORDER BY LCASE(?name)`;
Expand Down Expand Up @@ -109,7 +110,8 @@ export async function fromStore(store: RDF.Store[]): Promise<Catalog> {
]
),
],
bindings.get('alternateName')?.value
bindings.get('alternateName')?.value,
bindings.get('inLanguage')?.value
)
);
});
Expand Down
1 change: 1 addition & 0 deletions packages/network-of-terms-catalog/test/catalog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('Catalog', () => {
new IRI('https://data.cultureelerfgoed.nl/term/id/cht/'),
]);
expect(cht.alternateName).toEqual('CHT');
expect(cht.inLanguage).toEqual('nl');
expect(cht.creators[0].name).toEqual(
'Rijksdienst voor het Cultureel Erfgoed'
);
Expand Down
Loading

0 comments on commit 3e53bc0

Please sign in to comment.