|
1 | 1 | # Don't edit this file. To override settings please use instance/production.py
|
| 2 | + |
2 | 3 | from pathlib import Path
|
3 | 4 |
|
| 5 | +# --------------------------------------------------------------------- |
| 6 | +# Network and Security Configuration |
| 7 | +# --------------------------------------------------------------------- |
| 8 | + |
| 9 | +# CORS policy: allow all domains to access the API |
| 10 | +CORS_ALLOWANCE = '*' |
| 11 | + |
| 12 | +# List of allowed IPs to access API services |
| 13 | +ALLOWED_IPS = ['127.0.0.1'] |
| 14 | + |
| 15 | +# --------------------------------------------------------------------- |
| 16 | +# External System Integration |
| 17 | +# --------------------------------------------------------------------- |
| 18 | + |
| 19 | +# Configuration for connecting to ACDH ARCHE systems (if needed) |
| 20 | +ARCHE = {'id': None, 'url': None} |
| 21 | + |
| 22 | +# Password used to access protected Vocabs services |
| 23 | +VOCABS_PASS = '' |
| 24 | + |
| 25 | +# ##################################################################### |
| 26 | +# Do NOT overwrite the settings below, unless you know what you do! # |
| 27 | +# ##################################################################### |
| 28 | + |
| 29 | +# --------------------------------------------------------------------- |
| 30 | +# API Versioning and OpenAPI Documentation |
| 31 | +# --------------------------------------------------------------------- |
| 32 | + |
4 | 33 | API_VERSIONS = ['0.4']
|
5 | 34 |
|
| 35 | +# Path to the main OpenAPI definition file |
6 | 36 | OPENAPI_FILE = \
|
7 | 37 | Path(__file__).parent.parent / 'openatlas' / 'api' / 'openapi.json'
|
| 38 | + |
| 39 | +# Path to the instance-specific OpenAPI definition file |
8 | 40 | OPENAPI_INSTANCE_FILE = Path(__file__).parent.parent / 'files' / 'openapi.json'
|
9 | 41 |
|
| 42 | +# JSON-LD contexts used for semantic enrichment in API responses |
10 | 43 | API_CONTEXT = {
|
11 | 44 | 'LPF':
|
12 | 45 | 'https://raw.githubusercontent.com/LinkedPasts/linked-places/'
|
13 | 46 | 'master/linkedplaces-context-v1.1.jsonld',
|
14 | 47 | 'LOUD': 'https://linked.art/ns/v1/linked-art.json'}
|
15 | 48 |
|
16 |
| -CORS_ALLOWANCE = '*' # Cross-Origin source (CORS) |
17 |
| -ALLOWED_IPS = ['127.0.0.1'] |
| 49 | +# --------------------------------------------------------------------- |
| 50 | +# API Output Formats |
| 51 | +# --------------------------------------------------------------------- |
18 | 52 |
|
19 | 53 | RDF_FORMATS = {
|
20 | 54 | 'pretty-xml': 'application/rdf+xml',
|
21 | 55 | 'n3': 'text/rdf+n3',
|
22 | 56 | 'turtle': 'text/plain',
|
23 | 57 | 'nt': 'text/plain',
|
24 | 58 | 'xml': 'application/xml'}
|
| 59 | + |
25 | 60 | JSON_FORMATS = {
|
26 | 61 | 'lp': 'application/ld+json',
|
27 | 62 | 'lpx': 'application/ld+json',
|
28 | 63 | 'loud': 'application/ld+json',
|
29 | 64 | 'geojson': 'application/json',
|
30 | 65 | 'geojson-v2': 'application/json',
|
31 | 66 | 'presentation': 'application/json'}
|
| 67 | + |
32 | 68 | API_FORMATS = RDF_FORMATS | JSON_FORMATS
|
33 | 69 |
|
| 70 | +# --------------------------------------------------------------------- |
| 71 | +# Search and Filter Configuration |
| 72 | +# --------------------------------------------------------------------- |
| 73 | + |
34 | 74 | LOGICAL_OPERATOR: list[str] = ['and', 'or']
|
| 75 | + |
35 | 76 | STR_VALUES: list[str] = [
|
36 | 77 | 'entityName', 'entityDescription', 'entityAliases', 'entityCidocClass',
|
37 | 78 | 'entitySystemClass', 'typeName', 'typeNameWithSubs',
|
38 | 79 | 'beginFrom', 'beginTo', 'endFrom', 'endTo']
|
| 80 | + |
39 | 81 | INT_VALUES: list[str] = [
|
40 |
| - 'entityID', |
41 |
| - 'typeID', |
42 |
| - 'typeIDWithSubs', |
43 |
| - 'relationToID'] |
| 82 | + 'entityID', 'typeID', 'typeIDWithSubs', 'relationToID'] |
| 83 | + |
44 | 84 | FLOAT_VALUES: list[str] = ['valueTypeID']
|
| 85 | + |
45 | 86 | VALID_VALUES: list[str] = [
|
46 | 87 | *STR_VALUES,
|
47 | 88 | *INT_VALUES,
|
48 | 89 | *FLOAT_VALUES]
|
| 90 | + |
49 | 91 | COMPARE_OPERATORS: list[str] = [
|
50 | 92 | 'equal', 'notEqual', 'greaterThan', 'lesserThan', 'greaterThanEqual',
|
51 | 93 | 'lesserThanEqual', 'like']
|
52 | 94 |
|
53 |
| -# Used to connect to ACDH-CH ARCHE systems |
54 |
| -ARCHE = {'id': None, 'url': None} |
55 |
| - |
56 |
| -# Used to connect to password protected Vocabs systems |
57 |
| -VOCABS_PASS = '' |
| 95 | +# --------------------------------------------------------------------- |
| 96 | +# API Presentation View Settings |
| 97 | +# --------------------------------------------------------------------- |
58 | 98 |
|
59 | 99 | API_PRESENTATION_EXCLUDE_RELATION = [
|
60 | 100 | 'bone',
|
61 | 101 | 'file',
|
62 | 102 | 'type',
|
63 |
| - 'type_tools' |
| 103 | + 'type_tools', |
64 | 104 | 'appellation',
|
65 | 105 | 'object_location',
|
66 | 106 | 'reference_system',
|
|
69 | 109 | 'edition',
|
70 | 110 | 'external_reference']
|
71 | 111 |
|
| 112 | +# --------------------------------------------------------------------- |
| 113 | +# Network Visualization Configuration |
| 114 | +# --------------------------------------------------------------------- |
72 | 115 |
|
| 116 | +# Properties used to identify spatial or location-related relationships |
73 | 117 | LOCATION_PROPERTIES = {'P53', 'P74', 'OA8', 'OA9', 'P7', 'P26', 'P27'}
|
0 commit comments