Notation3

Last updated
Notation3
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 n3
Website www.w3.org/TeamSubmission/n3/

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]

Contents

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:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Descriptionrdf: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:

@prefixdc:<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

FeatureNotation3TurtleN-Triples
Character encoding UTF-8 ASCII
Directives@baseGreen check.svgGreen check.svgDark Red x.svg
@forAllGreen check.svgDark Red x.svgDark Red x.svg
@forSomeGreen check.svgDark Red x.svgDark Red x.svg
@keywordsGreen check.svgDark Red x.svgDark Red x.svg
@prefixGreen check.svgGreen check.svgDark Red x.svg
Lists
()(DAML lists)Green check.svgGreen check.svgDark Red x.svg
<nowiki>{ … }</nowiki>(statement lists)Green check.svgDark Red x.svgDark Red x.svg
Literals true / false
(Boolean)
Green check.svgGreen check.svgDark Red x.svg
xsd:decimal
(decimal arbitrary length)
Green check.svgGreen check.svgDark Red x.svg
xsd:double
(decimal double)
Green check.svgGreen check.svgDark Red x.svg
xsd:integer
(decimal integer)
Green check.svgGreen check.svgDark Red x.svg
Syntactic sugar RDF pathsGreen check.svgDark Red x.svgDark Red x.svg
QNames Green check.svgGreen check.svgDark Red x.svg
a/@a(equiv. to rdf:type)Green check.svgGreen check.svgDark Red x.svg
[](shorthand for blank node)Green check.svgGreen check.svgDark Red x.svg
<nowiki>=</nowiki>>(x implies y)Green check.svgDark Red x.svgDark Red x.svg
<<nowiki>=</nowiki>(y implies x)Green check.svgDark Red x.svgDark Red x.svg
<nowiki>=</nowiki>(x is equivalent to y)Green check.svgDark Red x.svgDark Red x.svg
,(repeat object in list)Green check.svgGreen check.svgDark Red x.svg
;(repeat subject/verb in list)Green check.svgGreen check.svgDark Red x.svg

See also

Related Research Articles

The Semantic Web is an extension of the World Wide Web through standards set by the World Wide Web Consortium (W3C). The goal of the Semantic Web is to make Internet data machine-readable.

The Resource Description Framework (RDF) is a family of World Wide Web Consortium (W3C) specifications originally designed as a metadata data model. It has come to be used as a general method for conceptual description or modeling of information that is implemented in web resources, using a variety of syntax notations and data serialization formats. It is also used in knowledge management applications.

The Web Ontology Language (OWL) is a family of knowledge representation languages for authoring ontologies. Ontologies are a formal way to describe taxonomies and classification networks, essentially defining the structure of knowledge for various domains: the nouns representing classes of objects and the verbs representing relations between the objects. Ontologies resemble class hierarchies in object-oriented programming but there are several critical differences. Class hierarchies are meant to represent structures used in source code that evolve fairly slowly whereas ontologies are meant to represent information on the Internet and are expected to be evolving almost constantly. Similarly, ontologies are typically far more flexible as they are meant to represent information on the Internet coming from all sorts of heterogeneous data sources. Class hierarchies on the other hand tend to be fairly static and rely on far less diverse and more structured sources of data such as corporate databases.

XML Linking Language, or XLink, is an XML markup language and W3C specification that provides methods for creating internal and external links within XML documents, and associating metadata with those links.

RDF Schema is a set of classes with certain properties using the RDF extensible knowledge representation data model, providing basic elements for the description of ontologies. It uses various forms of RDF vocabularies, intended to structure RDF resources. RDF and RDFS can be saved in a triplestore, then one can entail some knowledge from them using a query language, like SPARQL.

SPARQL is an RDF query language—that is, a semantic query language for databases—able to retrieve and manipulate data stored in Resource Description Framework (RDF) format. It was made a standard by the RDF Data Access Working Group (DAWG) of the World Wide Web Consortium, and is recognized as one of the key technologies of the semantic web. On 15 January 2008, SPARQL 1.0 was acknowledged by W3C as an official recommendation, and SPARQL 1.1 in March, 2013.

