Hello,
I am building a web site for knowledge discovery, and would like to understand more the structure of wikidata in order to expose selected keys for a wikidata object.
*Is there any schema describing all the keys used in wikidata objects?*
As example, this demo shows all possible keys for 'Richard_Feynman' object.
http://earldouglas.github.io/wdqs-explorer/Richard_Feynman/
It looks like that for each property belonging to 'Richard_Feynman' a query must be made against the property_Id , so to fetch a human readable label. That is, about ~500Kb must be downloaded. I would like to understand better how to consume wikidata API.
- which API exposes a simple schema 'key' : 'value' , like: 'birth_date' : 'Los Angeles' (similar to what you see at wikidata site) ? - which API expose the value of a relationships between objects ? (e.g. Feynman is connected to Cornell University by 'employer' relationship) - Is there a table describing all keys currently present in wikidata, so that is possible to know which one to filter ?
thank you for your debrief,
Luigi
Hi!
*Is there any schema describing all the keys used in wikidata objects?*
If you mean properties, there's no such schema - any of the properties existing (see the list here: https://www.wikidata.org/wiki/Special:MyLanguage/Wikidata:List_of_properties...) can be applied to any of the objects, and any object can have any subset of the properties. In addition, objects (also called entites) have labels, descriptions and items also have site links.
It looks like that for each property belonging to 'Richard_Feynman' a query must be made against the property_Id , so to fetch a human readable label.
Yes, to link between properties and IDs you may need to query, though take a look at this project: http://queryr.wmflabs.org/about/docs
It aims to provide access to property values which already includes labels.
- which API exposes a simple schema 'key' : 'value' , like: 'birth_date' : 'Los Angeles' (similar to what you see at wikidata site) ?
See above, this one is probably closest to what you seek. Note that labels on the properties are not identifiers, they are language-dependent and can be changed (though in practice this doesn't happen too often). But if that's what you seek, I think that would be the best option for you.
- which API expose the value of a relationships between objects ? (e.g. Feynman is connected to Cornell University by 'employer' relationship)
Properties and relationships are the same.
- Is there a table describing all keys currently present in wikidata, so that is possible to know which one to filter ?
Properties are entities too, so techically it's the same table as one storing entities, but it's probably not useful to you as such. You can do it in several ways:
1. https://www.wikidata.org/wiki/Special:AllPages/Property: list all Property-typed pages 2. This SPARQL query: http://tinyurl.com/hqpwogp returns list of properties. You can use SPARQL endpoint (https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual#SPARQL_end...) to access the results directly. 3. API at http://queryr.wmflabs.org/about/docs has /properties which will provide you with the list of properties.
HTH,
wikidata-tech@lists.wikimedia.org