We’re rewarding the question askers & reputations are being recalculated! Read more.
20

On 18. April 2016 the ticket "More efficient SPARQL queries for sitelinks" brought us a better way: schema:isPartOf. ?sitelink schema:about ?item . ?sitelink schema:inLanguage "en" . ?sitelink schema:isPartOf <https://en.wikipedia.org/> . Your full query now looks like this: PREFIX schema: <http://schema.org/> PREFIX wikibase: <http://...


16

Try this one: prefix schema: <http://schema.org/> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> SELECT ?cid ?country ?article WHERE { ?cid wdt:P31 wd:Q3624078 . OPTIONAL { ?cid rdfs:label ?country filter (lang(?country) = "...


16

I'm the developer of WDQ. It was developed as a stop-gap measure, until Wikidata would get its own query service. That took some years, but now we have SPARQL and https://query.wikidata.org/ so I plan to retire WDQ in the not-too-distant future. I strongly recommend you go for SPARQL, even if it seems a little verbose at first.


12

Wikidata RDF dumps have been available since 3-Aug-2013. http://www.mail-archive.com/wikidata-l@lists.wikimedia.org/msg02553.html If you're interested in topics related to Wikidata, I'd suggest subscribing to their mailing list. Of course, both Freebase and DBpedia have had much larger dumps available for years.


12

The right expression to use here is p:P31/ps:P31/wdt:P279*. Explanation: p:P31/ps:P31 means instance of, or instance of not marked as preferred. Only using p:P31 at this step would miss some instance. Following the "instance of" part, /wdt:P279* means this class or of any of its sub-classes/sub-sub-classes/etc So, it means instance of this class or of any ...


11

The wikidata dump is already available. As of now, the last (mostly) complete dump is from 5 May 2013 and it includes the dump of pages in the important namespaces (pages-articles.xml).


11

You probably want this: https://www.wikidata.org/w/api.php?action=wbgetentities&props=labels&ids=Q19675&languages=es The API command in English: Get information about some entities (action=wbgetentities), namely the label properties (props=labels) of item Q19675 (ids=Q19675) in Spanish (languages=es). For more details, have a look at the full ...


11

The dependency is supposed to be the opposite, i.e. that Wikipedia should rely on data in Wikidata. This is however not fully implemented yet. If you look at the infobox on this cheese in French, all data comes from Wikidata, but not in English (yet). We are far from full implementation, so expect to see any combination of people pulling data from Wikipedia ...


8

If you want to do this from the dumps, you can use the wb_items_per_site dump (current version, 625 MB; most recent dumps) For each Wikidata item, this contains rows with the corresponding page name on a given wiki project. For individual articles, you can use &action=info on Wikipedia as Ainali suggests, but you have to use the /w/index.php?title=...


8

Assuming you are familiar with SPARQL, Wikidata (not to be confused with DBpedia) has an official endpoint and a page with example queries. The following example lists all countries with the property sovereign state: PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/...


7

The dump that you want is wb_items_per_site.sql.gz. Though it contains mapping between article titles and wikidata ids for all wikis, so it's relatively big (~600 MB compressed). And it's an SQL dump, so you can either import it into a MySQL database and query that, or you can try to parse it based on the unspecified (but reasonably stable) format. Since ...


7

You can get it also using SPARQL: SELECT DISTINCT * WHERE { wd:Q19675 rdfs:label ?label . FILTER (langMatches( lang(?label), "ES" ) ) } See it on Wikidata Query Service.


7

The point in time property of the award received is what Wikidata calls a qualifier: Along with sources and ranks, qualifiers allow statements to be expanded on, annotated, or contextualized beyond what can be expressed in just a simple property-value pair. Here is the modified query to access the point in time of the award received: SELECT ?item ?...


6

It really depends on what you're trying to achieve. This is what the Semantic Mediawiki project has to say on the relationship between Semantic MediaWiki and Wikidata: The software that powers Wikidata is a set of MediaWiki extensions collectively known as Wikibase, and though Wikibase has similarities to Semantic MediaWiki, it is a distinct set of ...


6

You can also use the SPARQL service with query like: prefix schema: <http://schema.org/> SELECT * WHERE { <https://en.wikipedia.org/wiki/Tom_Hanks> schema:about ?item . }


6

You could also use the API. The call https://en.wikipedia.org/w/api.php?action=query&prop=pageprops&format=json&titles=Tom%20Hanks will give you the id on Wikidata (as "wikibase_item").


6

