This ticket is about making Serializers and Unserializers aware of the possibility of normalized values in the JSON rendering of Snaks.
PropertyValueSnaks currently look like this:
"mainsnak":{"snaktype":"value","property":"P646","datatype":"string",
"datavalue":{"value":"/m/0g5n7","type":"string"}
}
The normalized snak value would be added using an additional key on the same level as "datavalue", called "datavalue-normalized" (or some such):
"mainsnak":{"snaktype":"value","property":"P646","datatype":"string",
"datavalue":{"value":"/m/0g5n7","type":"string"},
"datavalue-normalized":{"value":"https://www.freebase.com/m/0g5n7","type":"string"},
}
-------
Rough spec after discussion with Thiemo and Jan, 2015-06-17:
* ExtendedPropertyValueSnak extends PropertyValueSnak ("Extended" is silly, find a better name)
* ExtendedPropertyValueSnak->values: map of "roles" (original, normalized, uri, url, iso, etc) to DataValue objects.
* Serializer/Unserializer get support for ExtendedPropertyValueSnak
* Support for derived values (ExtendedPropertyValueSnak, FallbackTerm) can be disabled in serializer/unserializer (should be disabled for API input, and db storage).
* ValueExtender service, with specialized extenders for specific DataType. Used to manipulate Statements before serialization.