Page MenuHomePhabricator

(MS 5) Implement Serialization for Query-Builder URL sharing
Closed, ResolvedPublic

Description

We want serialize the important parts of the State as json and later put it into the URL of a link.

Serialization:

The things that should be in that serialized state:

  • for each query condition:
    • property ID (if one is set)
    • property datatype (if one is set)
    • value-relation-dropdown-value
    • value QID if datatype is an wikibase-item value and the string value otherwise
    • if datatype is wikibase-item whether we want to search for subclasses
  • the limit and whether it is active
  • whether to omit the labels

Notably not included:

  • any labels
  • any errors

As we add more functionality, we will have to add more data to that serialized state, e.g.

  • With/Without value for T265238: (MS 4) negate query
  • the state of the "with references" dropdown when that is implemented
  • the information of whether query-conditions are linked with "AND" or "OR"

Deserialization:
When deserializing the PIDs (and QIDs for datatype wikibase-item), we can use the IDs themselves as labels in this first version.

Notes:

  • during this initial development, it is ok that links which were generated with an old Version of the query builder might not work with a new version of the query builder that includes a new feature.
  • We should develop this in a way that allows for easily adjusting the way the links are created in the future. For example, in the future we may want to shorten the keys to accommodate longer queries that are still short-able by the w.wiki query service,

Answered Questions:

Event Timeline

amy_rc renamed this task from Implement Query-Builder URL sharing to (MS 5) Implement Query-Builder URL sharing.Jan 18 2021, 3:26 PM
amy_rc triaged this task as High priority.

does the w.wiki URL shortener have a size limit for the URL?

Yes, it's 1500 characters (see T220703)

does the w.wiki URL shortener have a size limit for the URL?

Yes, it's 1500 characters (see T220703)

That isn't much :/

It might make sense to track the length of the links that are created here on Grafana, so we can know whether that limit is an issue for us. (But not in this ticket.)

guergana.tzatchkova renamed this task from (MS 5) Implement Query-Builder URL sharing to (MS 5) Implement Serialization for Query-Builder URL sharing.Jan 26 2021, 9:50 AM