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

Update sdbm links

parent 404d6f99
No related branches found
No related tags found
No related merge requests found
...@@ -93,13 +93,15 @@ class VirtualizedTable extends React.PureComponent { ...@@ -93,13 +93,15 @@ class VirtualizedTable extends React.PureComponent {
const idRenderer = ({cellData, rowData}) => { const idRenderer = ({cellData, rowData}) => {
if (cellData == null) return ''; if (cellData == null) return '';
let sdbmUrl = ''; let sdbmUrl = '';
let id = '';
if (rowData.sdbmId == '-') { if (rowData.manuscriptRecord == '-') {
sdbmUrl = 'https://sdbm.library.upenn.edu/entries/'; id = cellData.replace('orphan_', '');
sdbmUrl = 'https://sdbm.library.upenn.edu/entries/' + id;
} else { } else {
sdbmUrl = 'https://sdbm.library.upenn.edu/manuscripts/'; id = cellData.replace('part_', '');
sdbmUrl = rowData.manuscriptRecord;
} }
const idLink = <a target='_blank' rel='noopener noreferrer' href={sdbmUrl + cellData}>{cellData}</a>; const idLink = <a target='_blank' rel='noopener noreferrer' href={sdbmUrl}>{id}</a>;
return ( return (
<div key={cellData}> <div key={cellData}>
{idLink} {idLink}
......
...@@ -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 ?sdbmId ?id ?manuscriptRecord ?entry
(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)
...@@ -47,11 +47,9 @@ module.exports = { ...@@ -47,11 +47,9 @@ module.exports = {
?id crm:P128_carries ?expression . ?id crm:P128_carries ?expression .
?expression crm:P72_has_language ?language_ . ?expression crm:P72_has_language ?language_ .
} }
OPTIONAL { OPTIONAL { ?id mmm-schema:manuscript_record ?manuscriptRecord . }
?id mmm-schema:manuscript_record ?sdbmId .
}
} }
GROUP BY ?id ?sdbmId GROUP BY ?id ?manuscriptRecord ?entry
ORDER BY DESC(?creationPlace) ORDER BY DESC(?creationPlace)
`, `,
'placeQuery': ` 'placeQuery': `
......
...@@ -50,7 +50,7 @@ export const mapManuscripts = (sparqlBindings) => { ...@@ -50,7 +50,7 @@ export const mapManuscripts = (sparqlBindings) => {
const results = sparqlBindings.map(b => { const results = sparqlBindings.map(b => {
return { return {
id: b.id.value, id: b.id.value,
sdbmId: _.has(b, 'sdbmId') ? b.sdbmId.value : '-', manuscriptRecord: _.has(b, 'manuscriptRecord') ? b.manuscriptRecord.value : '-',
prefLabel: b.prefLabel.value, prefLabel: b.prefLabel.value,
author: _.has(b, 'author',) ? b.author.value.split('|') : '-', author: _.has(b, 'author',) ? b.author.value.split('|') : '-',
timespan: _.has(b, 'timespan',) ? b.timespan.value.split('|') : '-', timespan: _.has(b, 'timespan',) ? b.timespan.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