Re: [Wikidata-l] [wikidata-intern] Request for comments: syntax for including data on client wikis (aka how to make infoboxes)

2012-05-23 Thread Daniel Kinzler
On 23.05.2012 13:14, Nikola Smolenski wrote:
 I see multiple possibilities:
 
 {{#data:color|item=Blah}} - this uses item linked to Blah in the local 
 language.
 {{#data:color|item=en:Blah}} - this uses item linked to Blah in English 
 language.
 {{#data:color|id=q123}} - this uses item with ID q123.
 {{#data:Blah-color}} - we can do this since - can't appear in a page name -
 this is my favorite of course :)

I agree that it would be nice to allow adressing by wiki-page as well as item id
would be nice. The exact syntax should be the same that we will also use for
interwiki links to the repository. It's still to be decided.

 Every template or article could read any item without the need to pass it.

This is really the major point... do we

1) want *pass* a data item to a template for formatting?

2) or do we want the template to control the loading of the data item?

I prefer 1), but many people appear to favor 2), and I am beginning to get the
impression that 2) is easier and cleaner to implement.

We could even do

3) no explicit reference/use of the item at all. Just use parser function to
access properties, and specify the item if need be (otherwise, the page's own
item is used).

 By the way, in some cases a single assertion might have multiple sources, 
 also a
 single source might support multiple assertions, this needs to be taken into
 account.

Yes, indeed.

 The parser function should be able to override itself by template 
 parameters - I
 believe it is possible to do this.

 That makes the hair in my neck stand up :)
 
 From the user point of view or the implementation point of view? :)

Both. And as Gabriel pointed out, something like this would be really bad for
things like the visual editor, snippet caching, etc.

 The problem is that we are going to pre-load all the data of an item before 
 the
 article renders, right? So now we need to pre-load all the data in all the
 languages.

Well, at the moment, we would be loading the entire item, which includes all the
languages. If we don't do this, item-level caching is going to be a nightmare.

 If there will be no pre-loading, disregard this.

Don't know what you mean by pre... the item will be loaded into memory once,
whenever the page is rendered. It would typically be loaded from a local cache
(e.g. in the database), an http request to the repo while rendering would be
annoyingly slow.

 Except that it's not wrapped in any HTML. Perhaps there should be an option 
 to
 {{#data-value}} to turn that off completely, using form=plain or some such.
 
 Now shorten #data-value to #data, use form=plain as the default and that's it 
 :)

Yes, we can drop the simple parameter-like syntax an use parser functions for
everything.

The remaining question is... how do i specify the item i want to get the
property from (if it's not the default)? Will be be assigning local names to
items, using #load-data or some such? Or will we just use the item id directly -
which would probably be a parameter, so we'd end up with something like this:

  {{#property:population|item={{{item-id|*}

...with * representing the default (the page's own) item. Not very pretty,
especially not if you have to do it for 20 or 50 properties. So perhaps this is
nicer:

  {{#load-data|thingy|item={{{item-id|*}
  ...
  {{#property:population|item=thingy}}

 I would try not to introduce new syntax if it is not necessary. How about 
 this:
 
 [[wikidata:Berlin]] - links to en.wikidata.org/wiki/Berlin
 [[wikidataid:q1234]] - links to en.wikidata.org/id/q1234
 {{canonicalurl:wikidata:Berlin|action=edit}} - links to edit page
 
 All of this syntax already exists, is widely used and could be introduced
 without additional coding :)

You'd have to do  [[wikidata:id/{{#property:id}}|the data item]].
That would be possible, i guess, and it would go to the correct table (iwlinks).

But this doesn't work for edit links. Especially not if the edit link is
supposed to invoke the on-site ajax editing interface How to you generate a
link/button for doing that?

-- daniel

-- 
Daniel Kinzler, Softwarearchitekt

Wikimedia Deutschland e.V. | Eisenacher Straße 2 | 10777 Berlin
http://wikimedia.de  | Tel. (030) 219 158 260

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-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l


Re: [Wikidata-l] [wikidata-intern] Re: Request for comments: syntax for including data on client wikis (aka how to make infoboxes)

2012-05-23 Thread Gregor Hagedorn
On 23 May 2012 13:19, Daniel Kinzler daniel.kinz...@wikimedia.de wrote:
 On 23.05.2012 13:14, Nikola Smolenski wrote:
 If we assume that in practice #data-template is usually going to be wrapped 
 into
 a template, what's the point of having it at all? Do you see any technical
 reasons for it?

 How else do you pass a complex object to a template and make its properties 
 show
 up as template parameters?

I think I might have adressed that in my comment on the wiki. See
there, but essentially I believe it is technically equally valid, and
from a usability and community adoption standpoint far preferable, to
simply support a syntax to adress properties of the complex object,
and have the resolver of this syntax automatically pull the entire
complex wikidata object (of which the property is a part) into a
cache, so that subsequent calls to properties are returned from the
cached object.

I look forward to have this analyzed by Daniel. Obviously there are
some extra things that need to be added, but also other things simply
go away painlessly... Can you write a advantage/disadvantage
comparison on the wiki, Daniel, to be commented upon?

Gregor

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


[Wikidata-l] [[meta:Wikitopics]] posted

2012-05-23 Thread jmcclure
 

Dear all, 

Comments are welcomed about a page I just posted which
posits the use of the topic map metamodel (TMM) in the wikidata project.
I'll do my best to respond, but frankly my focus these days is on more
mundane topics like simple survival. 

Cheers - john
Belltower Wikis

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


Re: [Wikidata-l] Request for comments: syntax for including data on client wikis (aka how to make infoboxes)

2012-05-23 Thread Helder Wiki
On Wed, May 23, 2012 at 9:33 AM, Gabriel Wicke wi...@wikidev.net wrote:
 I don't really like this global variable business at all. Much of the
 ugliness above disappears when the id is mandatory:

 {{#data:{{id}}|color}}

 or (if you prefer):

 {{#data:color|{{id

 If it is missing, simply display an error and let the user fix it.

 Cache invalidation can be precise by usage (not necessarily the entire
 page) and correctly handles multiple data items per article. The system
 is also directly compatible with Lua and Parsoid.

...and inside of a Lua module, the ugly things could just be stored in
a local variable, coudn't they?

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