Comments (3)
I've just push an experimental support for commonsMedia (only images for now).
Can you let me know if this is what you expected?
irb(main):001:0> require 'wikidata'
=> true
irb(main):002:0> i = Wikidata::Item.find 'Q6882'
=> <Wikidata::Item id: Q6882, title: "James Joyce">
irb(main):003:0> i.property('P18')
=> #<Wikidata::Property::CommonsMedia:0x007fa522a8fc90 @property=#<Hashie::Mash id="Q6882$8CB12994-045E-4EB3-98F8-3975EA1BF9A7" mainsnak=#<Hashie::Mash datatype="commonsMedia" datavalue=#<Hashie::Mash type="string" value="Revolutionary Joyce Better Contrast.jpg"> property="P18" snaktype="value"> rank="normal" references=[#<Hashie::Mash hash="d6e3ab4045fb3f3feea77895bc6b27e663fc878a" snaks=#<Hashie::Mash P143=[#<Hashie::Mash datatype="wikibase-item" datavalue=#<Hashie::Mash type="wikibase-entityid" value=#<Hashie::Mash entity-type="item" numeric-id=206855>> property="P143" snaktype="value">]> snaks-order=["P143"]>] type="statement">>
irb(main):004:0> i.property('P18').url
=> "https://upload.wikimedia.org/wikipedia/commons/1/1e/Revolutionary_Joyce_Better_Contrast.jpg"
irb(main):005:0> i.property('P18').url 200
=> "https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Revolutionary_Joyce_Better_Contrast.jpg/200px-Revolutionary_Joyce_Better_Contrast.jpg"
Il you have examples of wikidata pages with other commonsMedia statements like video, audio etc i'll will add support for them.
from wikidata-client.
Yes, this is super. I started adding support on my own branch, but yours is much better! Thank you so much for the quick turn around.
from wikidata-client.
version 0.0.7 published with this feature
from wikidata-client.
Related Issues (18)
- Add some cache.
- Failure with 'monolingualtext' HOT 1
- Access to property qualifiers? HOT 1
- Unable to query logo_image HOT 4
- API changes broke the client HOT 1
- Map more Properties
- Problem with dependencies versions HOT 6
- Code Climate Warning and `rake spec` failed HOT 2
- Access to suggestions list HOT 1
- Hashie warnings HOT 5
- (entity "ระยอง") doesn't work
- Faraday Connection failed - comparison of Integer with Range failed HOT 2
- Readme.
- Handle wikidata error in Response object.
- Allow to define a custom mapping.
- Invalid extraction of BC dates HOT 1
- excon is a dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikidata-client.