Commit 9c297587 authored by root's avatar root
Browse files

Added clickable metadata to IIIF Template. Refactored.

parent 8884e080
......@@ -5,17 +5,24 @@
],
"@type": "sc:Manifest",
"@id": "https://herbarium-dev.bgbm.org/iiif/manifest/manifest.json",
"label": "{{ specimen[config['label']] }}",
"description": "{{ specimen[config['description']] }}",
"label": "{{ specimen[iiif_literals['label']] }}",
"description": "{{ specimen[iiif_literals['description']] }}",
"metadata": [
{% set first = true %}
{% for element, column in metadata|merge(literals)|merge(resources)|merge(wikidata) %}
{% if specimen[column] is not empty %}
{% for element, column in iiif_literals|merge(rdf_literals) %}
{% if element is not same as('label') and element is not same as('description') and specimen[column] is not empty %}
{% if not first %},{% endif %}
{% set first = false %}
{"label":"{{ element }}", "value": "{{ specimen[column] }}"}
{% endif %}
{% endfor %}
{% for element, column in iiif_resources|merge(rdf_resources)|merge(rdf_wikidata) %}
{% if element is not same as('rdf:about') and specimen[column] is not empty %}
{% if not first %},{% endif %}
{% set first = false %}
{"label":"{{ element }}", "value": "<a href=\"{{ specimen[column] }}\">{{ specimen[column] }}</a>"}
{% endif %}
{% endfor %}
],
"attribution": "Botanisches Museum und Botanischer Garten Berlin",
"logo": "https://www.bgbm.org/sites/all/themes/bgbm_fucd20/images/logo_bgbm.jpg",
......
......@@ -25,7 +25,7 @@ query_rdf_one = 'SELECT TOP 1 * from trRdf_complete WHERE HerbariumID=?;'
query_rdf_all = 'SELECT * from trRdf_complete;'
query_iiif = 'SELECT * from view_iiif_rdf WHERE HerbariumID=?;'
[rdfmapping/literals]
[rdf/literals]
; Mapping of RDF-Literals to Database Column Names returned by query_rdf_one (see above)
; Display Example: <dc:title>My Title</dc:title>
dc:title = 'Title'
......@@ -56,20 +56,20 @@ dwc:recordedBy = 'Collector'
dwc:fieldNumber = 'CollectorNumber'
[rdfmapping/resources]
[rdf/resources]
; Mapping of RDF-Resources to Database Column Names returned by query_rdf_one (see above)
; You can add and remove RDF-Elements from this list to adjust the RDF to your needs
; Display Example: <dwc:associatedMedia rdf:resource="http://subdomain.domain.de/myimage"/>
dwc:associatedMedia = 'Image'
dwciri:recordedBy = 'WIKIDATA_ID'
[rdfmapping/wikidata]
[rdf/wikidata]
rdf:about = 'WIKIDATA_ID'
owl:sameAsHuH = 'HUH_PURL'
owl:sameAsViaf = 'VIAF_ID'
[rdfmapping/iiif]
; Mapping of Relation-Fields linking to IIF-Data to Database Column Names
[rdf/iiif]
; Mapping of Relation-Fields linking to IIIF-Data to Database Column Names
; returned by query_rdf_one (see above)
; Display Example:
; <dc:relation>
......@@ -106,18 +106,25 @@ rdf:about = 'ObjectURI'
dc:title = 'Title'
[iiif]
; IIIF API Endpoint (e.g. provided by digilib)
; Digilib IIIF API Endpoint
endpoint = 'https://pictures.bgbm.org/digilib/Scaler/IIIF/'
; Digilib image base URL
image_base_url = 'https://pictures.bgbm.org/digilib/digilib.html?fn='
; Mapping of IIIF manifest parameters to Database Column Names returned by query_rdf_one (see above)
description = 'TitleDescription'
label = 'Title'
; Column Names returned by query_iiif (see above) containing the digilib request path and file name
requestpath = 'RequestPath'
filename = 'name'
[iiif/metadata]
[iiif/literals]
; Mapping of IIIF Manifest parameters to Database Column Names returned by query_rdf_one (see above)
label = 'Title'
description = 'TitleDescription'
; You can add and delete Elements below this to adjust the IIIF Metadata to your needs
[iiif/resources]
; Mapping of IIIF Manifest parameters to Database Column Names returned by query_rdf_one (see above)
; Produces "clickable" metadata entries
CETAF_ID = ObjectURI
; You can add and delete Elements below this to adjust the IIIF Metadata to your needs
......@@ -68,12 +68,13 @@ $app->group('/object', function() use ($app) {
return $this->view->render($response, 'specimen.manifest.template.twig', [
'barcode' => $barcode,
'specimen' => $specimen,
'literals' => Config::get('rdfmapping/literals'),
'resources'=> Config::get('rdfmapping/resources'),
'wikidata'=> Config::get('rdfmapping/wikidata'),
'iiif' => $iiif,
'config' => Config::get('iiif'),
'metadata' => Config::get('iiif/metadata')
'rdf_literals' => Config::get('rdf/literals'),
'rdf_resources'=> Config::get('rdf/resources'),
'rdf_wikidata'=> Config::get('rdf/wikidata'),
'iiif_literals' => Config::get('iiif/literals'),
'iiif_resources' => Config::get('iiif/resources')
])->withHeader('Content-type', 'application/json')
->withHeader("Access-Control-Allow-Origin","*")
->withHeader("Access-Control-Allow-Methods","GET");
......@@ -132,10 +133,10 @@ $app->group('/data', function() use ($app) {
return $this->view->render($response, 'specimen.rdf.template.twig', [
'barcode' => $barcode,
'specimen' => $specimen,
'literals' => Config::get('rdfmapping/literals'),
'resources'=> Config::get('rdfmapping/resources'),
'wikidata'=> Config::get('rdfmapping/wikidata'),
'iiif' => Config::get('rdfmapping/iiif')
'literals' => Config::get('rdf/literals'),
'resources'=> Config::get('rdf/resources'),
'wikidata'=> Config::get('rdf/wikidata'),
'iiif' => Config::get('rdf/iiif')
])->withHeader('Content-type', Config::get('contenttypes')['rdf']);
})->setName('rdf');
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment