Skip to content
Snippets Groups Projects
Commit cf74e74f authored by Esko Ikkala's avatar Esko Ikkala
Browse files

Creation dates as literals

parent 3fcbddc1
No related branches found
No related tags found
No related merge requests found
...@@ -38,8 +38,7 @@ module.exports = { ...@@ -38,8 +38,7 @@ module.exports = {
} }
OPTIONAL { OPTIONAL {
?expression_creation crm:P4_has_time_span ?timespanId . ?expression_creation crm:P4_has_time_span ?timespanId .
?timespanId skos:prefLabel ?timespanLabel . ?timespanId rdfs:label ?timespan_.
BIND(CONCAT(STR(?timespanLabel), ";", STR(?timespanId)) AS ?timespan_)
} }
OPTIONAL { OPTIONAL {
?expression_creation crm:P7_took_place_at ?creationPlaceId . ?expression_creation crm:P7_took_place_at ?creationPlaceId .
......
...@@ -46,14 +46,14 @@ export const groupBy = (sparqlBindings, group) => Object.values(_.reduce(sparqlB ...@@ -46,14 +46,14 @@ export const groupBy = (sparqlBindings, group) => Object.values(_.reduce(sparqlB
// }; // };
export const mapManuscripts = (sparqlBindings) => { export const mapManuscripts = (sparqlBindings) => {
//console.log(sparqlBindings); console.log(sparqlBindings);
const results = sparqlBindings.map(b => { const results = sparqlBindings.map(b => {
return { return {
id: b.id.value, id: b.id.value,
manuscriptRecord: _.has(b, 'manuscriptRecord') ? b.manuscriptRecord.value : '-', manuscriptRecord: _.has(b, 'manuscriptRecord') ? b.manuscriptRecord.value : '-',
prefLabel: b.prefLabel.value.split('|'), prefLabel: b.prefLabel.value.split('|'),
author: _.has(b, 'author',) ? createObjectList(b.author.value, 'names') : '-', author: _.has(b, 'author',) ? createObjectList(b.author.value, 'names') : '-',
timespan: _.has(b, 'timespan',) ? createObjectList(b.timespan.value) : '-', timespan: _.has(b, 'timespan',) ? b.timespan.value.split('|') : '-',
creationPlace: _.has(b, 'creationPlace',) ? createObjectList(b.creationPlace.value, 'places') : '-', creationPlace: _.has(b, 'creationPlace',) ? createObjectList(b.creationPlace.value, 'places') : '-',
material: _.has(b, 'material',) ? b.material.value.split('|') : '-', material: _.has(b, 'material',) ? b.material.value.split('|') : '-',
language: _.has(b, 'language',) ? b.language.value.split('|') : '-', language: _.has(b, 'language',) ? b.language.value.split('|') : '-',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment