Wikidata talk:SPARQL query service

From Wikidata
Jump to navigation Jump to search

link from data access page[edit]

Hey :)

Thanks for starting this. Can you please link/incorporate in Wikidata:Data access? Thanks a lot! --Lydia Pintscher (WMDE) (talk) 10:58, 16 September 2015 (UTC)

@Lydia Pintscher (WMDE): I have added a link, diff Jheald (talk) 09:42, 17 September 2015 (UTC)
Thanks! --Lydia Pintscher (WMDE) (talk) 22:11, 17 September 2015 (UTC)

Logo?[edit]

How about a logo/icon for SPARQL query service? To make it easy to remember/distinguish from WDQ, Reasonator etc. The wikidata logo with a (white?) question mark?

--Atlasowa (talk) 14:43, 23 September 2015 (UTC)

@Atlasowa: Thanks for the suggestion! This was turned into phab:T140577 and is being discussed there. --Deskana (WMF) (talk) 04:25, 20 July 2016 (UTC)
@Deskana (WMF): Thank you! --Atlasowa (talk) 19:39, 20 July 2016 (UTC)

Embed in map tutorial[edit]

Is there a tutorial that explains how to embed a query in the wikimedia map like this:

https://query.wikidata.org/embed.html#%23%20Points%20culminants%20par%20d%C3%A9partement%20fran%C3%A7ais%0A%23defaultView%3AMap%0ASELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Fculminant%20%3FculminantLabel%20%3Faltitude%20%3FpartieDeLabel%20%3Fcoordinate%20%3Fimage%20%28concat%28str%28floor%28%3Faltitude%2F500%29%2a500%29%2C%20%27-%27%2Cstr%28ceil%28%3Faltitude%2F500%29%2a500%29%29%20%20as%20%3Flayer%29%0AWHERE%20%7B%0A%0A%20%20%3Fitem%20wdt%3AP31%2Fwdt%3AP279%2a%20wd%3AQ6465%20.%0A%20%20%3Fitem%20p%3AP31%20%3Fdep%0A%20%20FILTER%20NOT%20EXISTS%20%7B%20%3Fitem%20p%3AP576%20%3Fx%20%7D%20%0A%20%20FILTER%20NOT%20EXISTS%20%7B%20%3Fitem%20p%3AP582%20%3Fx%20%7D%20%0A%20%20FILTER%20NOT%20EXISTS%20%7B%20%3Fdep%20pq%3AP582%20%3Fx%20%7D%20%20%0A%20%20OPTIONAL%7B%0A%20%20%20%20%3Fitem%20wdt%3AP610%20%3Fculminant%20%0A%20%20%20%20OPTIONAL%7B%20%3Fculminant%20wdt%3AP2044%20%3Faltitude%20%7D%0A%20%20%20%20OPTIONAL%7B%20%3Fculminant%20wdt%3AP361%20%3FpartieDe%20%7D%0A%20%20%20%20OPTIONAL%7B%20%3Fculminant%20wdt%3AP625%20%3Fcoordinate%20%7D%0A%20%20%20%20optional%20%7B%20%3Fculminant%20wdt%3AP18%20%3Fimage%20%7D%0A%20%20%7D%0A%20%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22fr%22.%20%7D%0A%20%20%0A%7D%20ORDER%20BY%20DESC%28%3Faltitude%29

Thanks! --Tobias1984 (talk) 10:01, 11 September 2016 (UTC)

Actually I got it to work now. This is a nice example that shows how to put the labels into the layer-bar:
#Armenian Sister City
#defaultView:Map
SELECT ?item ?itemLabel ?sisterCity ?sisterCityLabel ?coordinate ?layer
WHERE {
  ?item wdt:P17 wd:Q399 .
  ?item wdt:P190 ?sisterCity .
  ?sisterCity wdt:P625 ?coordinate .
  ?sisterCity wdt:P17 ?sisterCountry .
  SERVICE wikibase:label { 
    bd:serviceParam wikibase:language "en" . 
    ?item rdfs:label ?itemLabel .
    ?sisterCity rdfs:label ?sisterCityLabel .
	?sisterCountry rdfs:label ?layer .
  }
}

Try it!

or the link to the map:

https://query.wikidata.org/embed.html#%23Armenian%20Sister%20City%0A%23defaultView%3AMap%0ASELECT%20%3Fitem%20%3FitemLabel%20%3FsisterCity%20%3FsisterCityLabel%20%3Fcoordinate%20%3Flayer%0AWHERE%20{%0A%20%20%3Fitem%20wdt%3AP17%20wd%3AQ399%20.%0A%20%20%3Fitem%20wdt%3AP190%20%3FsisterCity%20.%0A%20%20%3FsisterCity%20wdt%3AP625%20%3Fcoordinate%20.%0A%20%20%3FsisterCity%20wdt%3AP17%20%3FsisterCountry%20.%0A%20%20SERVICE%20wikibase%3Alabel%20{%20%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%20%0A%20%20%20%20%3Fitem%20rdfs%3Alabel%20%3FitemLabel%20.%0A%20%20%20%20%3FsisterCity%20rdfs%3Alabel%20%3FsisterCityLabel%20.%0A%09%3FsisterCountry%20rdfs%3Alabel%20%3Flayer%20.%0A%20%20}%0A}%0A

--Tobias1984 (talk) 19:42, 12 September 2016 (UTC)

How to link to textual/ JSON data?[edit]

Let's say I want a script to retrieve the data from a query. So I don't want to click in a browser to select the download format for my query, but instead want to construct a URL to get the JSON/ CSV directly. How is this possible? Given the way the Javascript is minimised, I can't see what URL my browser is calling to get the data. Thanks in advance for any help, MartinPoulter (talk) 14:17, 13 September 2016 (UTC)

the URL is: https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json&query=YOUR_QUERY --Pasleim (talk) 14:26, 13 September 2016 (UTC)
A delayed thank-you to User:Pasleim. Cheers, MartinPoulter (talk) 16:25, 26 October 2016 (UTC)

Wikidata Query Output[edit]

Can I choose the output format of the GUI tool? In addition to XML and JSON, can the GUI tool also output wiki formatted data (tables, lists, etc.) that I can simply paste into a wiki page? Thanks! SharkD (talk) 03:39, 24 March 2017 (UTC)

missing links[edit]

Wikidata:SPARQL query service/Wikidata Query Help:

d1g (talk) 09:36, 29 April 2017 (UTC)

How often is the data updated in wikidata query?[edit]

Hi, I tried to use the query, it states the query is updated 10 seconds ago. How long does the query reflect the edit I made in wikidata? --Napoleon.tan (talk) 12:58, 29 April 2017 (UTC)

Usually about every three or four seconds, but it varies. 10 seconds is a slightly longer lag than usual, I think. Jheald (talk) 22:16, 29 April 2017 (UTC)

View from an external website[edit]

Moin Moin at all, I've there a query, which I have linked to an external website via iframe.

SELECT ?Kirche ?KircheLabel ?geographische_Koordinaten ?GeoNames_ID ?Bild WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],de". }
  ?Kirche wdt:P31 wd:Q16970.
  ?Kirche wdt:P131 wd:Q23787499.
  OPTIONAL { ?Kirche wdt:P625 ?geographische_Koordinaten. }
  OPTIONAL { ?Kirche wdt:P1566 ?GeoNames_ID. }
  OPTIONAL { ?Kirche wdt:P18 ?Bild. }
}
LIMIT 100

Try it!

Now I don't want to have the view as a table, but directly the "Image Grid". Is there a parameter in iframe that I get directly "Image Grid"? Thanks in advance --Crazy1880 (talk) 20:44, 3 November 2017 (UTC)

No items[edit]

I am trying to create this list and it brings a few names on the list generated on Wikidata Query.

However, when I copy the code to Wikipedia, it says there is "no items". Am I doing something wrong?—Teles «Talk to me˱M @ C S˲» 15:22, 2 December 2017 (UTC)

Try ?item instead of ?singer
--- Jura 15:25, 2 December 2017 (UTC)
@Jura1: This way?. Still the same.—Teles «Talk to me˱M @ C S˲» 15:32, 2 December 2017 (UTC)
I saw your edit there and ListeriaBot just edited the page. Thanks!!—Teles «Talk to me˱M @ C S˲» 15:47, 2 December 2017 (UTC)

SPARQL query service versus Wikidata Query[edit]

It seems like various places in Wikidata documentation call the tool at https://query.wikidata.org/ the "SPARQL query service", "Wikidata Query", and "Wikidata Query service". Do all of these names refer to the same tool? Blue Rasberry (talk) 20:20, 8 March 2018 (UTC)

Proposed move[edit]

Propose move Wikidata:SPARQL query service -> Wikidata:Wikidata Query Service

The name for this tool is "Wikidata Query Service". Here are some use instances of that name:

I am not aware of any publication preferring "SPARQL query service" as the name for this interface. This is a proper noun so I favor capitalizing every letter as some of these sources do.

I do not know how moves work on Wikidata. I am posting here then asking for admin support. Blue Rasberry (talk) 17:46, 9 April 2018 (UTC)

Ah - I see there's a lot of stuff sitting around under the top level page, including translations etc. We probably do want redirects though. Is there a tool that admins have access to for mass renaming like that? ArthurPSmith (talk) 08:30, 10 April 2018 (UTC)
@MichaelSchoenitzer: Your proposal is best. Blue Rasberry (talk) 21:01, 1 August 2018 (UTC)

Incorrect name propagating at Wikimedia Commons[edit]

At Wikimedia Commons I proposed a rename of a category containing images of output from this tool. Commons is calling this service's output the "Wikidata SPARQL data". I see this as incorrect and a result of the inconsistent use of the name here. I prefer "Wikidata Query Service" and to say that anything from it is "Wikidata Query Service output" or a "Wikidata Query Service data visualization". I appreciate anyone who can comment in Wikimedia Commons on what to call the illustrative image files which people are collecting to talk about this tool. Blue Rasberry (talk) 20:18, 8 August 2018 (UTC)

@Bluerasberry: Over time there have been a number of Query Services against data from Wikidata, including Magnus's original Wikidata Query (WDQ), and various off-site services run against local replications of Wikidata. Hence the original emphasis that this was a (the?) SPARQL query service, as opposed to Magnus's service which used its own syntax, or other services offering other query APIs. Jheald (talk) 21:26, 9 August 2018 (UTC)
@Jheald: The service at query.wikidata.org is the one that I identify as default and native.
I see two options -
  1. Keep this page named "SPARQL query service"
    1. This page remains named "SPARQL query service" and gives an overview of the many Wikidata tools which perform SPARQL queries
    2. We create a new page called "Wikidata Query Service" and make that the main documentation page for the particular tool at query.wikidata.org
  2. Rename this page to "Wikidata Query Service"
    1. Create a new page called "Wikidata tools for SPARQL queries"; put all content not related to the Wikidata Query Service there
    2. Reserve this page only for documenting the "Wikidata Query Service" at query.wikidata.org
Do you see other options? What do you prefer? Blue Rasberry (talk) 21:36, 9 August 2018 (UTC)

Get rid of tag cloud[edit]

How do you get rid of the tag cloud from the default result display? This is just a waste of space and distracting. --Bamyers99 (talk) 22:23, 23 May 2018 (UTC)

We are reverting it. The change will be deployed soon. Then it will be gone. Sorry for the trouble. It should not have gone out like this. --Lydia Pintscher (WMDE) (talk) 08:32, 24 May 2018 (UTC)

Problems with embadding Commons Creator page on my Wikidata edit[edit]

Hi there,

if've created my Wikidata edit here: https://www.wikidata.org/wiki/Q54825941 but there is a misstake "This property is generally expected to contain only a single value." The help page doesn't help me. Can s.o. say me how to fix this? Thank you. --Taxiarchos228 (talk) 09:29, 6 June 2018 (UTC)