The ../entity/Q12345.json won't work, because of cross-domain browser limitations? Unless wikidata allows these server-side (forgot what the mechanism was called).

Magnus


On Wed, Apr 2, 2014 at 9:36 AM, Daniel Kinzler <daniel.kinzler@wikimedia.de> wrote:
Hey Denny! Awesome tool!

It's so awesome, we are already wondering about how to handle the load this may
generate.

As far as I can see, qlabel uses the wbgetentities API module. This has the
advantage of allowing the labels for all relevant entities to be fetched with a
single query, but it has the disadvantage of not being cacheable.

If qlabel used the .../entity/Q12345.json URLs to get entity data, that would be
covered by the web caches (squid/varnish). But it would mean one request per
entity, and would also return the full entity data, not just the  labels in one
language. So, a lot more traffic.

If this becomes big, we should probably offer a dedicated web interface for
fetching labels of many entities in a given language, using nice, cacheable
URLs. This would mean a new cache entry per language per combination of entities
- potentially, a large number. However, the combination of entities requested is
determiend by the page being localized - that is, all visitors of a given page
in a given language would hit the same cache entry. That seems workable.

Anyway, we are not there quite yet, just something to ponder :)

-- daniel


Am 01.04.2014 20:14, schrieb Denny Vrandečić:
> I just published qLabel, an Open Source jQuery plugin that allows to annotate
> HTML elements with Wikidata Q-IDs (or Freebase IDs, or, technically, with any
> other Semantic Web / Linked Data URI), and then grabs the labels and displays
> them in the selected language of the user.
>
> Put differently, it allows for the easy creation of multilingual structured
> websites. And it is one more way in which Wikidata data can be used, by anyone.
>
> Contributors and users are more than welcome!
>
> <http://google-opensource.blogspot.com/2014/04/qlabel-multilingual-content-without.html>
>
>
>
> _______________________________________________
> Wikidata-l mailing list
> Wikidata-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikidata-l
>


--
Daniel Kinzler
Senior Software Developer

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

_______________________________________________
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l



--
undefined