Wikidata:SPARQL query service/Wikidata Query Help/SPARQL Editor

From Wikidata
Jump to navigation Jump to search

This page helps you to understand the SPARQL editor on Wikidata Query.

Code Completion

The code completion (default shortcut CTRL + Space / CTRL + ALT + Space / ALT + Enter) helps you with writing your SPARQL query.

It knows some SPARQL syntax and can also help you find the right Property or Item ID.

Auto complete SPARQL

  1. Write for example SELECT
  2. Hit CTRL + Space
Use auto completion to complete SPARQL syntax

Auto complete Item ID

  1. Write for example wd:
  2. Hit CTRL + Space
  3. Type to search for a specific item
 Use auto completion to find the right Item ID for the Item dog

Tooltip

  1. Hover over Wikidata ID like Q146
  2. Tooltip is shown

When hovering an Item or Property ID a tooltip shows more information.

Tooltip when hovering Item ID

Editor Toolbar

Editor Toolbar example

  • expand icon allows you to switch to full-screen mode. You can exit this mode by pressing the "escape" key
  • pin icon shows you the useful prefixes you may want to use in your query
  • folder icon is another way to display the queries examples
  • previous icon allows you to go back to the previous query you wrote (the content is stored in the local storage of your browser, so you can also find back the last query you wrote before closing the tab or browser)
  • bin icon deletes the whole content of the editor (if you do this by mistake, don't panic, use the previous button to get your query back ^^)
  • chain icon displays the short URL of your query
  • play button run query

Shortcuts

If "CTRL+Space" doesn't work (on macOS, for example), there are two alternative shortcuts: "CTRL+ALT+Space" and "ALT+Enter".

The equivalent keyboard shortcuts on a Mac are Control-Space, Control-Option-Space, and Option-Enter (with a portable or wireless keyboard, the last can be entered while holding the Function key, with Fn-Option-Return).