wikidata

SPARQL: How to obtain label in available languages if first option is not available

江枫思渺然 提交于 2019-12-05 10:20:05
If a Wikidata resource returned by my query has no available label in the language I filtered for I obtained an empty cell. SELECT * WHERE { ?country wdt:P31 wd:Q6256. ?country rdfs:label ?country_name FILTER(LANG(?country_name) = 'jbo'). } link How to request to have a label returned in one of any of the available languages if the first language fails? Joshua Taylor First, prefer langMatches for checking language tags. This is especially important in your case, since you might want, for instance, a label in English, and langMatches(lang(?label), "en") will find a label with the tag "en", or

How to get list of statements for a given Wikidata ID?

拜拜、爱过 提交于 2019-12-05 09:29:42
The only thing I managed to do is this link: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q568&format=jsonfm But this produces lots of useless data. What I need is to get all the statements for the given item, but I can't see any of the statements in the query above. here it will be: { "instance of" : "chemical element", "element symbol" : "Li", "atomic number" : 3, "oxidation state" : 1, "subclass of" : ["chemical element", "alkali metal"] // etc... } Is there an API for this or must I scrape the web page? The information you want is in your query, except it's hard to decode.

Retrieving the Interlanguage links from an exported Wikipedia article?

别来无恙 提交于 2019-12-05 00:25:08
问题 I used to retrieve the interlanguage links from an exported Wikipedia article by parsing the export with some regular expressions. In phase 1 of the WikiData project these links have been moved to a separate page on Wikidata. For example the article Ore Mountains has no language links anymore in the export. The language links are now on Q4198. How can I export the language links? 回答1: You are now encouraged to use the Wikidata aPI : http://wikidata.org/w/api.php For your case, use props

How to get Wikidata labels by ID using SPARQL?

99封情书 提交于 2019-12-04 07:42:01
How can I get the labels in English or any other language in Wikidata by ID using SPARQL endpoint? Suppose wd:Q146190 is your wikidata entity ID get the label in a specific language of your specific entity ID: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX wd: <http://www.wikidata.org/entity/> SELECT * WHERE { wd:Q146190 rdfs:label ?label . FILTER (langMatches( lang(?label), "EN" ) ) } LIMIT 1 live example in english live example in german get all the labels in any language of your specific entity ID: SELECT * WHERE { wd:Q146190 rdfs:label ?label } here the link to the live try

Wikidata entity value from name

ぃ、小莉子 提交于 2019-12-03 15:18:14
问题 Is there a way to get Wikidata page information based on the name of the entity for example if I wanted to get page data for Google. I think it has to be done using "entity" with the corresponding entity value however I am not sure of there is any easy way to determine the entity value. 回答1: If you want to do this using the API, you would first use wbsearchentities to find out which entity do you want. For example: https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Google

Retrieving the Interlanguage links from an exported Wikipedia article?

懵懂的女人 提交于 2019-12-03 14:12:48
I used to retrieve the interlanguage links from an exported Wikipedia article by parsing the export with some regular expressions. In phase 1 of the WikiData project these links have been moved to a separate page on Wikidata. For example the article Ore Mountains has no language links anymore in the export. The language links are now on Q4198 . How can I export the language links? You are now encouraged to use the Wikidata aPI : http://wikidata.org/w/api.php For your case, use props=labels . This url is self explicative : http://www.wikidata.org/w/api.php?action=wbgetentities&sites=enwiki

Wikidata entity value from name

五迷三道 提交于 2019-12-03 05:53:03
Is there a way to get Wikidata page information based on the name of the entity for example if I wanted to get page data for Google. I think it has to be done using "entity" with the corresponding entity value however I am not sure of there is any easy way to determine the entity value. If you want to do this using the API, you would first use wbsearchentities to find out which entity do you want. For example: https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Google&language=en The problem with this is that there are multiple entities called "Google": the company (Google Inc.),

SPARQL: Querying Wikidata labels for more than one language

与世无争的帅哥 提交于 2019-12-02 05:55:31
问题 I am trying to get labels in multiple languages from Wikidata's SPARQL endpoint. The following example is given here: SELECT ?country ?country_EN ?country_DE ?country_FR WHERE { ?country wdt:P31 wd:Q185441. # member state of the European Union SERVICE wikibase:label { bd:serviceParam wikibase:language "en". ?country rdfs:label ?country_EN. } SERVICE wikibase:label { bd:serviceParam wikibase:language "de". ?country rdfs:label ?country_DE. } SERVICE wikibase:label { bd:serviceParam wikibase

Wikidata content negotiation

倾然丶 夕夏残阳落幕 提交于 2019-12-02 05:42:31
I was wondering why Wikidata content negotiation results with more than one entities in the file. For instance P2044 in the browser http://www.wikidata.org/entity/P2044.nt gives me triples also about Q6452016 entity: http://www.wikidata.org/entity/Q6452016 I would expect either triples about P2044 or document metadata. Thanks in advance. There are many options of what to produce in an RDF output (as well as there is no standard on what to return in a DESCRIBE query result). In Wikidata, you can use one of these options documented here . See also RDF Dump Format about the Wikidata data model.

SPARQL: Querying Wikidata labels for more than one language

廉价感情. 提交于 2019-12-02 02:06:20
I am trying to get labels in multiple languages from Wikidata's SPARQL endpoint. The following example is given here : SELECT ?country ?country_EN ?country_DE ?country_FR WHERE { ?country wdt:P31 wd:Q185441. # member state of the European Union SERVICE wikibase:label { bd:serviceParam wikibase:language "en". ?country rdfs:label ?country_EN. } SERVICE wikibase:label { bd:serviceParam wikibase:language "de". ?country rdfs:label ?country_DE. } SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". ?country rdfs:label ?country_FR. } } Try it here However, this returns the following error