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

feat: add support for user defined geo properties #1319

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

bobeal
Copy link
Member

@bobeal bobeal commented Jan 18, 2025

No description provided.

@github-actions github-actions bot added the feature New feature or request label Jan 18, 2025
@bobeal bobeal self-assigned this Jan 18, 2025
@bobeal bobeal added the core Relates to core API label Jan 18, 2025
@bobeal bobeal linked an issue Jan 18, 2025 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Jan 18, 2025

Test Results

   70 files   - 1     70 suites   - 1   1m 21s ⏱️ -4s
1 148 tests  - 6  1 148 ✅  - 6  0 💤 ±0  0 ❌ ±0 
1 187 runs   - 6  1 187 ✅  - 6  0 💤 ±0  0 ❌ ±0 

Results for commit e8a8f68. ± Comparison against base commit 14f80e3.

This pull request removes 196 and adds 36 tests. Note that renamed tests count towards both.
                           …, temporalRepresentation=TEMPORAL_VALUES, withAudit=false, expectation={
                      "@id": "https://uri…
                      "@type": "@json",
                      …
                    "@value": "/A/B"
                    "@value": "/C/D"
                    "@value": 20
                    "…
                    {
                  "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
…
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [1] source={
    "attribute": {
        "type": "Property",
        "value": 12.0,
        "observedAt": "2024-04-14T12:34:56Z"
    }
}, target={
    "attribute": {
        "type": "Property",
        "value": 12.2,
        "unitCode": "GRM"
    }
}, expected={
    "attribute": {
        "type": "Property",
        "value": 12.2,
        "unitCode": "GRM",
        "observedAt": "2024-04-14T12:34:56Z"
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [1] source={
    "attribute": {
        "type": "Property",
        "value": 12.0,
        "observedAt": "2024-04-14T12:34:56Z",
        "subAttribute": {
            "type": "Property",
            "value": "subAttribute"
        }
    }
}, target={
    "attribute": {
        "type": "Property",
        "value": 12.2,
        "unitCode": "GRM",
        "subAttribute": {
            "type": "Property",
            "value": "newSubAttributeValue"
        }
    }
}, expected={
    "attribute": {
        "type": "Property",
        "value": 12.2,
        "unitCode": "GRM",
        "observedAt": "2024-04-14T12:34:56Z",
        "subAttribute": {
            "type": "Property",
            "value": "newSubAttributeValue"
        }
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [2] source={
    "attribute": {
        "type": "Property",
        "value": { "en": "car", "fr": "voiture" }
    }
}, target={
    "attribute": {
        "type": "Property",
        "value": { "fr": "vélo", "es": "bicicleta" }
    }
}, expected={
    "attribute": {
        "type": "Property",
        "value": { "en": "car", "fr": "vélo", "es": "bicicleta" }
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [2] source={
    "incoming": {
        "type": "JsonProperty",
        "json": { "id": 1, "b": null, "c": 12.4 },
        "observedAt": "2022-12-24T14:01:22.066Z",
        "subAttribute": {
            "type": "Property",
            "value": "subAttribute"
        }
    }
}, target={
    "incoming": {
        "type": "JsonProperty",
        "json": { "id": 2, "b": "something" },
        "observedAt": "2023-12-24T14:01:22.066Z"
    }
}, expected={
    "incoming": {
        "type": "JsonProperty",
        "json": { "id": 2, "b": "something" },
        "observedAt": "2023-12-24T14:01:22.066Z",
        "subAttribute": {
            "type": "Property",
            "value": "subAttribute"
        }
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [3] source={
    "attribute": {
        "type": "Property",
        "value": [ "car", "voiture" ]
    }
}, target={
    "attribute": {
        "type": "Property",
        "value": [ "vélo", "bicicleta" ]
    }
}, expected={
    "attribute": {
        "type": "Property",
        "value": [ "vélo", "bicicleta" ]
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [3] source={
    "attribute": {
        "type": "VocabProperty",
        "vocab": "stellio"
    }
}, target={
    "attribute": {
        "type": "VocabProperty",
        "vocab": "egm"
    }
}, expected={
    "attribute": {
        "type": "VocabProperty",
        "vocab": "egm"
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [4] source={
    "attribute": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:Entity:01"
    }
}, target={
    "attribute": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:Entity:02"
    }
}, expected={
    "attribute": {
        "type": "Relationship",
        "object": "urn:ngsi-ld:Entity:02"
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [5] source={
    "attribute": {
        "type": "LanguageProperty",
        "languageMap": { "en": "train", "fr": "train" }
    }
}, target={
    "attribute": {
        "type": "LanguageProperty",
        "languageMap": { "fr": "TGV", "es": "tren" }
    }
}, expected={
    "attribute": {
        "type": "LanguageProperty",
        "languageMap": { "en": "train", "fr": "TGV", "es": "tren" }
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [6] source={
    "incoming": {
        "type": "JsonProperty",
        "json": { "a": 1, "b": "thing" }
    }
}, target={
    "incoming": {
        "type": "JsonProperty",
        "json": { "a": 2, "c": "other thing" }
    }
}, expected={
    "incoming": {
        "type": "JsonProperty",
        "json": { "a": 2, "b": "thing", "c": "other thing" }
    }
}
com.egm.stellio.search.entity.util.PatchAttributeTests ‑ [7] source={
    "attribute": {
        "type": "VocabProperty",
        "vocab": "stellio"
    }
}, target={
    "attribute": {
        "type": "VocabProperty",
        "vocab": "egm"
    }
}, expected={
    "attribute": {
        "type": "VocabProperty",
        "vocab": "egm"
    }
}
…

♻️ This comment has been updated with latest results.

@bobeal bobeal force-pushed the feature/1318-user-defined-geo-properties branch from 6e3d547 to e8a8f68 Compare January 19, 2025 13:10
@thomasBousselin
Copy link
Contributor

It will be easier to review if it was based on the "chore/remove-unused-observation-listener" branch.

@bobeal bobeal changed the base branch from develop to chore/remove-unused-observation-listener January 20, 2025 08:32
@bobeal
Copy link
Member Author

bobeal commented Jan 20, 2025

It will be easier to review if it was based on the "chore/remove-unused-observation-listener" branch.

indeed, forgot to do it.

@bobeal
Copy link
Member Author

bobeal commented Jan 20, 2025

It will be easier to review if it was based on the "chore/remove-unused-observation-listener" branch.

indeed, forgot to do it.

and done.

Base automatically changed from chore/remove-unused-observation-listener to develop January 20, 2025 08:53
Copy link
Contributor

@thomasBousselin thomasBousselin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the "geometryProperty" parameter was only working for location, observationSpace and operationSpace?
Have you checked that it work with the other properties?

@bobeal
Copy link
Member Author

bobeal commented Jan 20, 2025

So the "geometryProperty" parameter was only working for location, observationSpace and operationSpace? Have you checked that it work with the other properties?

The main point is to fix the issue referenced.

As for the geometryProperty, it is another thing (and the code is dumb on this, just trying to get the property with the name passed as parameter)

@bobeal bobeal force-pushed the feature/1318-user-defined-geo-properties branch from e8a8f68 to fa1bbd2 Compare January 20, 2025 10:57
@bobeal bobeal merged commit f30c18e into develop Jan 20, 2025
7 of 8 checks passed
@bobeal bobeal deleted the feature/1318-user-defined-geo-properties branch January 20, 2025 12:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core Relates to core API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GeoProperty which is not location cannot be created.
3 participants