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

Order manuscripts by concatenated creation place

parent 68b00caf
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ module.exports = { ...@@ -19,7 +19,7 @@ module.exports = {
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sdbm: <https://sdbm.library.upenn.edu/> PREFIX sdbm: <https://sdbm.library.upenn.edu/>
SELECT SELECT
?id ?manuscriptRecord ?entry ?id ?manuscriptRecord
(GROUP_CONCAT(DISTINCT ?prefLabel_; SEPARATOR=" | ") AS ?prefLabel) (GROUP_CONCAT(DISTINCT ?prefLabel_; SEPARATOR=" | ") AS ?prefLabel)
(GROUP_CONCAT(DISTINCT ?author_; SEPARATOR="|") AS ?author) (GROUP_CONCAT(DISTINCT ?author_; SEPARATOR="|") AS ?author)
(GROUP_CONCAT(DISTINCT ?timespan_; SEPARATOR="|") AS ?timespan) (GROUP_CONCAT(DISTINCT ?timespan_; SEPARATOR="|") AS ?timespan)
...@@ -34,17 +34,17 @@ module.exports = { ...@@ -34,17 +34,17 @@ module.exports = {
OPTIONAL { OPTIONAL {
?expression_creation crm:P14_carried_out_by ?authorId . ?expression_creation crm:P14_carried_out_by ?authorId .
?authorId skos:prefLabel ?authorLabel ?authorId skos:prefLabel ?authorLabel
BIND(CONCAT(STR(?authorId), ";", STR(?authorLabel)) AS ?author_) BIND(CONCAT(STR(?authorLabel), ";", STR(?authorId)) AS ?author_)
} }
OPTIONAL { OPTIONAL {
?expression_creation crm:P4_has_time_span ?timespanId . ?expression_creation crm:P4_has_time_span ?timespanId .
?timespanId skos:prefLabel ?timespanLabel . ?timespanId skos:prefLabel ?timespanLabel .
BIND(CONCAT(STR(?timespanId), ";", STR(?timespanLabel)) AS ?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 .
?creationPlaceId skos:prefLabel ?creationPlaceLabel . ?creationPlaceId skos:prefLabel ?creationPlaceLabel .
BIND(CONCAT(STR(?creationPlaceId), ";", STR(?creationPlaceLabel)) AS ?creationPlace_) BIND(CONCAT(STR(?creationPlaceLabel), ";", STR(?creationPlaceId)) AS ?creationPlace_)
} }
OPTIONAL { OPTIONAL {
?id crm:P128_carries ?expression . ?id crm:P128_carries ?expression .
...@@ -52,7 +52,7 @@ module.exports = { ...@@ -52,7 +52,7 @@ module.exports = {
} }
OPTIONAL { ?id mmm-schema:manuscript_record ?manuscriptRecord . } OPTIONAL { ?id mmm-schema:manuscript_record ?manuscriptRecord . }
} }
GROUP BY ?id ?manuscriptRecord ?entry GROUP BY ?id ?manuscriptRecord
ORDER BY DESC(?creationPlace) ORDER BY DESC(?creationPlace)
LIMIT 2000 LIMIT 2000
`, `,
......
...@@ -67,9 +67,9 @@ const createObjectList = (str, sdbmType) => { ...@@ -67,9 +67,9 @@ const createObjectList = (str, sdbmType) => {
return strings.map(s => { return strings.map(s => {
const values = s.split(';'); const values = s.split(';');
return { return {
id: values[0].substring(values[0].lastIndexOf('/') + 1), id: values[1].substring(values[1].lastIndexOf('/') + 1),
//id: values[0], //id: values[0],
prefLabel: values[1], prefLabel: values[0],
sdbmType: sdbmType sdbmType: sdbmType
}; };
}); });
......
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