Skip to content

Commit

Permalink
fix(temporal): do not restore geo-properties in temporal or aggregate…
Browse files Browse the repository at this point in the history
…d representation
  • Loading branch information
bobeal committed Jan 9, 2024
1 parent 4df2a69 commit c6eb261
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ object JsonLdUtils {
when (it.value) {
is Map<*, *> -> {
val geoValues = it.value as MutableMap<String, Any>
if (geoValues.isNotEmpty()) {
// in case of an aggregated or temporalValues query, there is no "value" member
if (geoValues.isNotEmpty() && geoValues.containsKey(JSONLD_VALUE_TERM)) {
geoValues[JSONLD_VALUE_TERM] = wktToGeoJson(geoValues[JSONLD_VALUE_TERM] as String)
geoValues
} else geoValues
Expand All @@ -259,8 +260,11 @@ object JsonLdUtils {
is List<*> ->
(it.value as List<Map<String, Any>>).map { geoInstance ->
val geoValues = geoInstance.toMutableMap()
geoValues[JSONLD_VALUE_TERM] = wktToGeoJson(geoValues[JSONLD_VALUE_TERM] as String)
geoValues
// in case of an aggregated or temporalValues query, there is no "value" member
if (geoValues.containsKey(JSONLD_VALUE_TERM)) {
geoValues[JSONLD_VALUE_TERM] = wktToGeoJson(geoValues[JSONLD_VALUE_TERM] as String)
geoValues
} else geoValues
}
else -> it.value
}
Expand Down

0 comments on commit c6eb261

Please sign in to comment.