Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Dec 20, 2023
1 parent 570c342 commit 8901b66
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions config/api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
API_VERSIONS = ['0.3', '0.4']

API_CONTEXT = {
'LPF': 'https://raw.githubusercontent.com/LinkedPasts/linked-places/'
'master/linkedplaces-context-v1.1.jsonld',
'LPF':
'https://raw.githubusercontent.com/LinkedPasts/linked-places/'
'master/linkedplaces-context-v1.1.jsonld',
'LOUD': 'https://linked.art/ns/v1/linked-art.json'}

CORS_ALLOWANCE = '*' # Cross-Origin source (CORS)
Expand All @@ -28,7 +29,10 @@
'entitySystemClass', 'typeName', 'typeNameWithSubs',
'beginFrom', 'beginTo', 'endFrom', 'endTo']
INT_CATEGORIES: list[str] = [
'entityID', 'typeID', 'typeIDWithSubs', 'relationToID']
'entityID',
'typeID',
'typeIDWithSubs',
'relationToID']
SET_CATEGORIES: list[str] = ['valueTypeID']
VALID_CATEGORIES: list[str] = [
*STR_CATEGORIES,
Expand Down
2 changes: 1 addition & 1 deletion config/database_versions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Used for automatic database upgrades and database version checks
# Used for automatic database upgrades and version checks
DATABASE_VERSIONS = [
'8.0.0',
'7.17.0',
Expand Down
3 changes: 1 addition & 2 deletions openatlas/database/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ def get_subunits_without_super(classes: list[str]) -> list[int]:
"""
SELECT e.id
FROM model.entity e
JOIN model.link l ON e.id = l.range_id
AND l.property_code = 'P46'
JOIN model.link l ON e.id = l.range_id AND l.property_code = 'P46'
WHERE e.openatlas_class_name IN %(classes)s;
""",
{'classes': tuple(classes)})
Expand Down
3 changes: 2 additions & 1 deletion openatlas/database/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,6 @@ def check_single_type_duplicates(ids: list[int]) -> list[int]:
WHERE property_code = 'P2' AND range_id IN %(ids)s
GROUP BY domain_id
HAVING COUNT(*) > 1;
""", {'ids': tuple(ids)})
""",
{'ids': tuple(ids)})
return [row['domain_id'] for row in g.cursor.fetchall()]
3 changes: 2 additions & 1 deletion openatlas/database/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def get_ego_network(ids: set[int]) -> list[dict[str, Any]]:
SELECT id, domain_id, property_code, range_id
FROM model.link
WHERE domain_id IN %(ids)s or range_id IN %(ids)s;
""", {'ids': tuple(ids)})
""",
{'ids': tuple(ids)})
return [dict(row) for row in g.cursor.fetchall()]

@staticmethod
Expand Down

0 comments on commit 8901b66

Please sign in to comment.