The Resource Description Framework (RDF) is a framework for representing information in the Web. RDF “graph” is a set of RDF triples.

RDF triple

An RDF triple consists of three components:

  • the subject, which is an IRI or a blank node
  • the predicate, which is an IRI
  • the object, which is an IRI, a literal or a blank node
blank nodeyesyes
(subject, predicate, object)

RDF nodes

Nodes can be of 3 types:

  • IRIs - An IRI (Internationalised Resource Identifier) within an RDF graph is a Unicode string that conforms to the syntax defined in RFC 3987
  • literals - Literals are used for values such as strings, numbers, and dates. A literal in an RDF graph consists of two or three elements:
    • a lexical form, being a Unicode string, which SHOULD be in Normal Form C,
    • a datatype IRI, being an IRI identifying a datatype that determines how the lexical form maps to a literal value, and
    • if and only if the datatype IRI is, a non-empty language tag as defined by BCP47. The language tag MUST be well-formed according to section 2.2.9 of BCP47.
  • blank nodes - Blank nodes are disjoint from IRIs and literals. Otherwise, the set of possible blank nodes is arbitrary. RDF makes no reference to any internal structure of blank nodes. Blank nodes do not have identifiers in the RDF abstract syntax. The blank node identifiers introduced by some concrete syntaxes have only local scope and are purely an artefact of the serialisation.
IRI prefixvalue suffix
blank nodeyes

It helps me to think about IRIs as global identifiers and blank nodes as local identifiers. Or you can think about IRIs as bounded variables and blank nodes as free variables in lambda calculus.

RDF notation

I will use following notation:

  • blank nodes as :something (sometimes noted as _:something)
  • IRIs as some:thing (some is IRI “prefix”, thing is value “suffix”)
  • values as "something" (I omit datatype IRI, because it is irrelevant in this context)

Example of RDF triple (as tuple):

(:Alice, foaf:knows, :Bob)

or as graph:

:Alice → foaf:knows → :Bob

See RDF vs Graphs.