Update patch set 2

Authored by cscott on Oct 12 2017, 10:10 PM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.


Update patch set 2

Patch Set 2:

Hm, what can we do here? Who does have knowledge about what's going

> on in this patch? I, personally, don't even understand what "tweak"
> and "more idiomatic" in the commit message refers to. It also talks
> about "consumers". Which consumers would that be? What drives this
> change? Is this still the same project that motivated the original
> JSON-LD support? (Which was introduced just recently, if I remember
> correctly.)
> I would love to add this to the proper column on a proper board,
> but T44063 is an epic that doesn't belong to a review column, and
> T164655 appears to be unrelated. Or the relation is very much
> unclear. What code is going to consume this specific export format?
> Maybe explaining that would help?
> Does anybody of the people working on the specific project this is
> needed for have merge rights here in the Wikibase code base? If
> your project is the only consumer of this format, I don't mind if
> somebody else merges this (it should just not be the uploader doing
> a self-merge).

By "idiomatic" I just mean that the output looks more like:


"name": "Eric Miller",
"title": "Dr",
"mailbox": "mailto:em@w3c"


instead of:


"contact:fullName": "Eric Miller",
"contact:title": "Dr",
"contact:mailbox": { "@id": "mailto:em@w3c.org" }


(See https://gerrit.wikimedia.org/r/#/c/379669/2/tests/data/EricMiller.jsonld for example)

The former is how a human engineer would write that information in JSON, and it lends itself to readable JavaScript such as:

console.log("Hello, " + record.title + " " + record.fullName);

Instead of:

console.log("Hello, " + record['contact:title'] + " " + record['contact:fullName']);

Another way of thinking of this is that the latter form exposes the namespace of the field, whereas "idiomatic" use would use an import (Java or python)/use (php)/@context (JSON-LD)/whatever so that the namespace didn't have to keep being repeated.

I think reviewing the changes to the test data is sufficient to make the case that the output generated by this patch is an improvement, although technically the JSON emitted is semantically unchanged.

Patch-set: 2
Label: Verified=0


Gerrit Code Review <gerrit@wikimedia.org>Oct 12 2017, 10:10 PM
R1907:3c15e01de629: Update patch set 2

Event Timeline

Gerrit Code Review <gerrit@wikimedia.org> committed R1907:569cc1e00495: Update patch set 2 (authored by cscott).Oct 12 2017, 10:10 PM

Empty Commit

This commit is empty and does not affect any paths.