SABIO-RKSPARQL endpoint

How to SPARQL — a step-by-step tutorial

You don't need to know anything about SPARQL or RDF for this page. Every step adds one small idea. Each query below is live: press Run (or Ctrl+Enter inside the box) and the answer appears underneath. You can change the query and run it again — you can't break anything.

Before we start: the data is made of little sentences

SABIO's data is stored as millions of tiny three-part sentences: something → has some property → some value. For example:

organisms/5          is a                 Organism
organisms/5          has the name         "Homo sapiens"
kinlaw-entry/23815   was measured in      organisms/5

The first part is always a thing, written as a web address (organism 5, entry 23815). The value at the end is either plain text or a number, or another thing — that's how entries are connected to their organism, enzyme, publication and so on.

A query is a sentence with blanks. You write the sentence, leave a blank where you don't know the answer, and SPARQL fills in every possible answer. A blank is a word starting with ?, like ?name.

Step 1 · Peek at five sentences

The simplest query there is: a sentence that is only blanks.

What's going on

You'll probably see sentences about unit 0 ("no unit"). It just happens to come first; without more detail in the sentence, SPARQL returns whatever it finds first.

Step 2 · Everything about one thing

Now fill in the first part and keep the other two blank: "tell me everything about organism 5".

What's going on

Step 3 · List all organisms

Two sentences at once: "?organism is an organism" and "?organism has the name ?name".

What's going on

Step 4 · Find something by its name

Usually you know the name, not the address. Put the name in quotes and leave the thing blank:

What's going on

Step 5 · Search for part of a name

Don't know the exact name? Keep the name blank and add a FILTER: a condition every answer has to pass.

What's going on

Step 6 · Sort the answers

Which organisms have the most entries? Every organism carries its entry count, so we sort by it.

What's going on

Step 7 · Follow a link from one thing to another

This is where it gets useful. An entry points to its organism and its enzyme, and the enzyme has a name. We follow that chain: Homo sapiens → its entries → their enzyme → the enzyme's name.

What's going on

Step 8 · Count

Same chain as step 7, but instead of listing entries we count them per enzyme: "which enzymes have the most human entries?"

What's going on

Step 9 · Get the measured values

The last step: the actual numbers. An entry has parameters (Km, kcat, Ki, …), and each parameter has a type, a value, a unit and usually a compound. Here: Km values of alcohol dehydrogenase (EC 1.1.1.1) in Homo sapiens, per substrate.

What's going on

That's it

With these nine steps you can already answer most questions: describe the sentence you're looking for, leave blanks for what you want to know, and connect things through shared blanks. A few things to remember:

Ready for more? The query editor has a list of explained example queries on the left, from simple to advanced.