Skip to content
Snippets Groups Projects
Commit b6bd97fd authored by esikkala's avatar esikkala
Browse files

Do not fetch entries, generate entry links in result table

parent 724aa514
No related branches found
No related tags found
No related merge requests found
...@@ -108,13 +108,14 @@ class ResultTable extends React.Component { ...@@ -108,13 +108,14 @@ class ResultTable extends React.Component {
idRenderer = (row) => { idRenderer = (row) => {
let sdbmLink = ''; let sdbmLink = '';
let id = row.id.replace('http://ldf.fi/mmm/manifestation_singleton/', ''); let id = row.id.replace('http://ldf.fi/mmm/manifestation_singleton/', '');
id = id.replace('orphan_', '');
id = id.replace('part_', '');
if (has(row, 'manuscriptRecord') && row.manuscriptRecord !== '-') { if (has(row, 'manuscriptRecord') && row.manuscriptRecord !== '-') {
sdbmLink = row.manuscriptRecord; sdbmLink = row.manuscriptRecord;
} else { } else {
sdbmLink = row.entry; sdbmLink = 'https://sdbm.library.upenn.edu/entries/' + id;
id = id.replace('orphan_', '');
} }
id = id.replace('part_', '');
return ( return (
<div className={this.props.classes.tableColumn}> <div className={this.props.classes.tableColumn}>
<a target='_blank' rel='noopener noreferrer' href={sdbmLink}>{id}</a> <a target='_blank' rel='noopener noreferrer' href={sdbmLink}>{id}</a>
......
...@@ -11,6 +11,7 @@ import Pie from '../components/Pie'; ...@@ -11,6 +11,7 @@ import Pie from '../components/Pie';
import TopBar from '../components/TopBar'; import TopBar from '../components/TopBar';
import CircularProgress from '@material-ui/core/CircularProgress'; import CircularProgress from '@material-ui/core/CircularProgress';
import purple from '@material-ui/core/colors/purple'; import purple from '@material-ui/core/colors/purple';
import Typography from '@material-ui/core/Typography';
import { import {
updateQuery, updateQuery,
...@@ -163,6 +164,7 @@ let MapApp = (props) => { ...@@ -163,6 +164,7 @@ let MapApp = (props) => {
//<Typography className={classes.progressTitle} variant="h4">Fetching manuscript data</Typography> //<Typography className={classes.progressTitle} variant="h4">Fetching manuscript data</Typography>
table = ( table = (
<div className={[tableClass, classes.progress].join(' ')}> <div className={[tableClass, classes.progress].join(' ')}>
<Typography className={classes.progressTitle} variant="h4" color='primary'>Fetching manuscript data</Typography>
<CircularProgress style={{ color: purple[500] }} thickness={5} /> <CircularProgress style={{ color: purple[500] }} thickness={5} />
</div> </div>
); );
......
...@@ -46,30 +46,34 @@ module.exports = { ...@@ -46,30 +46,34 @@ module.exports = {
PREFIX mmm-schema: <http://ldf.fi/mmm/schema/> PREFIX mmm-schema: <http://ldf.fi/mmm/schema/>
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/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT * SELECT *
WHERE { WHERE {
{ {
SELECT DISTINCT ?id { SELECT DISTINCT ?id {
<FILTER> <FILTER>
?id a frbroo:F4_Manifestation_Singleton . ?id a frbroo:F4_Manifestation_Singleton .
#?id ^<http://erlangen-crm.org/efrbroo/R18_created>/<http://www.cidoc-crm.org/cidoc-crm/P7_took_place_at> ?orderBy .
} }
<ORDER_BY> ORDER BY ?id
#ORDER BY (!BOUND(?orderBy)) ?orderBy
<PAGE> <PAGE>
} }
FILTER(BOUND(?id)) FILTER(BOUND(?id))
?id skos:prefLabel ?prefLabel . ?id skos:prefLabel ?prefLabel .
?id mmm-schema:entry ?entry . # ?id mmm-schema:entry ?entry .
OPTIONAL { ?id mmm-schema:manuscript_record ?manuscriptRecord . } OPTIONAL { ?id mmm-schema:manuscript_record ?manuscriptRecord . }
OPTIONAL { ?id crm:P45_consists_of ?material . } OPTIONAL { ?id crm:P45_consists_of ?material . }
OPTIONAL { OPTIONAL {
?id crm:P51_has_former_or_current_owner ?owner__id . ?id crm:P51_has_former_or_current_owner ?owner__id .
?owner__id skos:prefLabel ?owner__prefLabel . ?owner__id skos:prefLabel ?owner__prefLabel .
?reifi rdf:subject ?id ; ?reifi rdf:subject ?id ;
rdf:predicate crm:P51_has_former_or_current_owner ; rdf:predicate crm:P51_has_former_or_current_owner ;
rdf:object ?owner__id ; rdf:object ?owner__id ;
mmm-schema:entry ?owner__entry ; mmm-schema:entry ?owner__entry ;
mmm-schema:order ?owner__order . mmm-schema:order ?order .
BIND(REPLACE(STR(?owner__id), "http://ldf.fi/mmm/person/", "https://sdbm.library.upenn.edu/names/") AS ?owner__sdbmLink) BIND(xsd:integer(?order) + 1 AS ?owner__order)
BIND(REPLACE(STR(?owner__id), "http://ldf.fi/mmm/person/", "https://sdbm.library.upenn.edu/names/") AS ?owner__sdbmLink)
} }
?expression_creation frbroo:R18_created ?id . ?expression_creation frbroo:R18_created ?id .
OPTIONAL { OPTIONAL {
......
...@@ -14,8 +14,6 @@ export const getManuscripts = (page, filterObj) => { ...@@ -14,8 +14,6 @@ export const getManuscripts = (page, filterObj) => {
const pageSize = 5; const pageSize = 5;
manuscriptQuery = manuscriptQuery.replace('<FILTER>', generateFilter(filterObj)); manuscriptQuery = manuscriptQuery.replace('<FILTER>', generateFilter(filterObj));
manuscriptQuery = manuscriptQuery.replace('<PAGE>', `LIMIT ${pageSize} OFFSET ${page * pageSize}`); manuscriptQuery = manuscriptQuery.replace('<PAGE>', `LIMIT ${pageSize} OFFSET ${page * pageSize}`);
//manuscriptQuery = manuscriptQuery.replace('<ORDER_BY>', `ORDER BY (!BOUND(?orderBy)) ?orderBy`);
manuscriptQuery = manuscriptQuery.replace('<ORDER_BY>', `ORDER BY ?id`);
// console.log(manuscriptQuery) // console.log(manuscriptQuery)
return sparqlSearchEngine.doSearch(manuscriptQuery, endpoint, makeObjectList); return sparqlSearchEngine.doSearch(manuscriptQuery, endpoint, makeObjectList);
//return sparqlSearchEngine.doSearch(manuscriptQuery, endpoint, mapManuscripts); //return sparqlSearchEngine.doSearch(manuscriptQuery, endpoint, mapManuscripts);
......
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