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

Request: Implement /temporal/entityOperations/query endpoint #131

Open
Blobonat opened this issue Oct 10, 2022 · 4 comments
Open

Request: Implement /temporal/entityOperations/query endpoint #131

Blobonat opened this issue Oct 10, 2022 · 4 comments

Comments

@Blobonat
Copy link

Blobonat commented Oct 10, 2022

In order to make temporal batch requests Mintaka should support the temporal/entityOperations/query endpoint following the NGSI-LD spec.

@wistefan
Copy link
Collaborator

wistefan commented Oct 10, 2022

Hi,
I'm not sure if I missunderstand something, but the tempora/enitityOperations/query is already supported: https://github.com/FIWARE/mintaka/blob/main/src/test/java/org/fiware/mintaka/QueryingTest.java#L966
Its not neccessarilly a technique for batch, but an alternative to the "normal" querying, if the query-parameters become to long.

@Blobonat
Copy link
Author

Hi,

when playing around with Mintaka I forgot to remove the ngsi-ld/v1 prefix and therefore thought that the interface hasn't been implemented yet.

Thank you :)

@Blobonat
Copy link
Author

As a follow up question I have noticed a small deviation from the specification in the used query type:

In the NGSI-LD API spec (I've looked up 1.3.1 to 1.6.1) entities is a list, but in the current version of Mintaka only accepts a single value.

Expected structure:

curl --location --request POST 'http://localhost:8080/temporal/entityOperations/query' \
--header 'NGSILD-Tenant: openiot' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "Query",
    "entities": [ {"id": "urn:ngsi-ld:Vehicle:A800"}, {"id": "urn:ngsi-ld:Vehicle:A801"}],
    "temporalQ": {
        "timerel": "between",
        "timeAt": "2021-10-10T15:24:10.000Z",
        "endTimeAt": "2022-12-10T19:23:12.000Z"
    }
}'

Current structure:

curl --location --request POST 'http://localhost:8080/temporal/entityOperations/query' \
--header 'NGSILD-Tenant: openiot' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "Query",
    "entities": {"id": "urn:ngsi-ld:Vehicle:A800,urn:ngsi-ld:Vehicle:A801"},
    "temporalQ": {
        "timerel": "between",
        "timeAt": "2021-10-10T15:24:10.000Z",
        "endTimeAt": "2022-12-10T19:23:12.000Z"
    }
}'

@Blobonat Blobonat reopened this Oct 10, 2022
@wistefan
Copy link
Collaborator

Interesting find, you are right:) I think (from how I understand the spec) the request should be with a flat list of ids, but its not implemented nonetheless :

curl --location --request POST 'http://localhost:8080/temporal/entityOperations/query' \
--header 'NGSILD-Tenant: openiot' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "Query",
    "entities": [ "urn:ngsi-ld:Vehicle:A800", "urn:ngsi-ld:Vehicle:A801"],
    "temporalQ": {
        "timerel": "between",
        "timeAt": "2021-10-10T15:24:10.000Z",
        "endTimeAt": "2022-12-10T19:23:12.000Z"
    }
}'

I will try to find time to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants