Shortcuts: WD:RAQ, w.wiki/LX

Wikidata:Request a query

From Wikidata
Jump to navigation Jump to search

Request a query
Fishing in the Wikidata river requires both an idea where to look for fish and a suitable fishing method. If you have the former, this page can help you find the latter.

This is a page where SPARQL 1.1 Query Language (Q32146616) queries can be requested. Please provide feedback if a query is written for you.

For sample queries, see Examples and Help:Dataset sizing. Property talk pages include also summary queries for these.

For help writing your own queries, or other questions about queries, see Wikidata talk:SPARQL query service/queries and Wikidata:SPARQL query service/query optimization.

Help resources about Wikidata Query Service (Q20950365) and SPARQL: Wikidata:SPARQL query service/Wikidata Query Help and Category:SPARQL.

To report an issue about the Query Service (interface, results views, export...) please see Wikidata:Contact the development team/Query Service and search.
On this page, old discussions are archived. An overview of all archives can be found at this page's archive index. The current archive is located at 2024/05.

One and only one external identifier[edit]

Hi !

Is it possible to create a query where I can get the items with one and only one, specific or not, external identifier ? As an example, Sam James Harper (Q98442698) only have one external identifier (INSPIRE-HEP author ID (P2930)). How can I got all the items with ONLY this external identifier and no other external identifiers ? How can I got all the items who have only a specific number of external identifiers values ?

Thank you ! Simon Villeneuve (talk) 11:06, 14 April 2024 (UTC)[reply]

I think this should work:
SELECT ?item ?itemLabel ?id WHERE {
  ?item wikibase:identifiers 1 .
  ?item wdt:P2930 ?id
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

I found wikibase:identifiers by running

DESCRIBE wd:Q98442698
Try it!

Piecesofuk (talk) 15:24, 14 April 2024 (UTC)[reply]

Thank you for the reply and the additional information. It will be very helpful to me! Simon Villeneuve (talk) 17:08, 14 April 2024 (UTC)[reply]
I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. author  TomT0m / talk page 17:53, 21 April 2024 (UTC)[reply]

Number of items before a specific date[edit]

Kindly requesting the number/count of people with occupation (P106) = librarian (Q182436) worldwide added to Wikidata before 1st Feb 2024.

And, the number of people added with the same criteria above after 1st Feb 2024. Wallacegromit1 (talk) 19:46, 14 April 2024 (UTC)[reply]

Search gives 20713 librarians in total [1]. Ordering by creation date and counting manually there seem to have been added 158 since 1. February 2024, which means 20555 was added before that date. The dates listed are modification dates btw. The creation date can be found in page information. Infrastruktur (talk) 22:17, 14 April 2024 (UTC)[reply]
@Infrastruktur
Thank You So Much, this was really helpful. ✓ Done Wallacegromit1 (talk) 04:42, 15 April 2024 (UTC)[reply]
I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. author  TomT0m / talk page 17:52, 21 April 2024 (UTC)[reply]

checking whether a first name is male of female[edit]

I wanna check whether a given name is male or female (or both) in my pywikibot-script. My first idea was to import all the male names / female names into my script once and check then against these data. But the simple query:

#title:get all male given names
SELECT ?item ?itemLabel
WHERE {
  ?item wdt:P31 wd:Q12308941.
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'de' }
}
get all male given names

runs into timeout. I can limit the number of items returned, but then how to get all names? As an alternative I could try to query for a specific name:

#title:get a specific male given name
SELECT ?item ?itemLabel
WHERE {
  ?item wdt:P31 wd:Q12308941.
  ?item rdfs:label ?itemLabel .
   FILTER (LANG(?itemLabel) = "de"). 
   FILTER (?itemLabel = "Franz").
}
get a specific male given name

which also runs into timeout.

Acc. to https://stackoverflow.com/questions/38527828/how-to-query-wikidata-items-using-its-labels I tried:

