Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CETAF
StableIdentifierNegotiation
Commits
9c297587
Commit
9c297587
authored
Jun 03, 2019
by
root
Browse files
Added clickable metadata to IIIF Template. Refactored.
parent
8884e080
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/templates/specimen.manifest.template.twig
View file @
9c297587
...
...
@@ -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
(
r
esources
)
|
merge
(
wikidata
)
%}
{%
if
specimen
[
column
]
is
not
empty
%}
{%
for
element
,
column
in
iiif_
literals
|
merge
(
r
df_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",
...
...
config.ini
View file @
9c297587
...
...
@@ -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=?;'
[rdf
mapping
/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'
[rdf
mapping
/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'
[rdf
mapping
/wikidata]
[rdf/wikidata]
rdf:
about
=
'WIKIDATA_ID'
owl:
sameAsHuH
=
'HUH_PURL'
owl:
sameAsViaf
=
'VIAF_ID'
[rdf
mapping
/iiif]
; Mapping of Relation-Fields linking to IIF-Data to Database Column Names
[rdf/iiif]
; Mapping of Relation-Fields linking to II
I
F-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
public/index.php
View file @
9c297587
...
...
@@ -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
(
'rdf
mapping
/literals'
),
'resources'
=>
Config
::
get
(
'rdf
mapping
/resources'
),
'wikidata'
=>
Config
::
get
(
'rdf
mapping
/wikidata'
),
'iiif'
=>
Config
::
get
(
'rdf
mapping
/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'
);
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment