Re: [Wikidata-l] Finding image URL from Commons image name

2014-07-03 Thread Markus Krötzsch

Brilliant, thanks for the useful and informative answers :-)

Markus

On 03/07/14 07:21, Legoktm wrote:

And there's an API module for this too:
https://commons.wikimedia.org/w/api.php?action=querytitles=File:Albert%20Einstein%20Head.jpgprop=imageinfoiiprop=urlformat=jsonfm
:)

-- Legoktm

On 7/2/14, 1:59 PM, Liangent wrote:

Also there are Special:FilePath and thumb.php. I'm not sure how this
affects caching though.

http://commons.wikimedia.org/wiki/Special:FilePath/Example.svg

http://commons.wikimedia.org/w/thumb.php?f=Example.svgw=420

-Liangent

On Jul 3, 2014 4:50 AM, Emilio J. Rodríguez-Posada emi...@gmail.com
mailto:emi...@gmail.com wrote:

 Hello Markus;

 The URL of a Commons image is build like this:

 https://upload.wikimedia.org/wikipedia/commons/x/xy/File_name.ext

 Where X and XY are the first char and firstsecond chars
 respectively of the md5sum of the filename (replacing the spaces
 with _).

 For a 200px thumb:

 
https://upload.wikimedia.org/wikipedia/commons/thumb/x/xy/File_name.ext/200px-File_name.ext

 The SVG files are a special case, therefore .png is appended to
 .ext, being .ext.png. For SVG doesn't mind to use big thumb sizes,
 but when file is JPG, don't try to generate a thumb bigger than the
 original file or you will get a beautiful error.

 Regards


 2014-07-02 22:33 GMT+02:00 Markus Krötzsch
 mar...@semantic-mediawiki.org mailto:mar...@semantic-mediawiki.org:

 Dear Wikidatarians,

 From Commons media properties, I get the string name of a file
 on Commons. I can easily use it to build a link to the Commons
 page fo rthat image.

 * But how do I get the raw image URL?
 * And can I also get the raw URL of a small-scale (thumbnail) image?

 I would like to beautify my Wikidata applications to show some
 images. I know this is more of a general MediaWiki question, but
 it is much more relevant in Wikidata, so I am posting it here
 first. I guess somebody has already solved this since we have
 images in various Wikidata-based applications and gadgets.

 Thanks

 Markus

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



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



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



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




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


Re: [Wikidata-l] WikiData Categories

2014-07-03 Thread Gerard Meijssen
Hoi,
I do not get it.. Wikidata has items not categories, so you get access to
the item for a category in the same way as you get access to any other item.
Thanks,
 GerardM


On 3 July 2014 11:03, Rohan Badlani rohan.badl...@gmail.com wrote:

 Hi!

 I am new to WikiData. I wanted to know how can we get the json belonging
 to a category. Say I want to access the json belonging to Category 537. If
 I can get the Json, can you pls specify how I can access this json?

 Main Aim: I want to know what Category 537 means and the sub categories
 and topics within this category.

 Regards!

 --

 *Rohan Badlani *
 2nd year undergraduate student,
 B.E.(Hons), Computer Science,
 Birla Institute of Technology and Science, Pilani.

 Email: rohan.badl...@gmail.com
 Phone: +91-9660582805.

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


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


Re: [Wikidata-l] WikiData Categories

2014-07-03 Thread Magnus Manske
Hi Rohan,

if by category you mean item, e.g.
https://www.wikidata.org/wiki/Q537

the easiest way to get the corresponding JSON is:
https://wikidata.org/entity/Q537.json

If you want a JSON object for all items with property P537, try:
http://wdq.wmflabs.org/api?q=claim[537]

See here for many more options to interrogate Wikidata:
http://wdq.wmflabs.org/api_documentation.html

Cheers,
Magnus


On Thu, Jul 3, 2014 at 10:03 AM, Rohan Badlani rohan.badl...@gmail.com
wrote:

 Hi!

 I am new to WikiData. I wanted to know how can we get the json belonging
 to a category. Say I want to access the json belonging to Category 537. If
 I can get the Json, can you pls specify how I can access this json?

 Main Aim: I want to know what Category 537 means and the sub categories
 and topics within this category.

 Regards!

 --

 *Rohan Badlani *
 2nd year undergraduate student,
 B.E.(Hons), Computer Science,
 Birla Institute of Technology and Science, Pilani.

 Email: rohan.badl...@gmail.com
 Phone: +91-9660582805.

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




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


Re: [Wikidata-l] WikiData Categories

2014-07-03 Thread Rohan Badlani
Thanks for an early response.

@Magnus: I was able to get the json of the items. Still thanks.
However, my exact problem is the following.

I had downloaded the wikidata dump from
http://dumps.wikimedia.org/wikidatawiki/latest/
There is a file wikidatawiki-20140420-pages-articles-multistream-index
which consists of triplets like:

537:114:Q17

which I interpreted as following:
537 - category of the topic (which I am unable to find. I want the details
of this item)
114 - page_id of the item Q17.
Q17 - which is the item. (JSON:
https://www.wikidata.org/wiki/Special:EntityData/Q17.json)

I want to know whether my interpretation is correct. If it is correct, how
can I get the details abt the category 537.
If my interpretation is incorrect, how can I get the wikidata category to
which an item belongs to?

Thanks and Regards!


On Thu, Jul 3, 2014 at 7:17 PM, Magnus Manske magnusman...@googlemail.com
wrote:

 Hi Rohan,

 if by category you mean item, e.g.
 https://www.wikidata.org/wiki/Q537

 the easiest way to get the corresponding JSON is:
 https://wikidata.org/entity/Q537.json

 If you want a JSON object for all items with property P537, try:
 http://wdq.wmflabs.org/api?q=claim[537]

 See here for many more options to interrogate Wikidata:
 http://wdq.wmflabs.org/api_documentation.html

 Cheers,
 Magnus


 On Thu, Jul 3, 2014 at 10:03 AM, Rohan Badlani rohan.badl...@gmail.com
 wrote:

 Hi!

 I am new to WikiData. I wanted to know how can we get the json belonging
 to a category. Say I want to access the json belonging to Category 537. If
 I can get the Json, can you pls specify how I can access this json?

 Main Aim: I want to know what Category 537 means and the sub categories
 and topics within this category.

 Regards!

 --

 *Rohan Badlani *
 2nd year undergraduate student,
 B.E.(Hons), Computer Science,
 Birla Institute of Technology and Science, Pilani.

 Email: rohan.badl...@gmail.com
 Phone: +91-9660582805.

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




 --
 undefined

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




-- 

*Rohan Badlani*
2nd year undergraduate student,
B.E.(Hons), Computer Science,
Birla Institute of Technology and Science, Pilani.

Email: rohan.badl...@gmail.com
Phone: +91-9660582805.
___
Wikidata-l mailing list
Wikidata-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-l