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:
- does the w.wiki URL shortener have a size limit for the URL? --> Yes, it does: 1500 Characters.