Notation3 (commonly abbreviated as N3) is a shorthand, non-XML serialization format for Resource Description Framework (RDF) models, designed with human readability as a primary goal. It was developed by Tim Berners-Lee and others within the Semantic Web community, with significant contributions from Dan Connolly. The format is more compact and readable than the XML-based RDF notation.
Overview
Notation3 serves as a serialization syntax for RDF data, which is a standard model for describing resources on the World Wide Web. Unlike RDF/XML, which uses verbose XML markup, N3 uses a compact textual syntax that is easier for humans to read and write. The format is a superset of RDF, meaning it can express everything that RDF can, while also offering additional expressive features.
Technical Specifications
- Filename extension:
.n3 - Internet media type:
text/n3;charset=utf-8 - Developed by: Tim Berners-Lee
- Type of format: Semantic web
- Container for: RDF data
- Standard reference: W3C Team Submission (2011)
Features Beyond RDF Serialization
N3 includes several capabilities that extend beyond simple RDF serialization, most notably support for RDF-based rules and logical reasoning. These features allow N3 to function not only as a data format but also as a logic language. Key extensions include:
- Logical implications (
=>and<=operators) for expressing rules - Equivalence (
=) for stating that two resources are equivalent - Quantification via
@forAlland@forSomedirectives - Statement lists using
{ ... }notation - RDF paths as syntactic sugar
Relationship to Other Formats
Notation3 is closely related to several other RDF serialization formats:
- Turtle is a simplified, RDF-only subset of N3. It was defined by Dave Beckett and is a superset of the minimal N-Triples format. Unlike full N3, Turtle can only serialize valid RDF graphs and does not include the logic-oriented extensions.
- N-Triples is a minimal, line-based format that represents each RDF triple on a single line. It is a subset of both Turtle and N3.
Example
The following RDF model in XML notation:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="https://en.wikipedia.org/wiki/Tony_Benn">
<dc:title>Tony Benn</dc:title>
<dc:publisher>Wikipedia</dc:publisher>
</rdf:Description>
</rdf:RDF>
may be written in Notation3 as:
@prefix dc: <http://purl.org/dc/elements/1.1/>.
<https://en.wikipedia.org/wiki/Tony_Benn>
dc:title "Tony Benn";
dc:publisher "Wikipedia".
Standardization
Notation3 was submitted to the World Wide Web Consortium (W3C) as a Team Submission titled "Notation3 (N3): A readable RDF syntax" in 2011. A formalization of the logic underlying N3, known as N3Logic, was published by Berners-Lee, Connolly, Kagal, Scharf, and Hendler in 2008 in the journal Theory and Practice of Logic Programming.
Applications
N3 is used in Semantic Web applications that require reasoning capabilities beyond simple data serialization. It is supported by various tools and reasoners, including the EYE (Euler Yet another proof Engine) reasoner and EulerGUI, an integrated development environment for N3. The format is also used in educational contexts for introducing RDF and Semantic Web concepts due to its readability.