Notation3
Compact non-XML format for RDF models
title: "Notation3" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["resource-description-framework", "computer-file-formats"] description: "Compact non-XML format for RDF models" topic_path: "general/resource-description-framework" source: "https://en.wikipedia.org/wiki/Notation3" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Compact non-XML format for RDF models ::
::data[format=table title="Infobox file format"]
| Field | Value |
|---|---|
| name | Notation3 |
| icon_size | 100px |
| extension | .n3 |
| mime | text/n3;charset=utf-8 |
| owner | Tim Berners-Lee |
| genre | semantic web |
| container for | RDF data |
| standard | n3 |
| url | |
| :: |
| name = Notation3 | icon = | icon_size = 100px | logo = | extension = .n3 | mime = text/n3;charset=utf-8 | type code = | uniform type = | magic = | owner = Tim Berners-Lee | genre = semantic web | container for = RDF data | extended from = | extended to = | standard = n3 | url =
Notation3, or N3 as it is more commonly known, is a shorthand non-XML serialization of Resource Description Framework models, designed with human-readability in mind: N3 is much more compact and readable than XML RDF notation. The format is being developed by Tim Berners-Lee and others from the Semantic Web community. A formalization of the logic underlying N3 was published by Berners-Lee and others in 2008.
N3 has several features that go beyond a serialization for RDF models, such as support for RDF-based rules. Turtle is a simplified, RDF-only subset of N3.
Examples
The following is an RDF model in standard XML notation:
::code[lang=xml] <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:titleTony Benn</dc:title> dc:publisherWikipedia</dc:publisher> </rdf:Description> </rdf:RDF> ::
may be written in Notation3 like this:
::code[lang=turtle] @prefix dc: http://purl.org/dc/elements/1.1/.
https://en.wikipedia.org/wiki/Tony_Benn dc:title "Tony Benn"; dc:publisher "Wikipedia". ::
This N3 code above would also be in valid Turtle syntax.
Comparison of Notation3, Turtle, and N-Triples
::data[format=table]
| Feature | Notation3 | Turtle | N-Triples | align=right}} | Character encoding | align=right}} | Directives | align=right}} | Lists | align=right}} | Literals | align=right}} | Syntactic sugar |
|---|---|---|---|---|---|---|---|---|
| UTF-8 | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| (DAML lists) | | | | | | | | |
| } (statement lists) | | | | | | | | |
| /
(Boolean) | | | | | | | | |
|
(decimal arbitrary length) | | | | | | | | |
|
(decimal double) | | | | | | | | |
|
(decimal integer) | | | | | | | | |
| RDF paths | | | | | | | | |
| QNames | | | | | | | | |
| / (equiv. to ) | | | | | | | | |
| (shorthand for blank node) | | | | | | | | |
| (x implies y) | | | | | | | | |
| (y implies x) | | | | | | | | |
| (x is equivalent to y) | | | | | | | | |
| (repeat object in list) | | | | | | | | |
| (repeat subject/verb in list) | | | | | | | | |
::
References
References
- (2008). "N3Logic: A logical framework for the World Wide Web". Theory and Practice of Logic Programming.
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::