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 {
idRenderer = (row) => {
let sdbmLink = '';
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 !== '-') {
sdbmLink = row.manuscriptRecord;
} else {
sdbmLink = row.entry;
id = id.replace('orphan_', '');
sdbmLink = 'https://sdbm.library.upenn.edu/entries/' + id;
}
id = id.replace('part_', '');
return (
<div className={this.props.classes.tableColumn}>
<a target='_blank' rel='noopener noreferrer' href={sdbmLink}>{id}</a>
......
......@@ -11,6 +11,7 @@ import Pie from '../components/Pie';
import TopBar from '../components/TopBar';
import CircularProgress from '@material-ui/core/CircularProgress';
import purple from '@material-ui/core/colors/purple';
import Typography from '@material-ui/core/Typography';
import {
updateQuery,
......@@ -163,6 +164,7 @@ let MapApp = (props) => {
//<Typography className={classes.progressTitle} variant="h4">Fetching manuscript data</Typography>
table = (
<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} />
</div>
);
......
......@@ -46,30 +46,34 @@ module.exports = {
PREFIX mmm-schema: <http://ldf.fi/mmm/schema/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX sdbm: <https://sdbm.library.upenn.edu/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT *
WHERE {
{
SELECT DISTINCT ?id {
<FILTER>
?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>
}
FILTER(BOUND(?id))
?id skos:prefLabel ?prefLabel .
?id mmm-schema:entry ?entry .
# ?id mmm-schema:entry ?entry .
OPTIONAL { ?id mmm-schema:manuscript_record ?manuscriptRecord . }
OPTIONAL { ?id crm:P45_consists_of ?material . }
OPTIONAL {
?id crm:P51_has_former_or_current_owner ?owner__id .
?owner__id skos:prefLabel ?owner__prefLabel .
?reifi rdf:subject ?id ;
rdf:predicate crm:P51_has_former_or_current_owner ;
rdf:object ?owner__id ;
mmm-schema:entry ?owner__entry ;
mmm-schema:order ?owner__order .
BIND(REPLACE(STR(?owner__id), "http://ldf.fi/mmm/person/", "https://sdbm.library.upenn.edu/names/") AS ?owner__sdbmLink)
?id crm:P51_has_former_or_current_owner ?owner__id .
?owner__id skos:prefLabel ?owner__prefLabel .
?reifi rdf:subject ?id ;
rdf:predicate crm:P51_has_former_or_current_owner ;
rdf:object ?owner__id ;
mmm-schema:entry ?owner__entry ;
mmm-schema:order ?order .
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 .
OPTIONAL {
......
......@@ -14,8 +14,6 @@ export const getManuscripts = (page, filterObj) => {
const pageSize = 5;
manuscriptQuery = manuscriptQuery.replace('<FILTER>', generateFilter(filterObj));
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)
return sparqlSearchEngine.doSearch(manuscriptQuery, endpoint, makeObjectList);
//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