Page MenuHomePhabricator

Add functionality to store and query number ranges
Closed, DeclinedPublic

Description

Author: dasch

Description:
When having a range of numbers for one property for example the postalcodes of a german city it would be much work to put them all in, instead the input [[Postalcode::44701–44894]] could generate a list of all numbers in this range and put them into this property

Another solution could be a special typ, range. When searching in this range for a number every page is displayed that has this number in it's range. Maybe the second solution is more work but I think it would give a better result.


Version: unspecified
Severity: enhancement

Details

Reference
bz15302

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:22 PM
bzimport set Reference to bz15302.

Making values of the shape "44701–44894" to create additional property-value assignments is not practical with the current architecture. I think it would be better to have a solution on a higher level, similar to the parser function for annotating lists of pages provided by Semantic Forms. So I propose to keep this out of SMW core, too.

There is a related issue with this first approach: it is not clear what "44701–44894" really means. SMW has a Type:Number that supports also decimal numbers, not just integers. So simply annotating with a list of values would somehow not cover the true interval semantics that was intended. This is OK for an added convenience function, but not really something to do in SMW core.

The alternative, supporting ranges as a value in their own right, is not compatible with SMW's property model, which assumes every property to have one value. A range could of course be considered as one value, and you could have a datatype that supports ranges as objects, but then you could not compare ranges to numbers. Instead, they would be a new kind of data, and you could only compare ranges to ranges (which is not so useful). Making ranges work as you suggest would require substantial internal changes in the way data is processed.

For those reasons, I close this as wontfix. Making a tiny extension that helps with such range inputs should be easy to do, if you really need it.

dasch wrote:

Well, when trying to add historical events I have a similar problem. When entering more then one date, I have the number of entries in ask-outputs is increasing nearly exponantial. See also https://bugzilla.wikimedia.org/show_bug.cgi?id=22547

Maybe there could be a additional type range for non-decimal numbers and ony type for date-ranges and one for temprature ranges

I could imagine many possible application areas

dasch wrote:

I reopen this, because I think that it's worth it to discuss possible solutions for this problem

I leave this request open for now. If any possible solutions are proposed here, I will consider them for inclusion into SMW.

Aklapper subscribed.

The Semantic MediaWiki developers requested in https://phabricator.wikimedia.org/T64114 to move their task tracking to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues and to close remaining tasks in Wikimedia Phabricator. If you still face the problem reported in this task in a supported version of SMW, please feel free to transfer your report to https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues . We are sorry for the inconvenience.