In my earlier post on Graph Databases I introduce RDF. Briefly, RDF is a language for expressing data models using statements expressed as triples. Each statement is composed of a subject, a predicate, and an object. RDF adds several important concepts that make these models much more precise and robust. These additions play an important role in removing ambiguity when transmitting semantic data between machines that may have no other knowledge of one another. I find RDF very useful for integrating streams of related data.
In this post I will discuss the many ways RDF can be represented or serialized.
RDF serialization is the standard way to represent and share semantic data. There are 5 serializations formats.
- N-Triples, the simplest of notations;
- N3, a compaction of the N-Triple format;
- Turtle – subset of N3. Unlike full N3, which has an expressive power that goes much beyond RDF, Turtle can only serialize valid RDF graphs
- RDF/XML, one of the most frequently used serialization formats
- RDF in attributes (known as RDFa), which can be embedded in other serialization formats such as XHTML.
Example of Serialization using N3
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix semperp: <http://semprog.com/people/>.
@prefix tobes: <http://atiru.com/atiru.rdf#>.
atiru:ts a foaf:Person;
[ a foaf:Person;
foaf:name “Jon Foo”];
foaf:name “Ananth Tiru”;
Triplestores are Database Management Systems (DBMS) for data modeled using RDF. Triplestores can be broadly classified in three types categories: Native triplestores, RDBMS-backed triplestores and NoSQL triplestores.
Native triplestores are those that are implemented from scratch and exploit the RDF data model to efficiently store and access the RDF data. Examples of these include: 4Store, AllegroGraph, BigData, Jena TDB, Sesame, Stardog, OWLIM and uRiKa.
RDBMS-backed triplestores are built by adding an RDF specific layer to an existing RDBMS. Examples of these include : Jena SDB, IBM DB2, Oracle Database with Spatial and Graph option turned on and Virtuoso.
NoSQL triplestore are build on top of so called NoSQL databases which includes key-store, document databases. Example includes Oracle NoSQL database.