FOAF (ontology)

FOAF is a machine-readable ontology describing persons, their activities and their relations to other people and objects. Anyone can use FOAF to describe themselves. FOAF allows groups of people to describe social networks without the need for a centralised database.

RDFa is a W3C Recommendation that adds a set of attribute-level extensions to HTML, XHTML and various XML-based document types for embedding rich metadata within Web documents. The RDF data-model mapping enables its use for embedding RDF subject-predicate-object expressions within XHTML documents. It also enables the extraction of RDF model triples by compliant user agents.

DOAP is an RDF Schema and XML vocabulary to describe software projects, in particular free and open source software.

Terse RDF Triple Language (Turtle) is a syntax and file format for expressing data in the Resource Description Framework (RDF) data model. Turtle syntax is similar to that of SPARQL, an RDF query language. It is a common data format for storing RDF data, along with N-Triples, JSON-LD and RDF/XML.

Redland is a set of free software libraries written in C that provide support for the Resource Description Framework (RDF), created by Dave Beckett.

Blank node

In RDF, a blank node is a node in an RDF graph representing a resource for which a URI or literal is not given. The resource represented by a blank node is also called an anonymous resource. According to the RDF standard a blank node can only be used as subject or object of an RDF triple.

The Rule Interchange Format (RIF) is a W3C Recommendation. RIF is part of the infrastructure for the semantic web, along with (principally) SPARQL, RDF and OWL. Although originally envisioned by many as a "rules layer" for the semantic web, in reality the design of RIF is based on the observation that there are many "rules languages" in existence, and what is needed is to exchange rules between them.

N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF graphs, and a subset of the Turtle format. N-Triples should not be confused with Notation3 which is a superset of Turtle. N-Triples was primarily developed by Dave Beckett at the University of Bristol and Art Barstow at the World Wide Web Consortium (W3C).

TriG is a serialization format for RDF graphs. It is a plain text format for serializing named graphs and RDF Datasets which offers a compact and readable alternative to the XML-based TriX syntax.

TriX is a serialization format for RDF graphs. It is an XML format for serializing Named Graphs and RDF Datasets which offers a compact and readable alternative to the XML-based RDF/XML syntax. It was jointly created by HP Labs and Nokia.

Named graph

Named graphs are a key concept of Semantic Web architecture in which a set of Resource Description Framework statements are identified using a URI, allowing descriptions to be made of that set of statements such as context, provenance information or other such metadata.

XHTML+RDFa is an extended version of the XHTML markup language for supporting RDF through a collection of attributes and processing rules in the form of well-formed XML documents. XHTML+RDFa is one of the techniques used to develop Semantic Web content by embedding rich semantic markup. Version 1.1 of the language is a superset of XHTML 1.1, integrating the attributes according to RDFa Core 1.1. In other words, it is an RDFa support through XHTML Modularization.

Cwm is a general-purpose data processing software for the Semantic Web, similar to sed or awk for text files or XSLT for XML. It is a forward chaining semantic reasoner that can be used for querying, checking, transforming and filtering information. Its core language is RDF, extended to include rules, it can use RDF/XML or RDF/N3 serializations.

JSON-LD is a method of encoding linked data using JSON. One goal for JSON-LD was to require as little effort as possible from developers to transform their existing JSON to JSON-LD. JSON-LD allows data to be serialized in a way that is similar to traditional JSON. It was initially developed by the JSON for Linking Data Community Group before being transferred to the RDF Working Group for review, improvement, and standardization. JSON-LD is a World Wide Web Consortium Recommendation.

References

  1. Berners-Lee, T. I. M.; Connolly, D. A. N.; Kagal, L.; Scharf, Y.; Hendler, J. I. M. (2008). "N3Logic: A logical framework for the World Wide Web". Theory and Practice of Logic Programming. 8 (3). arXiv: 0711.1533 . doi:10.1017/S1471068407003213.