Skip to content

Commit 3b2b59d

Browse files
Merge branch 'develop' into feature/new_classes
2 parents 3a70603 + 3f4e046 commit 3b2b59d

File tree

1 file changed

+56
-12
lines changed

1 file changed

+56
-12
lines changed

config/api.py

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,106 @@
11
# Don't edit this file. To override settings please use instance/production.py
2+
23
from pathlib import Path
34

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+
433
API_VERSIONS = ['0.4']
534

35+
# Path to the main OpenAPI definition file
636
OPENAPI_FILE = \
737
Path(__file__).parent.parent / 'openatlas' / 'api' / 'openapi.json'
38+
39+
# Path to the instance-specific OpenAPI definition file
840
OPENAPI_INSTANCE_FILE = Path(__file__).parent.parent / 'files' / 'openapi.json'
941

42+
# JSON-LD contexts used for semantic enrichment in API responses
1043
API_CONTEXT = {
1144
'LPF':
1245
'https://raw.githubusercontent.com/LinkedPasts/linked-places/'
1346
'master/linkedplaces-context-v1.1.jsonld',
1447
'LOUD': 'https://linked.art/ns/v1/linked-art.json'}
1548

16-
CORS_ALLOWANCE = '*' # Cross-Origin source (CORS)
17-
ALLOWED_IPS = ['127.0.0.1']
49+
# ---------------------------------------------------------------------
50+
# API Output Formats
51+
# ---------------------------------------------------------------------
1852

1953
RDF_FORMATS = {
2054
'pretty-xml': 'application/rdf+xml',
2155
'n3': 'text/rdf+n3',
2256
'turtle': 'text/plain',
2357
'nt': 'text/plain',
2458
'xml': 'application/xml'}
59+
2560
JSON_FORMATS = {
2661
'lp': 'application/ld+json',
2762
'lpx': 'application/ld+json',
2863
'loud': 'application/ld+json',
2964
'geojson': 'application/json',
3065
'geojson-v2': 'application/json',
3166
'presentation': 'application/json'}
67+
3268
API_FORMATS = RDF_FORMATS | JSON_FORMATS
3369

70+
# ---------------------------------------------------------------------
71+
# Search and Filter Configuration
72+
# ---------------------------------------------------------------------
73+
3474
LOGICAL_OPERATOR: list[str] = ['and', 'or']
75+
3576
STR_VALUES: list[str] = [
3677
'entityName', 'entityDescription', 'entityAliases', 'entityCidocClass',
3778
'entitySystemClass', 'typeName', 'typeNameWithSubs',
3879
'beginFrom', 'beginTo', 'endFrom', 'endTo']
80+
3981
INT_VALUES: list[str] = [
40-
'entityID',
41-
'typeID',
42-
'typeIDWithSubs',
43-
'relationToID']
82+
'entityID', 'typeID', 'typeIDWithSubs', 'relationToID']
83+
4484
FLOAT_VALUES: list[str] = ['valueTypeID']
85+
4586
VALID_VALUES: list[str] = [
4687
*STR_VALUES,
4788
*INT_VALUES,
4889
*FLOAT_VALUES]
90+
4991
COMPARE_OPERATORS: list[str] = [
5092
'equal', 'notEqual', 'greaterThan', 'lesserThan', 'greaterThanEqual',
5193
'lesserThanEqual', 'like']
5294

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+
# ---------------------------------------------------------------------
5898

5999
API_PRESENTATION_EXCLUDE_RELATION = [
60100
'bone',
61101
'file',
62102
'type',
63-
'type_tools'
103+
'type_tools',
64104
'appellation',
65105
'object_location',
66106
'reference_system',
@@ -69,5 +109,9 @@
69109
'edition',
70110
'external_reference']
71111

112+
# ---------------------------------------------------------------------
113+
# Network Visualization Configuration
114+
# ---------------------------------------------------------------------
72115

116+
# Properties used to identify spatial or location-related relationships
73117
LOCATION_PROPERTIES = {'P53', 'P74', 'OA8', 'OA9', 'P7', 'P26', 'P27'}

0 commit comments

Comments
 (0)