Page MenuHomePhabricator

๐Ÿ” Provide the data for statements of an item that are using the given property
Closed, ResolvedPublic5 Estimated Story Points

Description

As a tool developer I want to get all statements of an item that are using a given property so that I can show them in my tool.

Initial implementation suggestion:
Add path parameter that allows "filtering" statements to only include ones with a given property, i.e. GET /entities/items/{item_id}/statements?property={property_id}

Notes:

  • response structure will be a single-key map {property_id} -> statements

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptMay 23 2022, 11:30 AM

Outstanding questions (for @WMDE-leszek) :

  • Should we return an empty map ({}) if no statements exists with the provided property id?
Ollie.Shotton_WMDE renamed this task from Provide the data fo statements of an item that are using the given property to Provide the data for statements of an item that are using the given property.Feb 14 2023, 11:19 AM

Outstanding questions (for @WMDE-leszek) :

  • Should we return an empty map ({}) if no statements exists with the provided property id?

seems like the best solution, please do.
Alternatives considered and dismissed: responding with HTTP 404 or 204 codes.

Task breakdown:


Outstanding questions for PM (@WMDE-leszek):

  • What error code and message should be returned for an invalid property id? And should there be a context object?
Ollie.Shotton_WMDE renamed this task from Provide the data for statements of an item that are using the given property to ๐Ÿ” Provide the data for statements of an item that are using the given property.Feb 14 2023, 2:54 PM

Outstanding questions for PM (@WMDE-leszek):

  • What error code and message should be returned for an invalid property id? And should there be a context object?

When the property ID is invalid: (e.g. Pabc, Q123) { "code": "invalid-property-id", "message": "Not a valid property ID: {input}" }. No context field please.
When the property ID is valid "syntactically" but does not exist: treat it like the situation of item not having statements using the given property, i.e. 200 "P123": {}"