Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix geojson/jsonld export issue #11588

Open
wants to merge 3 commits into
base: dev/7.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arches/app/datatypes/core/geojson_feature_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
(
Expand Down
3 changes: 3 additions & 0 deletions releases/7.6.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

- Fixes bug that prevented some Arches Application front-end components from being loaded #[11561](https://github.com/archesproject/arches/issues/11561)

- Fix issue with JSON-LD export failing when geojson features have no "id". [11587](https://github.com/archesproject/arches/issues/11587)

### Dependency changes:

```
Expand All @@ -20,6 +22,7 @@ JavaScript:
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
```
Expand Down
25 changes: 25 additions & 0 deletions tests/exporter/datatype_to_rdf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down