diff --git a/src/server/sparql/SparqlQueriesEvents.js b/src/server/sparql/SparqlQueriesEvents.js index b510d1d940dba9b56118d838da0fd0f449303dd9..7358aba2179da33ca4998507cac6ed705ca6e2fd 100644 --- a/src/server/sparql/SparqlQueriesEvents.js +++ b/src/server/sparql/SparqlQueriesEvents.js @@ -2,13 +2,13 @@ export const eventProperties = ` { ?id a ?type__id . ?type__id skos:prefLabel|rdfs:label ?type__prefLabel . - BIND(?id AS ?type__dataProviderUrl) + BIND(CONCAT("/events/page/", REPLACE(STR(?id), "^.*\\\\/(.+)", "$1")) AS ?type__dataProviderUrl) } UNION { ?id crm:P7_took_place_at ?place__id . ?place__id skos:prefLabel ?place__prefLabel . - ?place__id owl:sameAs ?place__dataProviderUrl . + BIND(CONCAT("/places/page/", REPLACE(STR(?place__id), "^.*\\\\/(.+)", "$1")) AS ?place__dataProviderUrl) } UNION { @@ -21,18 +21,32 @@ export const eventProperties = ` { ?id crm:P30_transferred_custody_of ?manuscript__id . ?manuscript__id skos:prefLabel ?manuscript__prefLabel . - BIND(?manuscript__id AS ?manuscript__dataProviderUrl) + OPTIONAL { + ?manuscript__id a frbroo:F4_Manifestation_Singleton . + BIND(CONCAT("/manuscripts/page/", REPLACE(STR(?manuscript__id), "^.*\\\\/(.+)", "$1")) AS ?manuscript__dataProviderUrl) + } + OPTIONAL { + ?manuscript__id a crm:E78_Collection . + BIND(CONCAT("/collections/page/", REPLACE(STR(?manuscript__id), "^.*\\\\/(.+)", "$1")) AS ?manuscript__dataProviderUrl) + } } UNION { ?id mmm-schema:observed_manuscript ?manuscript__id . ?manuscript__id skos:prefLabel ?manuscript__prefLabel . - BIND(?manuscript__id AS ?manuscript__dataProviderUrl) + OPTIONAL { + ?manuscript__id a frbroo:F4_Manifestation_Singleton . + BIND(CONCAT("/manuscripts/page/", REPLACE(STR(?manuscript__id), "^.*\\\\/(.+)", "$1")) AS ?manuscript__dataProviderUrl) + } + OPTIONAL { + ?manuscript__id a crm:E78_Collection . + BIND(CONCAT("/collections/page/", REPLACE(STR(?manuscript__id), "^.*\\\\/(.+)", "$1")) AS ?manuscript__dataProviderUrl) + } } UNION { ?id crm:P108_has_produced ?manuscript__id . ?manuscript__id skos:prefLabel ?manuscript__prefLabel . - BIND(?manuscript__id AS ?manuscript__dataProviderUrl) + BIND(CONCAT("/manuscripts/page/", REPLACE(STR(?manuscript__id), "^.*\\\\/(.+)", "$1")) AS ?manuscript__dataProviderUrl) } `; diff --git a/src/server/sparql/SparqlQueriesPlaces.js b/src/server/sparql/SparqlQueriesPlaces.js index 28284b3680cc2274fb74e2f01782b2330f936d1e..ed87cbef683c270f679a642bf4c4adc737381320 100644 --- a/src/server/sparql/SparqlQueriesPlaces.js +++ b/src/server/sparql/SparqlQueriesPlaces.js @@ -18,6 +18,7 @@ export const placeProperties = ` UNION { ?id gvp:broaderPreferred ?area__id . ?area__id skos:prefLabel ?area__prefLabel . + BIND(CONCAT("/places/page/", REPLACE(STR(?area__id), "^.*\\\\/(.+)", "$1")) AS ?area__dataProviderUrl) } UNION { ?id ^mmm-schema:person_place ?actor__id .