SELECT DISTINCT ?item ?label
WHERE
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:endpoint "www.wikidata.org";
                    wikibase:api "Generator";
                    mwapi:generator "search";
                    mwapi:gsrsearch "inlabel:Franz"@de;
                    mwapi:gsrlimit "max".
    ?item wikibase:apiOutputItem mwapi:title.
  }
  ?item rdfs:label ?label. FILTER( LANG(?label)="de" )

  # … at this point, you have matching ?item(s) 
  # and can further restrict or use them
  # as in any other SPARQL query

  # Example: the following restricts the matches
  # to college towns (Q1187811) only

  ?item wdt:P31 wd:Q12308941 .
  }
Try it!

which gives me a list of names similar to the given name "Franz". I could work with this for the price of having to query each given name separately., e.g. accessing only items with label="Franz" or getting all in one query?

Is there any smarter solution? best --Herzi Pinki (talk) 20:58, 14 April 2024 (UTC)[reply]

Hello @Herzi Pinki,
Your first query doesn't time out if you turn off the label service. In order to get the labels, you can wrap your query in a WITH clause, and then use the label service in the main part of your query, like this. This query returns 48,861 hits in about 40 seconds.
What I cannot explain though is that this only works if the label service line is wrapped in an OPTIONAL clause, otherwise this approach fails too. Vincent Tep (talk) 19:42, 16 April 2024 (UTC)[reply]
@Vincent Tep: a lot of not straightforward tricks. and it still times out for me. :-( thanks anyhow --Herzi Pinki (talk) 22:36, 16 April 2024 (UTC)[reply]
I tried it multiple times and it timed out once too. I suggest you try again. If it doesn't work I can send you a .csv of the results. Vincent Tep (talk) 06:41, 17 April 2024 (UTC)[reply]
I want to embed the query in a script to check gender against names, so a static .csv will not really help. best --Herzi Pinki (talk) 09:51, 17 April 2024 (UTC)[reply]
your initial query works fine when you disable the label service. Maybe you can do this (retrieve only item IDs), and then make a separate call/query to get their labels? Vincent Tep (talk) 12:01, 17 April 2024 (UTC)[reply]
splendid idea:
SELECT ?item ?itemLabel
WHERE {
  ?item rdfs:label ?itemLabel .
   FILTER (LANG(?itemLabel) = "de"). 
VALUES ?item {

wd:Q741
wd:Q923
wd:Q1557
wd:Q4642
wd:Q20164
wd:Q20790
wd:Q24223
wd:Q29884
wd:Q37080
wd:Q42771
}.
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'de' }
}
Try it!
I cannot paste the full query here, as urls get too long. But it seems to work in 1000 junks, or even in 10000 junks Query for first 1000. thanks a lot, --Herzi Pinki (talk) 13:48, 17 April 2024 (UTC)[reply]
@Herzi Pinki: In one query :
#title:get all male given names
SELECT ?item ?itemLabel
WHERE {
  {
      select * {
          ?item wdt:P31 wd:Q12308941.
      }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'de' }
}
get all male given names
it works. The trick is to wrap the item retrieval into a subquery and call the query service outside. author  TomT0m / talk page 14:26, 17 April 2024 (UTC)[reply]
even better. there is some room above for more names to search for (estimated another +20% before the query breaks). thanks a lot --Herzi Pinki (talk) 15:04, 17 April 2024 (UTC)[reply]
Thanks @TomT0m, I had the same idea (pilfered from the Query Optimization page), but I wrapped my query in a WITH clause, whereas you didn't. Yours is shorter to write, more straightforward, runs twice as fast and seems to returns 4 more hits. Thank you! Vincent Tep (talk) 19:19, 17 April 2024 (UTC)[reply]
I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. Herzi Pinki (talk) 15:11, 17 April 2024 (UTC)[reply]

conncetions between basketball and hiphop[edit]

hi, I would like a query in which are explicated the possible connection between basketball and hiphop 87.0.83.82 14:20, 17 April 2024 (UTC)[reply]

Concat the URL with a name and not with all URL[edit]

I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. author  TomT0m / talk page 17:50, 21 April 2024 (UTC)[reply]

Hi! I've created this query that works perfectly. The only thing is that I would like the URL to appear under a title "This is a link" instead of the whole URL. I am using the code CONCAT but it doesn't work. Thanks! Leire

#defaultView:Map
#Fimmakers
SELECT DISTINCT ?filmmaker ?filmmakerLabel ?lugar ?coord ?birthdate ?year (CONCAT("[[", ?TabakaleraURL, "|This is a link]]") AS ?TabakaleraURL)
 
WHERE
{
       ?filmmaker wdt:P31 wd:Q5 .
       ?filmmaker wdt:P106 wd:Q2526255 . #zinemagilea
    ?filmmaker wdt:P19 ?lugar. 
  ?filmmaker wdt:P1344 wd:Q9081343.
  ?lugar wdt:P625 ?coord.
  
  ?filmmaker  wdt:P10069  ?tabakalera.
  OPTIONAL{?filmmaker wdt:P569 ?birthdate .} # P569 : Date de naissance
   BIND(year(?birthdate) as ?year)
  FILTER(?year > 1800)
  wd:P10069 wdt:P1630 ?formatterurl .
 BIND(IRI(REPLACE(?tabakalera, '^(.+)$', ?formatterurl)) AS ?TabakaleraURL).
 
 

       SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 
}
Try it!

Lmerice (talk) 17:53, 18 April 2024 (UTC)[reply]

@Lmerice: From a discussion on phabricator I learned that in any view different of the table view, if there is a variable ?var and a variable ?varLabel (var suffixed by Label), the "?varLabel" is used for the label of the links. So here is the query, just rewrote a bit but the only real change is the introduction of ("this is a link " as ?TabakaleraURLLabel) in the "select" clause :
#defaultView:Map
#Fimmakers
SELECT DISTINCT ?filmmaker ?filmmakerLabel ?lugar ?coord ?birthdate ?year ?TabakaleraURL ("this is a link " as ?TabakaleraURLLabel)
 
WHERE
{
  ?filmmaker wdt:P31 wd:Q5 ;
             wdt:P106 wd:Q2526255 ; #zinemagilea
             wdt:P19 ?lugar ;
             wdt:P1344 wd:Q9081343.
  ?lugar wdt:P625 ?coord.
 
  
  OPTIONAL{ ?filmmaker wdt:P569 ?birthdate . } # P569 : Date de naissance
  BIND(year(?birthdate) as ?year)
  FILTER(?year > 1800)
  
  ?filmmaker  wdt:P10069  ?tabakalera.
  wd:P10069 wdt:P1630 ?formatterurl .
  BIND(IRI(REPLACE(?tabakalera, '^(.+)$', ?formatterurl)) AS ?TabakaleraURL).

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 
}
Try it!
author  TomT0m / talk page 09:35, 19 April 2024 (UTC)[reply]
That was just what I needed. Thanks! Lmerice (talk) 16:36, 21 April 2024 (UTC)[reply]

Query using all subproperties of parent (P8810)[edit]

Can I query for all parents of people living in a city like University of Oxford (Q34433) by using parent (P8810) in my query and get the information via subproperty of (P1647) without using child (P40), mother (P25), or father (P22) directly? ChristianKl21:47, 18 April 2024 (UTC)[reply]

@ChristianKl:_Yes but not simple, plus there are no person living in Oxford University right now on Wikidata so I tried with another city insteaD :
select distinct ?personne ?personneLabel ?parent ?parentLabel {
  ?personne ?parent_prop_c ?parent .                 # get the data with subproperties, the actual predicate is a variable ?parent_prop_c
  
  ?parent_prop wdt:P1647* wd:P8810 .                 # subproperties of "parent" entities 
  ?parent_prop wikibase:directClaim ?parent_prop_c . # main value "direct claim" predicate for those entities in ?parent_prop_c
  
  ?personne wdt:P551 wd:Q12191 . hint:Prior hint:runFirst true . #get the persons who lives in the place (directly, not the places located in it)
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  
}
Try it!
author  TomT0m / talk page 09:13, 19 April 2024 (UTC)[reply]
Oh, and I forgot, it does not get simpler if you want to get say, the grandfathers, as you can't use propertypaths with variables. Getting grandfathers or, say, all male ascendants can be done in two lines if you don't use subproperties in SPARQL :
This get significantly harder or even impossible with the subproperties. author  TomT0m / talk page 18:29, 21 April 2024 (UTC)[reply]

Things both Japan and Russia[edit]

I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. author  TomT0m / talk page 17:51, 21 April 2024 (UTC)[reply]

Hello, how to query things having wdt:P17==Q17 AND wdt:P17==Q159 ? Bouzinac💬✒️💛 15:29, 19 April 2024 (UTC)[reply]

@Bouzinac: Like this :
select distinct ?item ?itemLabel {
  ?item wdt:P17 wd:Q17, wd:Q159 .
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!
author  TomT0m / talk page 15:46, 19 April 2024 (UTC)[reply]
https://w.wiki/9ouJ ce sont des choses pas forcément fausses, dans la mesure où y a différent territorial entre les deux pays Bouzinac💬✒️💛 15:59, 19 April 2024 (UTC)[reply]
Point amusant : si tu t'amuses à requêter Japon+Brésil, tu te retrouves à Rome :) https://w.wiki/9ouS Bouzinac💬✒️💛 16:02, 19 April 2024 (UTC)[reply]
Si tu veux t'amuser plus efficacement, j'ai mis un formulaire dessus grace à la fonctionnalité "template" : https://w.wiki/9ouw author  TomT0m / talk page 16:14, 19 April 2024 (UTC)[reply]
If you would like to have also not present countryships: https://w.wiki/9qvi. --Infovarius (talk) 20:29, 22 April 2024 (UTC)[reply]

Two or more statements on a certain property[edit]

I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. author  TomT0m / talk page 17:51, 21 April 2024 (UTC)[reply]

How to request a list of all elements where there are two or more statements on a certain property (without deprecated statements)? For example, list of all elements where more than one Great Chinese Encyclopedia code or Den Store Danske ID Proeksad (talk) 16:18, 19 April 2024 (UTC)[reply]

@Proeksad: There is a helper template for that : {{Multiple statements}}. Just {{sparql|query=select ?item { {{multiple statements|P10565|?item}} } }} gives :
select ?item { 
   {
     select distinct ?item {
       ?item p:P10565  ?itemP10565stmt1, ?itemP10565stmt2
                        filter(?itemP10565stmt1 != ?itemP10565stmt2) .
       ?itemP10565stmt1 a wikibase:BestRank .
              ?itemP10565stmt1 a wikibase:BestRank .
     } 
   } }
Try it!
You can combine with other criteria if you like. But Wikidata:Database reports/Constraint violations should do the same in this case. author  TomT0m / talk page 16:27, 19 April 2024 (UTC)[reply]
Thank you! Proeksad (talk) 17:04, 19 April 2024 (UTC)[reply]
How to request without deprecated statements? For example, Q1469#P4342. @TomT0m Proeksad (talk) 17:48, 19 April 2024 (UTC)[reply]
@Proeksad I fixed the template, you can retry the query and now it will use only better ranked statements and ignore deprecated values. If you want all valid values you can try to set the valid parameter :
select ?item { 
   {
     select distinct ?item {
       ?item p:P10565  ?itemP10565stmt1, ?itemP10565stmt2
                        filter(?itemP10565stmt1 != ?itemP10565stmt2) .
       ?itemP10565stmt1 wikibase:rank ?itemP10565stmt1_rank 
              filter (?itemP10565stmt1_rank != wikibase:DeprecatedRank) .
              ?itemP10565stmt2 wikibase:rank ?itemP10565stmt2_rank 
              filter (?itemP10565stmt2_rank != wikibase:DeprecatedRank) .
     } 
   } }
Try it!
author  TomT0m / talk page 11:33, 20 April 2024 (UTC)[reply]

Entities with articles in many languages but not English.[edit]

How can I find the Wikidata entities with the most wiki links which doesn't have an English page? (Or, more generally, the Wikidata entities with the most interwiki links which does not have a link in such-and-such a language.) Grendelkhan (talk) 03:57, 23 April 2024 (UTC)[reply]

I don't have a direct solution, but I did identify some parts:
  • You can select the count of some query, as in the example "Number of humans in wikidata"
  • The current top topic is "largest lakes no enwiki", the solution at https://w.wiki/9kqs may help you with figuring out how to detect whether there is no English wikipedia. It looks like that is this codeblock:
optional {
:   ?article schema:about ?item ; 
:    schema:isPartOf <https://en.wikipedia.org/> .
:  }
:  filter(!bound(?article))
Try it!
  • I think for items linked to a wikipedia page, for each language you get one rdfs:label in the article, for the title of the article in that language. For example here for the United Nations item: https://w.wiki/9seF
I guess the total query would need to select the item ID and number of those labels, while excluding the ones which are not allowed using the filter. I tried combining it all, but my attempt seems to run forever even with just a few items: https://w.wiki/9seW M.alten.tue (talk) 13:18, 25 April 2024 (UTC)[reply]

Find English labels only, but if no label in English allow any language[edit]

I'm basically getting all the data on a wikidata page, to use it for a tool. At the moment, I use this query to get that data:

SELECT ?item ?p_property ?p_propertyLabel ?statementLink ?simplevalue ?simplevalueLabel 
WHERE
{
  wd:Q1065 ?property ?statementLink . 
  ?statementLink ?simplevalueLink ?simplevalue .
  wd:Q1065 ?propdirect ?simplevalue.
  wd:Q1065 rdfs:label ?item.
  
  
  #find property label (thanks to tagishsimon)
  ?p_property wikibase:claim ?property .
  
  #find only properties & values with the right namespace
  FILTER(STRSTARTS(STR(?propdirect), STR(wdt:)))
  FILTER(STRSTARTS(STR(?property), STR(p:))) 
  FILTER(STRSTARTS(STR(?simplevalueLink),  STR(ps:)))
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } # Helps get the label in your language, if not, then en language

  #only get English language item names
  FILTER(LANGMATCHES(LANG(?item), "en"))
}
Try it!

Originally I didn't have that bit at the end, but I would get for example Chinese or French labels for my item and very rarely English. Now it obviously filters out anything not English, but I'm concerned that if an item has no label in English the query will return nothing. I could just check for this in my code, and fire off a second request without the filter and without asking for the item name, but I would prefer to keep the number of requests low.

Is there a way to filter on English labels only, unless no English label exists in which case any label will do? Or should I just do another request? M.alten.tue (talk) 12:59, 25 April 2024 (UTC)[reply]

All riders of the Tour de France 2023 with sport number and ranking[edit]

I think that this discussion is resolved and can be archived. If you disagree, don't hesitate to replace this template with your comment. Strahtw (talk)

To get all riders of the Tour the France 2023 is easy:

SELECT ?item ?itemLabel WHERE {
  ?item wdt:P1344 wd:Q106203524.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Now I want also if exits the sport number (P1618) and the ranking (P1352) of the Tour de France 2023. Usually this two are qualifiers of the Tour de France 2023.

Can someone help me please? Strahtw (talk) 13:28, 25 April 2024 (UTC)[reply]

I got help from another side. If someone is intereseted in the solution here is what I got:
https://w.wiki/9uZb
Strahtw (talk) 11:24, 30 April 2024 (UTC)[reply]

Feminine demonyms[edit]

Hi, I wanted to run but it does not work, any guess?

SELECT ?gare_ferroviaire ?gare_ferroviaireLabel ?gare_ferroviaireDescription ?female_statement ?paysLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
  ?gare_ferroviaire wdt:P31 wd:Q55488.
  MINUS { ?gare_ferroviaire wdt:P5817 ?état_d_usage. }
  OPTIONAL { ?gare_ferroviaire wdt:P17 ?pays.}
    OPTIONAL {
    ?pays p:P1549 ?female_statement .
    ?female_statement (pq:P366|pq:P518) ?female_val; ps:P1549 ?female .
    FILTER( LANG( ?female ) = 'fr' ) .
    MINUS { ?female_statement (pq:P366|pq:P518) wd:Q146786 } .
  } .
}
Try it!

Bouzinac💬✒️💛 15:47, 26 April 2024 (UTC)[reply]

Hospitals in Oxfordshire, displayed on map[edit]

Hi, I created this using the query builder: get a list of hospitals, but am not able to get the results to display on a map.

#Map of hospitals
#added 2017-08
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  {
    SELECT DISTINCT ?item WHERE {
      ?item p:P31 ?statement0.
      ?statement0 (ps:P31/(wdt:P279*)) wd:Q16917.
      ?item p:P131 ?statement1.
      ?statement1 (ps:P131/(wdt:P131*)) wd:Q23169.
    }
    LIMIT 5
  }
}
Try it!

Error/warning message: Unable to display result: Map Arided (talk) 12:07, 29 April 2024 (UTC)[reply]

Hi, this query looks a bit overcomplicated, which is why it was timing out. The title at the start needs to be prefixed with "title:" which is why you were getting that error. Maps need co-ordinate locations, which you get using the property coordinate location (P625). Here's a version that works and gets an image from Wikimedia Commons if one is available:

#title:Map of hospitals
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?coords ?image WHERE {
      ?item wdt:P31/wdt:P279? wd:Q16917. # Hospital or type of hospital
      ?item wdt:P131/wdt:P131? wd:Q23169. # In Oxfordshire or a (part of)* Oxfordshire
      ?item wdt:P625 ?coords. # get longitude and latitude
  OPTIONAL{?item wdt:P18 ?image}
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".}
}
Map of hospitals

Cheers, MartinPoulter (talk) 14:35, 29 April 2024 (UTC)[reply]

Hi Martin, Thanks. Here's what I eventually came up with using Kartographer to display queries. https://www.wikidata.org/wiki/User:Arided I broke down my query for rail stations across districts to get it to complete! Arided (talk) 17:30, 29 April 2024 (UTC)[reply]

Get all participants with ranking and number of the Giro d'Italia 2023[edit]

All Participants of the Giro d'Italia 2023 (Q114614803) are a qualifier of the property P710 with their ranking and their start number. Now I want a list of the riders with their ranking and number

With this query I get all riders waht I want:

SELECT ?rider ?riderLabel ?number ?rank  WHERE {
  ?Giro wdt:P31 wd:Q33861;
   wdt:P361 wd:Q106203942;
   wdt:P710 ?rider;
   #p:P710 ?GiroStatement.
  #OPTIONAL { ?GiroStatement pq:P1352 ?rank. }
  #OPTIONAL { ?GiroStatement pq:P1618 ?number. }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
}
Try it!

And with this query I get all the rankings:

SELECT ?rider ?riderLabel ?number ?rank  WHERE {
  ?Giro wdt:P31 wd:Q33861;
   wdt:P361 wd:Q106203942;
   #wdt:P710 ?rider;
   p:P710 ?GiroStatement.
  OPTIONAL { ?GiroStatement pq:P1352 ?rank. }
  OPTIONAL { ?GiroStatement pq:P1618 ?number. }

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
}
Try it!

I tried different things but I can not get what I want. Strahtw (talk) 11:34, 30 April 2024 (UTC)[reply]

Daxia (Q846492)[edit]

No conozco el idioma inglés. Cómo se realiza una página de desambiguación?. Saludos. Gracias. Mdelt (talk) 15:06, 30 April 2024 (UTC)[reply]

The following finds anything that is said to be the same as (P460) or different from (P1889) Daxia (Q846492) including reverse relations. Is this what you mean? If not, try to be more verbose with your question.
select distinct ?item ?itemLabel where {
  ?item wdt:P460|^wdt:P460|wdt:P1889|^wdt:P1889 wd:Q846492 .
  service wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
Try it!
Infrastruktur (talk) 15:31, 30 April 2024 (UTC)[reply]
Gracias. Saludos Mdelt (talk) 17:24, 30 April 2024 (UTC)[reply]