Notation3
Template:Short description Script error: No such module "Infobox".Template:Template otherScript error: No such module "Check for unknown parameters".
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.[1]
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:
<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 like this:
@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
Script error: No such module "Unsubst".
| Feature | Notation3 | Turtle | N-Triples | |
|---|---|---|---|---|
| colspan="2" Template:Rh2 | Character encoding | UTF-8 | Template:Safe | ||
| scope="row" rowspan="5" Template:Rh2 | Directives | @base |
Template:Ya | Template:Ya | Template:Na |
@forAll |
Template:Ya | Template:Na | Template:Na | |
@forSome |
Template:Ya | Template:Na | Template:Na | |
@keywords |
Template:Ya | Template:Na | Template:Na | |
@prefix |
Template:Ya | Template:Ya | Template:Na | |
| scope="row" rowspan="3" Template:Rh2 | Lists | ||||
() (DAML lists)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
{ … } (statement lists)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Na | Template:Na | |
| scope="row" rowspan="4" Template:Rh2 | Literals | true / false(Boolean)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na |
xsd:decimal (decimal arbitrary length)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
xsd:double (decimal double)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
xsd:integer (decimal integer)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
| scope="row" rowspan="9" Template:Rh2 | Syntactic sugar | RDF paths | Template:Ya | Template:Na | Template:Na |
| QNames | Template:Ya | Template:Ya | Template:Na | |
a/@a (equiv. to rdf:type)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
[] (shorthand for blank node)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
=> (x implies y)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Na | Template:Na | |
<= (y implies x)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Na | Template:Na | |
= (x is equivalent to y)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Na | Template:Na | |
, (repeat object in list)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
; (repeat subject/verb in list)Script error: No such module "Check for unknown parameters". |
Template:Ya | Template:Ya | Template:Na | |
See also
External links
- Notation 3 W3C Submission
- Notation 3 Outline on W3C Design Issues by Tim Berners-Lee
- Notation 3 Primer: Getting into RDF & Semantic Web using N3
- A Rough Guide to Notation3
- RDF for "Little Languages"
- An editing mode of N3 for Emacs
- An editing mode of N3 for vim
- An editing mode of N3 for textmate
- An editing mode of N3 for gedit
- EulerGUI, an IDE centered on N3 editor with translation from RDF, with validation, prefix management, uploading of resources, graph view, table view, etc.
References
<templatestyles src="Reflist/styles.css" />
- ↑ Script error: No such module "Citation/CS1".
Script error: No such module "Check for unknown parameters".Template:Semantic Web