What is a blank node?

A blank node (aka bnode) is an RDF construct that allows users to not specify a resource URI when it is not known, whilst still letting them express things about that resource within a knowledge graph.

What is a graph database?

If this is confusing, do not be concerned, as this is a notoriously tricky subject.

For instance, we might know that John’s mother was Spanish and a skilled cook, but nothing else.
We can represent this information in RDF as follows:

:john :hasMother [ :hasNationality "Spanish" ;

     :isSkilledAt :cooking ] .

This can also be expressed as:
:john :hasMother _:_john_s_mother .

_:_john_s_mother:hasNationality "Spanish" ;

     :isSkilledAt :cooking ] .

We will then be able to query all the people who have a Spanish mother like this:

SELECT ?person ?mother
?person :hasMother ?mother .
?mother :hasNationality "Spanish" .


In John’s case however, the binding for the ?mother variable that will be returned will not be tell us much, as we didn’t know much to begin with. So some triplestores may store _:_john_s_mother as something different, e.g. _:_bnode_123, and they would still be meeting the W3C standard.

Keep in mind that, since blank nodes are not resources, you cannot query them directly, so:
SELECT ?p ?o
_:_john_s_mother ?p ?o

Is actually treated exactly like:
SELECT ?p ?o
?s ?p ?o

Finally, blank nodes can occur as either the subject or the object of a triple but not as the predicate.

When a blank node occurs as the subject of a triple, this is the syntax.

#data about a the car theft suspect:
[] a :Person ;
  :hasCommittedCrime :theft_car_123 ;
  :hasHairColour "Blond" ;
  :hasHeight "175cm".

Here are links to blank nodes in Turtle and SPARQL.

Why use a graph database?

What is semantic reasoning?

What is SPARQL?

What is Turtle?

Learn more about RDFox

Get yourself a free trial!

Contact us for more detail

Looking for more answers?

From the blog

High performance knowledge graph and semantic reasoning engine.