Right now we represent quantity as string, copying it as-is from the JSON dump. This is inefficient as it can not be properly indexed. We should consider representing it as Long or Double or some other way that would allow to index it properly.
This probably needs more guidance from Wikidata team as to what "quantity" values may actually contain.