Note that this document is not intended at introducing the RDF model or assorted specifications, but rather at introducing their specific application in the context of the RDF API for Drupal. If any of the basic concepts touched upon in the following are unfamiliar, you may wish to consult the RDF introduction and glossary before proceeding onwards.

Repositories

A repository is a storage container for RDF data, and can be implemented, for instance, in terms of an in-memory triple store, a serialized file on disk, an RDBMS database, or even an RPC connection to a remote service.

For example, the RDF DB module implements RDBMS-backed repositories, and the RDF Import module allows any serialized RDF graph (e.g. an RDF/XML file) to be used as a read-only repository.

Drupal modules can define repositories by implementing the hook_rdf_repositories() hook.

Contexts

A context is a named, unordered set of RDF statements; it's also commonly known as a named graph. Contexts can be thought of as the relationship between an RDF statement to a sub-graph containing the statement, and they are very useful for tracking provenance of the statements in a repository, that is, which file or URL the statements originate from.

For example, if you've imported RDF data from a file, contexts provide the mechanism for facilely replacing all the old imported data when that file is updated.

Drupal modules can define contexts by implementing the hook_rdf_contexts() hook.

Namespaces

Namespaces define URI abbreviations for use in CURIEs and QNames.

For example, the Dublic Core URI reference http://purl.org/dc/elements/1.1/title can be expressed more compactly (and for purposes of display, much more human-friendly) as dc:title (QName) or [dc:title] (CURIE)
by defining a dc namespace to equal the vocabulary base URI http://purl.org/dc/elements/1.1/.

Drupal modules can define namespaces by implementing the hook_rdf_namespaces() hook.

Formats

RDF data can be serialized into a number of textual formats (also known as representations), including RDF/XML, TriX, N3, Turtle and N-Triples.

The only built-in formats provided by the RDF API module are the native RDF/PHP serialized representation and the structurally equivalent RDF/JSON representation. Interoperability with more RDF formats, including the standard RDF/XML, can be obtained via the RDF Export and RDF Import modules.

Drupal modules can provide serialization/unserialization functionality for various additional RDF formats by implementing the hook_rdf_formats() hook.