How would you use that additional type information?
A PropertyValueSnaks (PVS) referencing a certain property can still have
ANY value of ANY value types, e.g. a value not necessarily matching the
property's data type's data value type. This is something all code should
consider and handle well.

If you want to put the PVS's property's data type ID into the PVS instance,
then what would that data type ID be? What would be the precise definition
of that additional field?

* Would you take the ID of the PVS's property's current data type?
--> you still had to load the properties then when building the Snaks. Just
moving that inconvenience somewhere else.

* Or would you save that ID as part of the data model within the Snak
already? In that case the ID would refer to the PVS's property's data type
at the time of the Snak's construction.
- The data type of the property could have changed (we don't support
changing that as far as I know but I'd always consider it). So you still
had to fetch the property to compare its current data type with the one of
the snak.
- The data type's structure could have changed (e.g. using a different data
value type). So even though your PVS is still referring to the same data
type as the PVS's property, the PVS's value might not be valid against that
data type anymore. Something you still had to consider and check for.
--> all your type ID field would really stand for, would be "The data type
the PVS's value has been valid against at the time of its construction". At
what point is this information really useful? In how many cases can this
really spare you loading the PVS's property to look up the actual data type?
Also, we might add other attributes than "datatype" to properties at some
point, some might influence validation  (e.g. the unit of a number). Would
you then go ahead and add these information also to the PVS's constructor?

2013/6/13 Daniel Kinzler <[email protected]>

> Am 13.06.2013 03:22, schrieb Daniel Werner:
> >  -1
> > Had to deal with this in the frontend as well and don't think this is
> > inconvenient.  It seems like the cleanest approach. Polluting the Snaks
> with
> > information like this for performance or convenience reasons will
> probably cause
> > more trouble in the end than keeping it as simple and "pure" as possible.
>
> You think that giving a data structure information about its type is
> polluting
> it? Why so? This seems pretty basic and streight forward to me.
>
> -- daniel
>
>
> _______________________________________________
> Wikidata-tech mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
>



-- 
Daniel Werner
Software Engineer

Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin
Tel. (030) 219 158 26-0

http://wikimedia.de

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/681/51985.
_______________________________________________
Wikidata-tech mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech

Reply via email to