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. T102791
- Serializer/Unserializer get support for ExtendedPropertyValueSnak. T102833
- Support for derived values (ExtendedPropertyValueSnak, FallbackTerm) can be disabled in serializer/unserializer (should be disabled for API input, and db storage). T102789, T102788
- ValueExtender service, with specialized extenders for specific DataType. Used to manipulate Statements before serialization. T102835