Skip to content

Commit

Permalink
Merge branch 'develop' into feature/annotation_leaflet
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Dec 28, 2023
2 parents 6979133 + ad88d7c commit d380626
Show file tree
Hide file tree
Showing 178 changed files with 6,184 additions and 14,254 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/starter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ jobs:
- name: Run tests
run: |
docker exec -i openatlas /bin/bash -c "cd /var/www/openatlas/tests && nosetests3 -c .noserc --verbosity=2 --nologcapture --nocapture && echo passed"
docker exec -i openatlas /bin/bash -c "cd /var/www/openatlas/tests && nosetests3 -c .noserc --nologcapture --nocapture && echo passed"
1 change: 0 additions & 1 deletion openatlas/api/endpoints/iiif.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ def get_manifest_version_2(id_: int) -> dict[str, Any]:
"@value": entity.description or '',
"@language": "en"}],
"license": get_license_name(entity),
"attribution": "By OpenAtlas",
"logo": get_logo(),
"sequences": [
IIIFSequenceV2.build_sequence(get_metadata(entity))],
Expand Down
15 changes: 11 additions & 4 deletions openatlas/api/formats/geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from flask import g

from openatlas.api.resources.util import (
link_parser_check,
get_location_link, link_parser_check,
replace_empty_list_values_in_dict_with_none)
from openatlas.api.resources.model_mapper import \
flatten_list_and_remove_duplicates
flatten_list_and_remove_duplicates, get_all_links_of_entities
from openatlas.models.entity import Entity
from openatlas.models.gis import Gis
from openatlas.models.link import Link
Expand All @@ -16,7 +16,11 @@ def get_geojson(
entities: list[Entity],
parser: dict[str, Any]) -> dict[str, Any]:
out = []
links = get_all_links_of_entities([e.id for e in entities], 'P53')
for entity in entities:
if entity.class_.view == 'place':
entity_links = [l_ for l_ in links if l_.domain.id == entity.id]
entity.types.update(get_location_link(entity_links).range.types)
if geoms := [get_geojson_dict(entity, parser, geom)
for geom in get_geom(entity, parser)]:
out.extend(geoms)
Expand Down Expand Up @@ -48,10 +52,13 @@ def get_geojson_v2(
if link_.property.code
in ['P53', 'P74', 'OA8', 'OA9', 'P7', 'P26', 'P27']]
for entity in entities:
entity_links = [
link_ for link_ in links if link_.domain.id == entity.id]
if entity.class_.view == 'place':
entity.types.update(get_location_link(entity_links).range.types)
if geom := get_geoms_as_collection(
entity,
[link_.range.id for link_ in links
if link_.domain.id == entity.id],
[l_.range.id for l_ in entity_links],
parser):
out.append(get_geojson_dict(entity, parser, geom))
return {'type': 'FeatureCollection', 'features': out}
Expand Down
9 changes: 4 additions & 5 deletions openatlas/api/formats/linked_places.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from openatlas import app
from openatlas.api.resources.util import (
get_geometric_collection, get_license_name, get_reference_systems,
replace_empty_list_values_in_dict_with_none, to_camel_case, date_to_str,
get_crm_relation, get_location_id)
get_geometric_collection, get_license_name, get_location_link,
get_reference_systems, replace_empty_list_values_in_dict_with_none,
to_camel_case, date_to_str, get_crm_relation)
from openatlas.models.entity import Entity
from openatlas.models.link import Link
from openatlas.display.util import get_file_path
Expand Down Expand Up @@ -103,8 +103,7 @@ def get_lp_file(links_inverse: list[Link]) -> list[dict[str, str]]:
def get_lp_types(entity: Entity, links: list[Link]) -> list[dict[str, Any]]:
types = []
if entity.class_.view == 'place':
location = Entity.get_by_id(get_location_id(links), types=True)
entity.types.update(location.types)
entity.types.update(get_location_link(links).range.types)
for type_ in entity.types:
type_dict = {
'identifier': url_for(
Expand Down
157 changes: 98 additions & 59 deletions openatlas/api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
],
"paths": {
"/entity/{entityId}": {
"get":
{
"get": {
"tags": [
"Entity Endpoint"
],
Expand Down Expand Up @@ -978,21 +977,16 @@
}
}
},
"/display/{filename}": {
"/display/{entityID}": {
"get": {
"tags": [
"Image Endpoints"
],
"description": "Retrieves the image connected to the requested ID or filename, if it has a licence.",
"description": "Retrieves the image connected to the requested ID or entityID, if it has a licence.",
"operationId": "DisplayImage",
"parameters": [
{
"in": "path",
"name": "filename",
"required": true,
"schema": {
"type": "string"
}
"$ref": "#/components/parameters/entityId"
},
{
"in": "query",
Expand Down Expand Up @@ -1031,6 +1025,52 @@
}
}
},
"/iiif_manifest/{version}/{entityId}": {
"get": {
"tags": [
"Image Endpoints"
],
"description": "Retrieves the manifest of the IIIF image.",
"operationId": "IIIFManifest",
"parameters": [
{
"in": "path",
"name": "version",
"required": true,
"schema": {
"enum": [
2
]
}
},
{
"$ref": "#/components/parameters/entityId"
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"image/jpeg": {
"schema": {
"type": "string",
"format": "binary"
}
},
"image/png": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"404": {
"description": "Something went wrong. Please consult the error message."
}
}
}
},
"/licensed_file_overview/": {
"get": {
"tags": [
Expand Down Expand Up @@ -1258,58 +1298,57 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"entityName": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityDescription": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityAliases": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityCidocClass": {
"$ref": "#/components/schemas/searchCriteria"
},
"entitySystemClass": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityID": {
"$ref": "#/components/schemas/searchCriteria"
},
"typeID": {
"$ref": "#/components/schemas/searchCriteria"
},
"valueTypeID": {
"$ref": "#/components/schemas/searchCriteria"
},
"typeIDWithSubs": {
"$ref": "#/components/schemas/searchCriteria"
},
"typeName": {
"$ref": "#/components/schemas/searchCriteria"
},
"beginFrom": {
"$ref": "#/components/schemas/searchCriteria"
},
"beginTo": {
"$ref": "#/components/schemas/searchCriteria"
},
"endFrom": {
"$ref": "#/components/schemas/searchCriteria"
},
"endTo": {
"$ref": "#/components/schemas/searchCriteria"
},
"relationToID": {
"$ref": "#/components/schemas/searchCriteria"
"type": "object",
"properties": {
"entityName": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityDescription": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityAliases": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityCidocClass": {
"$ref": "#/components/schemas/searchCriteria"
},
"entitySystemClass": {
"$ref": "#/components/schemas/searchCriteria"
},
"entityID": {
"$ref": "#/components/schemas/searchCriteria"
},
"typeID": {
"$ref": "#/components/schemas/searchCriteria"
},
"valueTypeID": {
"$ref": "#/components/schemas/searchCriteria"
},
"typeIDWithSubs": {
"$ref": "#/components/schemas/searchCriteria"
},
"typeName": {
"$ref": "#/components/schemas/searchCriteria"
},
"beginFrom": {
"$ref": "#/components/schemas/searchCriteria"
},
"beginTo": {
"$ref": "#/components/schemas/searchCriteria"
},
"endFrom": {
"$ref": "#/components/schemas/searchCriteria"
},
"endTo": {
"$ref": "#/components/schemas/searchCriteria"
},
"relationToID": {
"$ref": "#/components/schemas/searchCriteria"
}
}
}
}
}
}
}

},
"limit": {
"name": "limit",
Expand Down
4 changes: 4 additions & 0 deletions openatlas/api/resources/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def get_location_id(links: list[Link]) -> int:
return [l_.range.id for l_ in links if l_.property.code == 'P53'][0]


def get_location_link(links: list[Link]) -> Link:
return [l_ for l_ in links if l_.property.code == 'P53'][0]


def get_geoms_by_entity(
location_id: int,
centroid: Optional[bool] = False) -> dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion openatlas/static/manual/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 910e00fd5bab3d3ebb74912af2151662
config: 4fd9d0494c6b9a3491317c7c01426b29
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified openatlas/static/manual/.doctrees/admin/api.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/arche.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/content.doctree
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/execute_sql.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/export.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/frontend.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/general.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/iiif.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/import.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/mail.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/map.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/modules.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/user.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/admin/vocabs.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/actor.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/artifact.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/event.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/feature.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/file.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/human_remains.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/navigation.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/place.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/reference.doctree
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/source.doctree
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/entity/type.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/artifacts.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/journey.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/letters.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/move_event.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/places.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/profession.doctree
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/time_spans.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/examples/types.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/faq.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/features.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/model/cidoc_crm.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/model/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/model/link_checker.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/model/references.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/overview.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/technical/api.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/map.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/network.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/notes.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/profile.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/radiocarbon_dating.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/tools/search.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/troubleshooting/display.doctree
Binary file not shown.
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/troubleshooting/index.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/troubleshooting/login.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/alias.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/date.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/description.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/form.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/menu.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/name.doctree
Binary file not shown.
Binary file modified openatlas/static/manual/.doctrees/ui/table.doctree
Binary file not shown.
Loading

0 comments on commit d380626

Please sign in to comment.