From 082777410c839bcdc64e6e293b8fd662ebab84e2 Mon Sep 17 00:00:00 2001 From: Aaron Gundel Date: Tue, 29 Oct 2024 12:59:42 -0600 Subject: [PATCH 1/2] fixes jsonld export issue for geojson features --- .../core/geojson_feature_collection.py | 3 +- releases/7.6.3.md | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 releases/7.6.3.md diff --git a/arches/app/datatypes/core/geojson_feature_collection.py b/arches/app/datatypes/core/geojson_feature_collection.py index 1242f306282..84337ef7fa3 100644 --- a/arches/app/datatypes/core/geojson_feature_collection.py +++ b/arches/app/datatypes/core/geojson_feature_collection.py @@ -412,7 +412,8 @@ def to_rdf(self, edge_info, edge): data = edge_info["range_tile_data"] if data["type"] == "FeatureCollection": for f in data["features"]: - del f["id"] + if "id" in f: + del f["id"] del f["properties"] g.add( ( diff --git a/releases/7.6.3.md b/releases/7.6.3.md new file mode 100644 index 00000000000..8e2e84996cb --- /dev/null +++ b/releases/7.6.3.md @@ -0,0 +1,31 @@ +## Arches 7.6.3 Release Notes + +### Bug Fixes and Enhancements + +- Fix issue with JSON-LD export failing when geojson features have no "id". [11587](https://github.com/archesproject/arches/issues/11587) + +### Dependency changes: + +``` +Python: + Upgraded: + None +JavaScript: + Upgraded: + none +``` + +### Upgrading Arches + +1. Upgrade to version 7.6.0 before proceeding by following the upgrade process in the [Version 7.6.0 release notes](https://github.com/archesproject/arches/blob/dev/7.6.x/releases/7.6.0.md) + +2. Upgrade to Arches 7.6.3 + + ``` + pip install --upgrade arches==7.6.3 + ``` + +3. If you are running Arches on Apache, restart your server: + ``` + sudo service apache2 reload + ``` From 6728c6098e20c514b753246a76a4daa2158f9a3a Mon Sep 17 00:00:00 2001 From: Aaron Gundel Date: Wed, 6 Nov 2024 16:07:31 -0700 Subject: [PATCH 2/2] Adds test --- tests/exporter/datatype_to_rdf_tests.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/exporter/datatype_to_rdf_tests.py b/tests/exporter/datatype_to_rdf_tests.py index d3e6c161e0e..86a4cfccf3c 100644 --- a/tests/exporter/datatype_to_rdf_tests.py +++ b/tests/exporter/datatype_to_rdf_tests.py @@ -261,6 +261,31 @@ def test_rdf_concept(self): in graph ) + def test_rdf_geojson(self): + dt = self.DT.get_instance("geojson-feature-collection") + edge_info = {} + edge_info["range_tile_data"] = { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "1", + "geometry": { + "type": "Point", + "coordinates": [13.400257324930152, 52.50578474077699], + }, + "properties": {}, + } + ], + } + edge_info["r_uri"] = URIRef("http://vocab.getty.edu/aat/300047196") + edge_info["d_uri"] = URIRef("http://vocab.getty.edu/aat/300047196") + edge = Mock() + edge.ontologyproperty = CIDOC_NS["P2_has_type"] + edge.rangenode.ontologyclass = CIDOC_NS["E55_Type"] + graph = dt.to_rdf(edge_info, edge) + self.assertTrue("13.400257324930152" in str(graph.serialize())) + def test_rdf_concept_list(self): dt = self.DT.get_instance("concept-list") concept_list = [