Skip to content

Commit

Permalink
Merge pull request #728 from colonial-heritage/feat-update-research-g…
Browse files Browse the repository at this point in the history
…uide

feat: update research guide
  • Loading branch information
sdevalk authored Dec 5, 2024
2 parents e7333fc + 8a0ba64 commit 995aeb1
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 117 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/datasets/index.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('search', () => {
const result = await datasets.search();

expect(result).toMatchObject({
totalCount: 14,
totalCount: 15,
});
});
});
9 changes: 7 additions & 2 deletions packages/api/src/datasets/searcher.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('search', () => {
const result = await datasetSearcher.search();

expect(result).toStrictEqual({
totalCount: 14,
totalCount: 15,
offset: 0,
limit: 10,
sortBy: 'name',
Expand Down Expand Up @@ -687,6 +687,11 @@ describe('search', () => {
id: 'The Museum',
name: 'The Museum',
},
{
totalCount: 1,
id: 'NIOD Institute for War, Holocaust and Genocide Studies',
name: 'NIOD Institute for War, Holocaust and Genocide Studies',
},
{
totalCount: 1,
id: 'Research Organisation',
Expand All @@ -695,7 +700,7 @@ describe('search', () => {
],
licenses: [
{
totalCount: 6,
totalCount: 7,
id: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
name: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
},
Expand Down
5 changes: 5 additions & 0 deletions packages/api/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ export type HeritageObject = Thing & {
isPartOf?: Dataset;
};

export type Event = {
id: string;
date?: TimeSpan;
};

export enum ProvenanceEventType {
Acquisition = 'acquisition',
TransferOfCustody = 'transferOfCustody',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ describe('search', () => {
description: 'uitgeverij uit Utrecht',
},
{
id: 'http://www.wikidata.org/entity/Q105964347',
id: 'http://www.wikidata.org/entity/Q131287465',
name: 'Rembrandt',
description: 'Metaalwarenfabriek Rembrandt BV',
description: 'fotograaf',
},
{
id: 'http://www.wikidata.org/entity/Q17330745',
name: 'Rembrandts vader',
description: 'Nederlands acteur',
id: 'http://www.wikidata.org/entity/Q375926',
name: 'Rembrandt Peale',
description: 'Amerikaans kunstschilder (1778-1860)',
},
],
});
Expand All @@ -48,9 +48,9 @@ describe('search', () => {
expect(result).toStrictEqual({
things: [
{
id: 'http://www.wikidata.org/entity/Q352864',
name: 'Pieter Lastman',
description: 'Dutch painter',
id: 'http://www.wikidata.org/entity/Q29885090',
name: 'Neeltje Willemsdr. Zuytbrouck',
description: "Rembrandt's mother",
},
{
id: 'http://www.wikidata.org/entity/Q105964347',
Expand All @@ -60,7 +60,7 @@ describe('search', () => {
{
id: 'http://www.wikidata.org/entity/Q1300641',
name: 'Rembrandt Bugatti',
description: '1884-1916 Italian sculptor',
description: 'Italian sculptor (1884–1916)',
},
],
});
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/objects/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export class HeritageObjectFetcher {
FILTER(LANG(?typeName) = "${options.locale}")
}
# For BC: data providers ought to use the same thesauri
OPTIONAL {
?type rdfs:label ?typeName
FILTER(LANG(?typeName) = "" || LANG(?typeName) = "${options.locale}")
Expand Down Expand Up @@ -215,6 +216,7 @@ export class HeritageObjectFetcher {
FILTER(LANG(?materialName) = "${options.locale}")
}
# For BC: data providers ought to use the same thesauri
OPTIONAL {
?material rdfs:label ?materialName
FILTER(LANG(?materialName) = "" || LANG(?materialName) = "${options.locale}")
Expand Down
19 changes: 19 additions & 0 deletions packages/api/src/objects/searcher.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ describe('search', () => {
name: 'Vincent van Gogh',
},
]),
types: expect.arrayContaining([
{
id: expect.stringContaining(
'https://data.colonialcollections.nl/.well-known/genid/'
),
},
]),
materials: expect.arrayContaining([
{
id: expect.stringContaining(
'https://data.colonialcollections.nl/.well-known/genid/'
),
},
{
id: expect.stringContaining(
'https://data.colonialcollections.nl/.well-known/genid/'
),
},
]),
dateCreated: {
id: expect.stringContaining(
'https://data.colonialcollections.nl/.well-known/genid/'
Expand Down
5 changes: 3 additions & 2 deletions packages/api/src/research-guides/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {Place, Term, Thing} from '../definitions';
import {Event, Place, Term, Thing} from '../definitions';

export type Citation = Thing & {url?: string};

export type ResearchGuide = Thing & {
identifier?: string;
alternateNames?: string[];
abstract?: string;
text?: string;
encodingFormat?: string;
contentReferenceTimes?: Event[];
contentLocations?: Place[];
keywords?: Term[];
citations?: Citation[];
Expand Down
Loading

0 comments on commit 995aeb1

Please sign in to comment.