-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-sample.yaml
87 lines (87 loc) · 3.28 KB
/
config-sample.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
defaultVersion: 2.0
serverInfo:
transport: http
host: 127.0.0.1
port: 80
database: ARCHE
databaseInfo:
title:
en: database title
description:
en: database description
author: {}
contact: {}
extent: {}
history: {}
langUsage: {}
restrictions: {}
subjects: {}
links: {}
implementation: {}
# schemaInfo for is fixed for the fcs so no need to describe it
# indexInfo is not needed so far as we support only basic search
configInfo:
default:
maximumRecords: 100
setting: {}
supports: {}
dbConnStr: "pgsql: host=127.0.0.1 port=5432 user=fcs dbname=www-data password=***"
cmdiUrl: https://arche.acdh.oeaw.ac.at/oaipmh/?verb=GetRecordRaw&metadataPrefix=cmdi&identifier=%s
highlighting:
minWords: 5
maxWords: 10
shortWord: 3
maxFragments: 20
resourceQuery:
# The query has to return id, pid, cmdipid, title, language and fragmentpid columns
# The query must return all FCS resources and their fragments (if fragments are in use)
# Fragment have to have a value in the fragmentpid column while resources have to have
# null in the fragmentpid column.
# Resources must provide the title column being a JSON like '[{"lang": "en", "value": "title in English}]'
# and may provide the language column being JSON array of languages applicable to the resource (e.g. "["en"]).
# Resource fragments may provide any values (also nulls) in title and language columns.
query: |
WITH res AS (
SELECT
m1.id,
m1.value AS pid,
m5.value AS cmdipid,
jsonb_agg(DISTINCT jsonb_build_object('lang', m2.lang, 'value', m2.value)) AS title,
jsonb_agg(DISTINCT substring(i4.ids from '[a-z]+$')) AS language
FROM
metadata m1
JOIN metadata m2 USING (id)
JOIN relations r3 ON m1.id = r3.id
JOIN identifiers i3 ON r3.target_id = i3.id
JOIN relations r4 ON m1.id = r4.id
JOIN identifiers i4 ON r4.target_id = i4.id
JOIN metadata m5 ON m1.id = m5.id
WHERE
m1.property = ?
AND m2.property = ?
AND r3.property = ?
AND i3.ids = ?
AND r4.property = ?
AND i4.ids LIKE ?
AND m5.property = ?
GROUP BY 1, 2, 3
)
SELECT id, pid, cmdipid, null::text AS fragmentpid, title, language
FROM res
UNION
SELECT m1.id, res.pid, res.cmdipid AS cmdipid, m1.value AS fragmentpid, res.title, res.language
FROM
metadata m1
JOIN relations r USING (id)
JOIN res ON r.target_id = res.id AND r.property = ?
WHERE m1.property = ?
parameters:
- https://vocabs.acdh.oeaw.ac.at/schema#hasPid
- https://vocabs.acdh.oeaw.ac.at/schema#hasTitle
- https://vocabs.acdh.oeaw.ac.at/schema#hasOaiSet
- https://vocabs.acdh.oeaw.ac.at/archeoaisets/clarin-fcs
- https://vocabs.acdh.oeaw.ac.at/schema#hasLanguage
- https://vocabs.acdh.oeaw.ac.at/iso6393/%
- https://vocabs.acdh.oeaw.ac.at/schema#hasMetadataPid
- https://vocabs.acdh.oeaw.ac.at/schema#isPartOf
- https://vocabs.acdh.oeaw.ac.at/schema#hasPid