Re: [Wikidata-tech] Adding reference re-adds claim

2016-04-06 Thread Magnus Manske
Removed from the instructions. They were removed before adding statements
anyway.

On Wed, Apr 6, 2016 at 5:49 PM Thiemo Mättig 
wrote:

> Hi,
>
> the "definition" at Magnus'
> http://tools.wmflabs.org/wikidata-todo/quick_statements.php is outdated.
> Magnus, can you please remove the leading zeros from the year?
>
> Padding years to 11 digits is not done any more. For a while there was no
> padding at all in the backend, while some documentation talked about 16
> digits and the frontend still padded to 11 digits. All at the same time.
> :-( We fixed this about a year ago and decided to always pad years to 4
> digits because this minimizes storage space while being the most convenient
> strategy for users.
>
> Best
> Thiemo
>
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Adding reference re-adds claim

2016-04-06 Thread Thiemo Mättig
Hi,

the "definition" at Magnus'
http://tools.wmflabs.org/wikidata-todo/quick_statements.php is outdated.
Magnus, can you please remove the leading zeros from the year?

Padding years to 11 digits is not done any more. For a while there was no
padding at all in the backend, while some documentation talked about 16
digits and the frontend still padded to 11 digits. All at the same time.
:-( We fixed this about a year ago and decided to always pad years to 4
digits because this minimizes storage space while being the most convenient
strategy for users.

Best
Thiemo
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Adding reference re-adds claim

2016-04-06 Thread Thomas Steiner
Is this answer from TPT related?
https://github.com/google/primarysources/issues/90#issuecomment-206256966.
Sorry, I am at a multi-day event this week and am a bit behind on
emails. If it is, I am happy to quickly merge a pull request if anyone
creates it :-)

-- 
Dr. Thomas Steiner, Employee (http://blog.tomayac.com,
https://twitter.com/tomayac)

Google Germany GmbH, ABC-Str. 19, 20354 Hamburg, Germany
Managing Directors: Matthew Scott Sucherman, Paul Terence Manicle
Registration office and registration number: Hamburg, HRB 86891

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.29 (GNU/Linux)

iFy0uwAntT0bE3xtRa5AfeCheCkthAtTh3reSabiGbl0ck0fjumBl3DCharaCTersAttH3b0ttom
hTtPs://xKcd.cOm/1181/
-END PGP SIGNATURE-

___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Adding reference re-adds claim

2016-04-06 Thread Sebastian Schaffert
Hi Lydia,

I think the problem is that instead of a semantic comparison, Wikibase does
a pure string comparison to check if two timestamps are equal. I changed
the primary sources tool on the weekend because there was a bug in the
serialization according to the TSV format specification (it failed a
roundtrip serialize-parse test), which says the year in a timestamp is 11
digits, 0-padded if necessary (i.e. +0001947 instead of +1947). This
might have broken the comparison.

The weird thing is that later (probably when storing the value in the
database), Wikibase does the right thing (i.e. parses the year even
including leading 0's). So I guess the comparison is happening before that.

I can fix that by rolling back my change that introduced the 0-padding, but
the consequence is that it will no longer follow the definition at
http://tools.wmflabs.org/wikidata-todo/quick_statements.php . Or we change
the Javascript frontend part to eliminate all padding 0 before sending the
timestamp to the API. But since 0-padding is semantically valid for
numbers, I'd prefer to have a look in the Wikibase backend. There might be
other situations affected by string comparison issues.

Cheers,

Sebastian

On Wed, Apr 6, 2016 at 1:24 PM Lydia Pintscher 
wrote:

> On Tue, Apr 5, 2016 at 10:29 PM Denny Vrandečić 
> wrote:
>
>> The primary sources tool can add references to existing claims. For some
>> reason, it started re-adding the claim yesterday instead.
>>
>> Did anything change on the Wikidata-side in the last few days that could
>> be causing this change in behavior? Or should we look harder on the Primary
>> sources side?
>>
>> Bug is being tracked here:
>>
>> https://github.com/google/primarysources/issues/90
>>
>
>
> I am not aware of a recent change that should influence this. If you find
> it is something in Wikibase please let me know.
>
>
> Cheers
> Lydia
> --
> Lydia Pintscher - http://about.me/lydia.pintscher
> Product Manager for Wikidata
>
> Wikimedia Deutschland e.V.
> Tempelhofer Ufer 23-24
> 10963 Berlin
> www.wikimedia.de
>
> Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.
>
> Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg
> unter der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das Finanzamt
> für Körperschaften I Berlin, Steuernummer 27/029/42207.
>
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Adding reference re-adds claim

2016-04-06 Thread Lydia Pintscher
On Wed, Apr 6, 2016 at 1:32 PM Sebastian Schaffert 
wrote:

> Hi Lydia,
>
> I think the problem is that instead of a semantic comparison, Wikibase
> does a pure string comparison to check if two timestamps are equal. I
> changed the primary sources tool on the weekend because there was a bug in
> the serialization according to the TSV format specification (it failed a
> roundtrip serialize-parse test), which says the year in a timestamp is 11
> digits, 0-padded if necessary (i.e. +0001947 instead of +1947). This
> might have broken the comparison.
>
> The weird thing is that later (probably when storing the value in the
> database), Wikibase does the right thing (i.e. parses the year even
> including leading 0's). So I guess the comparison is happening before that.
>
> I can fix that by rolling back my change that introduced the 0-padding,
> but the consequence is that it will no longer follow the definition at
> http://tools.wmflabs.org/wikidata-todo/quick_statements.php . Or we
> change the Javascript frontend part to eliminate all padding 0 before
> sending the timestamp to the API. But since 0-padding is semantically valid
> for numbers, I'd prefer to have a look in the Wikibase backend. There might
> be other situations affected by string comparison issues.
>

Thank you! Will look closer into it with Thiemo next week when I am back in
the office and he hasn't seen it before.


Cheers
Lydia
-- 
Lydia Pintscher - http://about.me/lydia.pintscher
Product Manager for Wikidata

Wikimedia Deutschland e.V.
Tempelhofer Ufer 23-24
10963 Berlin
www.wikimedia.de

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.

Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/029/42207.
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech


Re: [Wikidata-tech] Adding reference re-adds claim

2016-04-06 Thread Lydia Pintscher
On Tue, Apr 5, 2016 at 10:29 PM Denny Vrandečić  wrote:

> The primary sources tool can add references to existing claims. For some
> reason, it started re-adding the claim yesterday instead.
>
> Did anything change on the Wikidata-side in the last few days that could
> be causing this change in behavior? Or should we look harder on the Primary
> sources side?
>
> Bug is being tracked here:
>
> https://github.com/google/primarysources/issues/90
>


I am not aware of a recent change that should influence this. If you find
it is something in Wikibase please let me know.


Cheers
Lydia
-- 
Lydia Pintscher - http://about.me/lydia.pintscher
Product Manager for Wikidata

Wikimedia Deutschland e.V.
Tempelhofer Ufer 23-24
10963 Berlin
www.wikimedia.de

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e. V.

Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 Nz. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/029/42207.
___
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech