Wikidata:Request a query/Archive/2016/08

From Wikidata
Jump to navigation Jump to search
This page is an archive. Please do not modify it. Use the current page, even to continue an old discussion.

Most missing label in a language

I would like to run queries that show the most-missing label per language, similar to what Wikidata-Terminator does (https://tools.wmflabs.org/wikidata-terminator/?list&lang=es&mode=t1000). --Tobias1984 (talk) 16:22, 31 July 2016 (UTC)

Something more specific: Wikidata talk:SPARQL query service/queries#Items without labels. --Edgars2007 (talk) 18:42, 31 July 2016 (UTC)
@Edgars2007: Thanks! I tried to generalize it to all of Wikidata, but that might not be possible, because of the timeouts. Do you know how that can be avoided or how Terminator does it? --Tobias1984 (talk) 19:30, 2 August 2016 (UTC)
Currently I don't have time to look at the code, but I think in Terminator SQL queries are run. --Edgars2007 (talk) 20:14, 2 August 2016 (UTC)

Living researchers with no ORCID, by institute

Please adapt this query for All scientific authors, alive in 2012, who do not have an ORCID iD listed to show those employed by just one institution (say, University of Birmingham (Q223429)). If that can include individual parts, like University of Birmingham Medical School (Q7895125), so much the better. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:05, 31 July 2016 (UTC)

For start: something closer. --Edgars2007 (talk) 18:40, 31 July 2016 (UTC)
@Pigsonthewing:
#Scientific authors known to Wikidata, who do not have an ORCID iD listed there
SELECT ?author ?authorLabel ?instit ?institLabel ?count WHERE {
  {
    SELECT ?author (COUNT(DISTINCT ?publication) AS ?count) WHERE {
      ?publication wdt:P31 wd:Q13442814 .
      ?publication wdt:P50 ?author .
      MINUS { ?author wdt:P496 [] } .
      MINUS {
        ?author wdt:P570 ?dod .
        FILTER((YEAR(?dod)) < 2012)
      } .
    } GROUP BY ?author
  } .
  MINUS {
    ?author p:P108/ps:P108 ?instit1;
            p:P108/ps:P108 ?instit2 .
    FILTER(!SAMETERM(?instit1, ?instit2))
  } .
  ?author wdt:P108 ?instit .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
ORDER BY DESC(?count)
Try it!
Matěj Suchánek (talk) 14:30, 1 August 2016 (UTC)

────────────────────────────────────────────────────────────────────────────────────────────────────

Thank you, both. Matěj your version shows all such people with an institution. I wanted it for one institution at a time, more like the version supplied by Edgars2007 - though yours will no doubt be useful, too. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:26, 1 August 2016 (UTC)

On reflection "all scientific authors" may - for the time being - be too restrictive. Maybe just "employed by" the institution? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:32, 1 August 2016 (UTC)

Olympic gold metals from my city

I tried to build wdq query but "gold metal" is used as qualificator value and statement value is uknown, so I don't know how to do it. Can anyone? --Infovarius (talk) 20:10, 4 August 2016 (UTC)

#olympic gold medalist born in Maryland
SELECT DISTINCT ?person ?personLabel WHERE {
  ?person p:P1344 ?statement .
  ?statement pq:P166 wd:Q15243387 .
  ?person wdt:P19 ?birthplace .
  ?birthplace wdt:P131* wd:Q1391
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
Try it!
--Pasleim (talk) 07:22, 5 August 2016 (UTC)
Oh, thanks! --Infovarius (talk) 23:28, 6 August 2016 (UTC)

items with Austrian cultural heritage ID located in an administrative territorial entity different from an Austrian municipality

Hello, I am not a SPARQL expert, could someone please fix the second SPARQL query on Cultural heritage database in Austria ObjektID (P2951)? I have examined the first two items on the violations list and I would expect both Bummerlhaus (Q1004840) and BRG Keimgasse, Mödling (Q1006142) not to be listed on the violations list, because both Steyr (Q260320) and Mödling (Q277965) do have a Austrian municipality key (P964) statement. How should the SPARQL query be changed in order to work as desired? Thank you in advance, --UV (talk) 21:11, 4 August 2016 (UTC)

The query seems to be fine. Bummerlhaus (Q1004840) and BRG Keimgasse, Mödling (Q1006142) were on the violation list because at the time the list was created these items still had the claim located in the administrative territorial entity (P131)=Lower Austria (Q42497) resp. Upper Austria (Q41967) --Pasleim (talk) 07:36, 5 August 2016 (UTC)
@UV: I edited your comment for readability. Hope that is okay. --Tobias1984 (talk) 18:14, 5 August 2016 (UTC)
Thanks a lot! --UV (talk) 18:25, 5 August 2016 (UTC)

Countries that have never won a medal at the Olympics

Topical! Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:36, 5 August 2016 (UTC)

SELECT ?country ?countryLabel WHERE {
  ?country wdt:P31 wd:Q7275 .
  MINUS { ?country wdt:P31 wd:Q3024240 } .
  MINUS {
    ?country wdt:P576 ?date .
    FILTER( YEAR(?date) < 1896 ) .
  } .
  MINUS {
    ?person (wdt:P27|wdt:P1532) ?country;
           p:P1344/pq:P166/wdt:P279* wd:Q636830 .
  } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Try it!
...Denmark and Austria? Matěj Suchánek (talk) 19:27, 5 August 2016 (UTC)
I just want to note, that Olympic data is very incomplete. We even haven't filled participant in (P1344) for all athletes :) --Edgars2007 (talk) 19:36, 5 August 2016 (UTC)
@Edgars2007: Thank you. Good point about data gaps. However, this also includes Vandals (Q42211). Maybe limit to extant countries? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 20:24, 5 August 2016 (UTC)
Another note, Andy. Matěj wrote that query, not me, so he should get "Thank you" :) --Edgars2007 (talk) 06:44, 9 August 2016 (UTC)
@Matěj Suchánek: Apologies, and indeed, thank you! Please see my ealier comment. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:51, 11 August 2016 (UTC)
It's limited to countries that existed some time after the first OG. Incomplete data of course make this inaccurate. Matěj Suchánek (talk) 14:41, 11 August 2016 (UTC)

Find a public company

I would like to run queries that identify public companies by stock exchange ticker. I'm looking at Facebook's wikipedia page, and I see it has a sidebar which includes both exchange and ticker, https://en.wikipedia.org/wiki/Facebook I see that:

wdt:P249  # is stock ticker

So I craft a subject predicate object triplet like:

?Org p:P249 "FB" .

and maybe also:

?Org p:P31 wd:Q43229 . # is "THING isInstanceOf Organization"

However, I notice even when I try the following query, here:

https://query.wikidata.org/, even omitting organization:

SELECT ?Org ?Ticker
WHERE {
   ?Org p:P249 ?Ticker . # P414 stock ticker
}

I receive very few results (certainly fewer than the S&P500, and absent Facebook itself).

And this, which seems like the right query, returns none:

SELECT ?Org
WHERE {
  ?Org p:P31 wd:Q43229 . # isInstanceOf
  ?Org p:P249 "FB" . # P414 stock ticker
}

How should I actually do this query to find a public company (such as facebook) by ticker?

Why not like this ?
SELECT ?Org ?OrgLabel ?StockExchange ?StockExchangeLabel ?Ticker
WHERE {
  ?Org p:P414 ?SE . # look for an entity with a "stock exchange" statement
  ?SE ps:P414 ?StockExchange . # of which we get the value
  ?SE pq:P249 ?Ticker . # and the "ticker symbol" qualifier
  FILTER(?Ticker="FB") . #and we restrict the value of that qualifier to "FB"
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
Try it!
Enjoy
Alphos (talk) 00:27, 7 August 2016 (UTC)

+-1

We all know this is annoying (with quantities), I always forget to add +-0 at first try we probably need some kind of reminder script, that shows up and reminds to add +-0 :) Was planning to use bot to correct some cases, that should be OK to fix automatically (like people height), but that's another discussion, no need to discuss it here. So at first I would want to to have a query, that simply shows, which items have some quantities with +-1 precision. Later then I could write some queries (most popular properties with +-1 etc.) myself, I think. --Edgars2007 (talk) 06:13, 9 August 2016 (UTC)

SELECT ?item ?p ?aspect ?prop ?value {
  ?datavalue wikibase:quantityAmount ?value;
             wikibase:quantityUpperBound ?value_and_one .
  FILTER( ?value_and_one = ?value + 1) .
  ?statement ?pred ?datavalue .
  VALUES ?aspect { wikibase:statementValue wikibase:qualifierValue } .
  ?prop ?aspect ?pred .
  ?item ?p ?statement .
} LIMIT 1000
Try it!
By the way, a bot for his is being prepared at the moment. Matěj Suchánek (talk) 14:13, 9 August 2016 (UTC)
Thanks. Well, it looks like I can forget about taking this on me, will see how things will be going on Phab. --Edgars2007 (talk) 15:55, 9 August 2016 (UTC)

Duplicate values of property

Sometimes users unintentionally adds duplicate values for some prop (very easy to do that with WD useful, btw). This kind of query (with having>1) doesn't catch up these, have tested that some time ago. Note that my linked query is just an example query - it shouldn't return any item even for dublicate values of property. --Edgars2007 (talk) 10:33, 10 August 2016 (UTC)

The following query uses these:

  • Properties: country (P17)  View with Reasonator View with SQID, located in the administrative territorial entity (P131)  View with Reasonator View with SQID
    SELECT ?item ?itemLabel ( COUNT(?iedvien) as ?iedv1 ) ( COUNT(?iedvien) - COUNT(DISTINCT ?iedvien) AS ?iedv)
    WHERE
    {
    	?item p:P131/ps:P131 ?iedvien .
    	?item wdt:P17 wd:Q211 .
    	SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
    }
    GROUP BY ?item ?itemLabel
    HAVING (?iedv1 > 1) # for testing
    # HAVING (?iedv > 1) # to find actual duplicates
    ORDER BY DESC(?iedv) ?itemLabel
    

Something like the above could work. I think User:KrBot removes them on a regular basis.
--- Jura 10:44, 10 August 2016 (UTC)

Fixed the above. Q13406268 should appear.
--- Jura 10:59, 10 August 2016 (UTC)
Great, thanks! --Edgars2007 (talk) 11:49, 10 August 2016 (UTC)

Women elected to the UK parliament

The UK Parliament have just published: Women Members of Parliament: Background Paper. They list 452 women elected to the UK parliament. Please can we have a query that lists the same? Bonus points for including party, constituency and date elected/end of term, as does that paper. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:57, 11 August 2016 (UTC)

SELECT ?person ?personLabel ?start ?end ?partyLabel ?constituency ?constituencyLabel {
  ?person wdt:P21 wd:Q6581072;
          p:P39 ?statement .
  ?statement ps:P39 wd:Q16707842 .
  OPTIONAL { ?statement pq:P580 ?start } .
  OPTIONAL { ?statement pq:P582 ?end } .
  OPTIONAL { ?statement pq:P768 ?constituency } .
  OPTIONAL { ?person wdt:P102 ?party } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
} ORDER BY ?personLabel
Try it!
Sometimes a woman is listed multiple times if she was member of more parties. Matěj Suchánek (talk) 14:54, 11 August 2016 (UTC)
@Matěj Suchánek: That's just what I had in mind, thank you. I've tweeted about this. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:08, 11 August 2016 (UTC)

Statues of women

Pertinent to this recent news story; "The fight to celebrate great women on Britain's streets", please could we have a query for "Public statues of women in the United Kingdom". I'm sure colleagues will be able to change the Q value for their own countries. If we could have a companion search for "Public statues of women in Birmingham" (Birmingham being an English city), the difference would be instructive for those of use learning how to write (or hack) queries. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 18:06, 14 August 2016 (UTC)

Universities that existed in Berlin in 1890

I have data about a person according to which they studied at a University in Berlin in 1890. Univerities in Berlin changed frequently so it would be nice to have a query to see which univerisites existed in Berlin at the time. – The preceding unsigned comment was added by ChristianKl (talk • contribs).

The following query uses these:

Maybe the above can be a start (adapted from one of the samples). It relies on the presence of the listed properties. "\u007C\u007C" is for "||".
--- Jura 10:03, 6 August 2016 (UTC)

(edit conflict)
SELECT ?university ?universityLabel ?founded WHERE {
  { { SELECT DISTINCT ?subclass { ?subclass wdt:P279* wd:Q3918 } } } .
  ?university wdt:P131+ wd:Q64;
              wdt:P31 ?subclass;
               wdt:P571 ?founded .
  FILTER( YEAR( ?founded ) < 1890 ) .
  MINUS {
    ?university wdt:P576 ?date .
    FILTER( YEAR ( ?date ) < 1890 ) .
  } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Try it!
The only result: Technical University of Berlin (Q51985). Matěj Suchánek (talk) 10:06, 6 August 2016 (UTC)

Thank you two. It turns out that the correct university I was seeking was Frederick William University Berlin (Q20266330) for which a headquarter location as set to Berlin but which didn't had P131 set at the time. It's also interesting that P576 isn't used in University of Berlin (Q20266894) but P582 so it shows in the list when it shouldn't. ChristianKl (talk) 17:37, 18 August 2016 (UTC)

Meta: learning to write a simple query

The query I just requested, above, is quite basic. I'd rather learn how to compile my own, rather than having to trouble people here. Although the query tool has some annotation, I'm still not clear as to what everything in a query does. Could someone please detail the process of putting a very simple query together, step by step, using video or screen shots? A good model is Wikidata:Tours/Authority control. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:37, 12 August 2016 (UTC)

I think there was a session about this at Wikimania 2016. Matěj Suchánek (talk) 16:52, 12 August 2016 (UTC)
Just was going to link to presentation, that is mentioned in that phab ticket. There are some other useful links (in phab ticket). --Edgars2007 (talk) 16:55, 12 August 2016 (UTC)

After attending the session on Wikimania, which IMO was useful but extremely short and basic, I thought about the idea to start a step-by-step tutorial wikibook about SPARQL on Wikidata. I don't have the technical skills to do that, though. Does anyone else feel like working on his? Alternatively, does anyone know this book and if so, would it be suitable for SPARQL noobs on Wikidata specifically? Spinster 💬 08:58, 18 August 2016 (UTC)

Greek mythological characters

I'd want to have a query listing all items having instance of (P31)mythological Greek character (Q22988604) or instance of (P31) with an item having subclass of (P279)mythological Greek character (Q22988604). About the results: a column for the items, a column for P31 value(s) in these items, a column for P21 value in these items, a column for P22 value in these items, a column for P25 value in these items, a column for P40 value(s) in these items. Thank you, --Epìdosis 09:39, 18 August 2016 (UTC)

Starting query. --Edgars2007 (talk) 09:53, 18 August 2016 (UTC)
And let's finish it:
SELECT ?item ?itemLabel ?genderLabel ?father ?fatherLabel ?mother ?motherLabel ?children WHERE {
  { SELECT ?item (GROUP_CONCAT(?childLabel; separator=", ") AS ?children) WHERE {
    ?item wdt:P31/wdt:P279* wd:Q22988604 .
    OPTIONAL { ?item wdt:P40 ?child } .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
  } GROUP BY ?item } .
  OPTIONAL { ?item wdt:P21 ?gender } .
  OPTIONAL { ?item wdt:P22 ?father } .
  OPTIONAL { ?item wdt:P25 ?mother } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Try it!
Matěj Suchánek (talk) 14:00, 18 August 2016 (UTC)

Pairs of IDs

Generally, Magnus' Beacon tool is excellent for finding all the items which have External-ID A and External-ID B. For example, all the people with ORCID iD (P496) and CRIStin ID (P2287) are returned by this query (just four of them, at the time of writing).

It would be good to have a tool, or SPARQL query, for all the items with ID A and not ID B.

Specifically, please could I have a query for people with P2287 and not P496? (But see my following post) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:37, 12 August 2016 (UTC)

For this case, you could use WDQ→SPARQL conversion tool (claim[2287] and noclaim[496]. Matěj Suchánek (talk) 16:50, 12 August 2016 (UTC)
@Matěj Suchánek: That worked fine, thank you. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:12, 19 August 2016 (UTC)

Amsterdam-based publishers

I (SPARQL noob eager to learn) have created a query that lists all publishers on Wikidata, with work locations and their geo coordinates. Could use some help in finetuning it, though...

  1. I'd like to restrict this query to only publishers based in Amsterdam - does anyone have tips on how to do that?
  2. Is it, in any way, possible to formulate the query in such a way that the ?_coordinate_location includes not only the coordinates of the ?worklocation but also of the ?item itself? (so, if a publisher has a coordinate location (P625) directly, like for instance Jacob van Meurs (Q17351358), it is also mappable in the same way as the ones with a city?

Thanks, Spinster 💬 08:54, 18 August 2016 (UTC)

  1. add ?item wdt:P937 wd:Q727. to get only people with working location Amsterdam.
  2. this shouldn't be done. People don't have geocoordinates because people aren't geographical objects. If the coordinate on Jacob van Meurs (Q17351358) is the exact position of the working location in Amsterdam then one should add it as qualifier to work location (P937) or one can add a more specific value to work location (P937). --Pasleim (talk) 10:00, 18 August 2016 (UTC)
Thanks!
  1. What if we also have streets or buildings in Amsterdam as work locations? I'd like to have the query in such a way that any location (street, building) in Amsterdam is included.
  2. Agreed, will look how to do this better. I'm not a big fan of qualifiers because they make querying and accurate mapping much more complicated, will see if it can be done in another way. I'm doing an edit-a-thon next week where we want to produce a map of Amsterdam-based publishers in one day, and I'm looking for a straightforward, simple and easily understandable and queryable method. Spinster 💬 16:23, 18 August 2016 (UTC)
  1. For everything located in Amsterdam, use ?worklocation wdt:P131* wd:Q727
  2. querying of qualifiers is not a big deal, use OPTIONAL { ?item p:P937/pq:P625 ?coordinate_person } to get the coordinate in qualifier.
Together, this should help you for the edit-a-thon:
SELECT ?item ?itemLabel ?date_of_birth ?date_of_death ?image ?worklocationLabel ?coordinate_person ?coordinate_location WHERE {
  ?item wdt:P106 wd:Q2516866;
        wdt:P937 ?worklocation.
  ?worklocation wdt:P131* wd:Q727
  OPTIONAL { ?worklocation wdt:P625 ?coordinate_location }
  OPTIONAL { ?item p:P937/pq:P625 ?coordinate_person }
  OPTIONAL { ?item wdt:P569 ?date_of_birth }
  OPTIONAL { ?item wdt:P570 ?date_of_death }
  OPTIONAL { ?item wdt:P18 ?image }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl,en,de,fr" }
}
Try it!
--Pasleim (talk) 17:03, 19 August 2016 (UTC)

Italian cities above Trieste (Q546)

I'd like to create a query with data from Wikidata. A famous Italian song, Tanti auguri (Q16612223), states "Com'è bello far l'amore da Trieste in giù" (literally, in English: "How great it is to make love from Trieste to below"). I'd like to know which Italian cities is not great not to make love in.

Could someone create a query which finds items that:

Thank you very much! --★ → Airon 90 12:12, 18 August 2016 (UTC)

Try the sample "Mountains, with coordinates, not located on Earth" to start out with (Lat > 45.606795)
--- Jura 12:53, 18 August 2016 (UTC)
This is a very nice one! Feel free to add it to WD:Status updates/Next.
SELECT ?item ?itemLabel ?northernmostLat ?northernmostLong WHERE {
  wd:Q546 p:P1333/psv:P1333/wikibase:geoLatitude ?threshold .
  ?item wdt:P31 wd:Q747074;
        p:P1332/psv:P1332 [
          wikibase:geoLatitude ?northernmostLat;
          wikibase:geoLongitude ?northernmostLong
        ] .
  FILTER( ?northernmostLat > ?threshold ) .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,it" } .
} ORDER BY ?northernmost
Try it!
Matěj Suchánek (talk) 14:15, 18 August 2016 (UTC)
Thank you very much Matěj Suchánek for the query! I'm going to insert it --★ → Airon 90 15:48, 22 August 2016 (UTC)

Author strings on scientific papers that equal the description or aliases of other items

I am working on converting author name string (P2093) statements on instances of scholarly article (Q13442814) into author (P50) statements (example). For this, it would be helpful to have a query that lists items (probably instances of humans) for which the description or aliases match any P2093 statement on items about papers, and to sort them by number of such matches. My main stumbling block here is the string comparison, so pointers on how to do that would also be helpful to me. Thanks. --Daniel Mietchen (talk) 09:05, 24 August 2016 (UTC)

A comparison between author name string (P2093) and all labels and alias times out but to just English labels it should work:
SELECT ?paper ?author ?label WHERE{
  hint:Query hint:optimizer "None" .
  ?paper wdt:P31 wd:Q13442814 ;
         wdt:P2093 ?shortname .
  BIND(STRLANG(?shortname,"en") AS ?label)
  ?author rdfs:label ?label;
          wdt:P31 wd:Q5
}
Try it!
--Pasleim (talk) 16:28, 24 August 2016 (UTC)
Thanks a lot, Pasleim! I tried a number of ways to filter things down (commented out below) and would thus still be interested in variants that go through (some of) the aliases. Besides, I tried different ways of counting but could not find one that makes sense. Any further pointers would be great, as would be hints as to what the "hint" commands do, which are rather enigmatic to me at the moment.
SELECT DISTINCT ?paper ?label ?author (COUNT(DISTINCT ?label) as ?count) WHERE{
  hint:Query hint:optimizer "None" .
  ?paper wdt:P31 wd:Q13442814 ;
#         wdt:P921 wd:Q202864 ;
         wdt:P2093 ?shortname .
  BIND(STRLANG(?shortname,"en") AS ?label)
#  FILTER(CONTAINS(LCASE(?shortname), "miller"))
  ?author rdfs:label ?label;
          wdt:P31 wd:Q5 .
#  ?otherpaper wdt:P50 ?author.
} 
GROUP BY ?paper ?label ?author ?count
ORDER BY DESC(?count)
Try it!
--Daniel Mietchen (talk) 01:42, 25 August 2016 (UTC)

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, author name string (P2093)  View with Reasonator View with SQID
    SELECT ?author ?label (COUNT(?paper) as ?ct)
    WHERE
    {
    	hint:Query hint:optimizer "None" .
    	?paper wdt:P31 wd:Q13442814 ;
    		   wdt:P2093 ?shortname .
    	BIND(STRLANG(?shortname,"en") AS ?label)
    	?author rdfs:label ?label;
    	        wdt:P31 wd:Q5
    }
    GROUP BY ?author ?label
    LIMIT 100
    

Interesting way chosen by Pasleim. To count, see above.
--- Jura 03:19, 25 August 2016 (UTC)

Thanks, Jura — that's useful too! --Daniel Mietchen (talk) 15:38, 25 August 2016 (UTC)

Images by specific User

I am not sure, if this is possible with SPARQL, so just trying. Show items and image (P18) of instance of (P31) human (Q5), while image (P18) were added by specific WD user (User:Jklamo for example). --Jklamo (talk) 09:02, 23 August 2016 (UTC)

I'm afraid, you can't get this with SPARQL (or with Petscan easily). The only "related" thing is last edit - Wikidata talk:SPARQL query service/queries#Last edit. --Edgars2007 (talk) 09:06, 23 August 2016 (UTC)
It's possible with SQL on the repo database
SELECT page_title, rev_comment FROM revision JOIN page ON rev_page=page_id WHERE rev_user_text="Jklamo" AND rev_comment LIKE "/* wbcreateclaim-create:1| */ [[Property:P18]]:%" --Pasleim (talk) 12:04, 23 August 2016 (UTC)
Thanks. But I was looking to SPARQL query to take benefit of presentation of results (images shown as image gallery). --Jklamo (talk) 16:47, 28 August 2016 (UTC)

Articles

We (at WMCEE 2016) would like to see all the articles that are available in either Russian OR English, that don't have an article on the Armenian language Wikipedia. Running into timeouts and probably have a bad approach. --Tobias1984 (talk) 14:31, 28 August 2016 (UTC)

SELECT ?item ?itemLabel (COUNT(DISTINCT ?sitelink) AS ?linkcount) WHERE {
    ?item wdt:P31 wd:Q5 .
    ?sitelink schema:about ?item .
  FILTER NOT EXISTS {
    ?article schema:about ?item .
    ?article schema:inLanguage "hy" .
    ?article schema:isPartOf <https://hy.wikipedia.org/>
  }
  OPTIONAL {
    ?article schema:about ?item .
    ?article schema:inLanguage "en" .
    ?article schema:isPartOf <https://en.wikipedia.org/>
  }
  OPTIONAL {
    ?article schema:about ?item .
    ?article schema:inLanguage "ru" .
    ?article schema:isPartOf <https://ru.wikipedia.org/>
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?item ?itemLabel
ORDER BY DESC(?linkcount)
Try it!
Query. You can give them query for those, who have country of citizenship (P27)=Armenia (Q399). --Edgars2007 (talk) 15:17, 28 August 2016 (UTC)
All biographies a=hy, b=en, c=ru
All biographies a=hy, b=en, c=ru
Biographies with P27 or P172
Biographies with P27 or P172

Coordinate check for French historical monument

Hi,

I'm looking to check if the coordinates on items about French historical monument (MH) are consistent with the coordinate of the location of the same monument (or if the location is wrong, I stumble upon Cloître des Dominicains de Collioure (Q22920547) where there is something strange in the source database itself, apparently this cloister was moved several times...). It should be something like :

SELECT ?MH ?MHLabel ?coordMH ?coordLoc ?dist WHERE {
 ?MH wdt:P380 [] ; wdt:P625 ?coordMH ; wdt:P131/wdt:P625 ?coordLoc .
 BIND( geof:distance( ?coordLoc , ?coordMH) as ?dist ) .
 FILTER (?dist > 10) .
 SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" } .
} ORDER BY DESC(?dist)
Try it!

But obviously I've made a mistake somewhere since I have got no results (but I know that there is at least Cloître des Dominicains de Collioure (Q22920547)). FYI, I took the fourth line from mw:Wikidata query service/User Manual#Distance function. @Gzen92: who work on MHs too.

Cdlt, VIGNERON (talk) 15:52, 31 August 2016 (UTC)

Fixed your example, there was a typo on the BIND( geof:distance(?coordLoc , ?coordMH) as ?dist ) line. Matěj Suchánek (talk) 16:17, 31 August 2016 (UTC)
Thank you very much Matěj Suchánek ; I feel dumb, I was looking everywhere but at the names of the variable... Cdlt, VIGNERON (talk) 17:33, 31 August 2016 (UTC)