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

Relationship-Multi-Attribute error on batch upsert #1246

Closed
fbattello opened this issue Oct 12, 2022 · 3 comments
Closed

Relationship-Multi-Attribute error on batch upsert #1246

fbattello opened this issue Oct 12, 2022 · 3 comments
Assignees
Labels

Comments

@fbattello
Copy link

Hi,

Orion-LD correctly inserts the below entity using the entities endpoint, but returns an error when using the batch upsert endpoint.

{
  "@context": [
    "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
  ],
  "id": "urn:ngsi-ld:A:A1",
  "type": "A",
  "hasB": {
    "type": "Relationship",
    "object": "urn:ngsi-ld:B:B1"
  },
  "hasMultiD": [
    {
      "type": "Relationship",
      "object": "urn:ngsi-ld:D:D1",
      "datasetId": "urn:ngsi-ld:Relationship:1"
    },
    {
      "type": "Relationship",
      "object": "urn:ngsi-ld:D:D2",
      "datasetId": "urn:ngsi-ld:Relationship:2"
    }
  ]
}

Error Message :

{"success":[],"errors":[{"entityId":"urn:ngsi-ld:A:A1","error":{"type":"https://uri.etsi.org/ngsi-ld/errors/BadRequestData","title":"attribute must be a JSON object","detail":"https://uri.etsi.org/ngsi-ld/default-context/hasMultiD","status":400}}]}

Orion-ld version :

1.2.0-PRE-1117

@kzangeli
Copy link
Collaborator

Yeah, sorry about that.
Orion-LD doesn't support the datasetId (multi-attribute).

As a PoC, a tiny subset of the API was made "datasetId-aware" (2-3 operations) but, that's about it.
It's on the roadmap, of course, it's just not at the top (new NGSI-LD Registrations and Forwarding is - see issue #280)
And, forwarding is a major feature which is gonna take quite a while to finish (6 months?).
So, if you really need multi-attribute ...
Really, what you seem to need is for a Relationship to support an array, and Orion-LD supports that - against the NGSI-LD API (long story - I'll tell you all about it if you're interested).

If you really need multi-attribute (which might take a year or so before it is fully implemented in Orion-LD), I'd have to invite you to have a look at Scorpio instead :(

(AFAIK, Stellio also doesn't fully support the datasetId)

@kzangeli kzangeli self-assigned this Oct 13, 2022
@fbattello
Copy link
Author

Ok, and thank you for the roadmap.
I better understand why it worked with a unitary operation but not a batch one.
I had to triple-check I built a valid request in batch mode :)
I need the multi-attribute as I develop the ngsildclient Python library that implements (a subset of) the NGSI-LD API on the client side.
For the moment I test mostly against Orion-LD, and it's fine as I have no strong need to go further with multi-attrs.

@kzangeli
Copy link
Collaborator

ok, understood.
I'd ask you to close this issue then, if all is ok.

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

No branches or pull requests

2 participants