The Geonames RDF for Antananarivo links to Wikipedia: <gn:wikipediaArticle rdf:resource="http://en.wikipedia.org/wiki/Antananarivo"/> You should be able to use that to get the corresponding Wikidata entity.


6

The Wikidata database is currently offered for download in several different formats: The full XML dumps have been available for quite some time. However, they require parsing to extract the actual JSON data from the enclosing XML file. Since July 2014 there are also pure JSON dumps available. In addition, Wikidata now also provides official RDF exports.


6

As Magnus Manske points out, SPARQL is the preferred way since, I would add, SPARQL is standardized BUT, here is the downside: The SPARQL endpoint, at this point in time, is NOT as reliable as WDQ yet, for example a query like this: https://wdq.wmflabs.org/api?q=tree[729][150][171,273,75,76,77,70,71,74,89] Which returns all animals in wikidata, takes 15 ...


6

I think this is close to what you want but there doesn't seem to be a property for group or period as a number. SELECT ?element ?elementLabel ?symbol ?protons ?group ?groupLabel ?period ?periodLabel WHERE { ?element wdt:P31 wd:Q11344; wdt:P1086 ?protons; wdt:P246 ?symbol. OPTIONAL {?element wdt:P279 ?group . ?group wdt:...


6

As far as I know, there are no methodological guidelines for how to model those things on Wikidata. Rerardless Wikidata, modelling of such geopolitical endurants/perdurants/aggregates might be fairly complex. Option 1 Create a separate "Japanese-occupied Hong Kong" entry (similar to Vichy France). Split British Hong Kong into "British-occupied Hong Kong" ...


5

Depending on your use-case Wikidata toolkit is a Java tool that allows you to iterate over all the items in a dump. In fact it auto-downloads the latest dump and translates the entire model into Java objects. This means everything is abstracted and you just have to write the call-back to be applied to each item. I wrote a tutorial on how to use it in ...


5

The official Wikidata dumps are still in a very early stage. At the moment, you might find these processed files helpful, especially the one that ends with links.ttl.gz (currently http://semanticweb.org/RDF/Wikidata/turtle-20130801-links.ttl.gz), which is a Turtle file that provides the inter-language links extracted from the Wikidata dump. The export ...


5

Yes, there is. There are several ways to get this list: You can, in Wikidata website, look at every entity that has a link to currency (Q8142): https://www.wikidata.org/wiki/Special:WhatLinksHere/Q8142. The problem of this is that you will have some entities that makes a link to currency other than instance of. The best way is to use an external tool ...


5

You can do it by using MediaWiki API for Wikidata with backlinks query https://www.wikidata.org/w/api.php?action=query&list=backlinks&blnamespace=0&bllimit=500&&bltitle=Property:P1086 In above example blnamespace=0 means the result list to include only items (without user pages, talk pages, templates, etc.). The example is for atomic ...


5

While not the most script-friendly, here is the easiest/fastest way to get what you want without any third-party: 1) Go to the Wikidata page of the property 2) Click What links here in the left panel's Tools section: 3) Enjoy the paged list:


5

You could do it with SPARQL: SELECT ?wdLabel ?ooLabel WHERE { VALUES (?s) {(wd:Q42)} ?s ?wdt ?o . ?wd wikibase:directClaim ?wdt . ?wd rdfs:label ?wdLabel . OPTIONAL { ?o rdfs:label ?oLabel . FILTER (lang(?oLabel) = "en") } FILTER (lang(?wdLabel) = "en") BIND (COALESCE(?oLabel, ?o) AS ?ooLabel) } ORDER BY xsd:integer(STRAFTER(STR(?wd)...


5

You can abbreviate SPARQL by expanding a given query fragment with default namespace definitions and other options. For instance the wikidata query command line client expands wdq -tplanet '?planet wdt:P31 wd:Q44559; wdt:P397 ?sun' to this SPARQL query PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>...


5

In the original query ?property and ?p are distinct values: ?property is wd:P54 (short for <http://www.wikidata.org/entity/P54>) and ?p is wdt:P54 (short for <http://www.wikidata.org/prop/direct/P54>). Notice that both refer to P54, but they are not the same. The two are connected by ?ref, which is wikibase:directClaim. This is why your ...


5

Wikidata doesn't automatically use data from Wikipedia. Data from Wikipedia is uploaded to Wikidata by hand or using some more or less automated tools to do batch uploads but ultimately under control of a user, as PetScan or Wikidata Game. The uploading work is in progress with thousands of articles in Wikipedias without an item in Wikidata and millions of ...


Only top voted, non community-wiki answers of a minimum length are eligible