This document defines the model-theoretic semantics of Notation3 Logic based on its abstract syntax.

Status of this document

This document is one of 3 documents produced by the W3C N3 Community Group:
  1. Notation3 Language
  2. Notation3 Builtin Functions
  3. Notation3 Semantics (this document)

This specification was published by the Notation 3 (N3) Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.

GitHub Issues are preferred for discussion of this specification. Alternatively, you can send comments to our mailing list. Please send them to (subscribe, archives).


This document defines the model-theoretic semantics of Notation3 Logic. We define the semantics of Notation3 (N3) on an abstract syntax. We will provide the mapping from explicit N3 Syntax to abstract syntax in an extra document. By doing so we separate the handling of implicit quantification from the model.

N3 is an extension of RDF. We use the following concepts from the [[[RDF11-CONCEPTS]]]: IRI, RDF triple, RDF graph, subject, predicate, object, node, blank node, and literal.

Abstract syntax

In this section we define N3's abstract syntax. As N3's concrete concrete syntax has proven to leave room for ambiguity — especially implicit quantification has been interpreted in contradicting ways by different reasoners in the past — we decided to introduce an abstract syntax in which aspects like quantification are stated explicitly. If the semantics of implicit quantification needs to be changed by the community group for any reason, this change will thus not affect the semantics, which is based on the abstract syntax, but only the mapping from concrete to abstract syntax.


Notation3 supports implicit quantification. When blank nodes are used in triples, they implicitly stand for existentially quantified variables. When universals (i.e., variables starting with a question mark in the concrete syntax) are used, they implicitly stand for universally quantified variables. Implicit universal quantification is always global; that is, implicit universal quantification always spans over the full graph. Implicit existential quantification is always local; that is, it spans the local graph (i.e., if implicit existential quantification occurs in a graph term, it spans only that graph term). To simplify the definitions in this document, we assume all quantification to be explicit and introduce an abstract syntax to better express that.

In order to help the reader to make a connection between Notation3 concrete syntax and abstract syntax, we will provide example translations together with the concepts we introduce. We will provide a formal definition of the mapping in a separate document.

Terms, Triples and Graphs

As in the concrete syntax, abstract graphs consist of triples of terms. N3 covers all terms present in RDF, that is, literals, IRIs and blank nodes. Additionally, we can have universals in N3. As the abstract syntax supports direct quantification, we represent blank nodes and universals as variables and add their intended quantification separately (see N3 graph). We thus come to the following concept of atomic terms.

The set of atomic terms consists of:

N3 additionally supports the use of graphs as direct triple elements and treats lists as first-class-citizens. We therefore have an extended concept of terms:

A term can be

In this specification we follow the original terminology of Notation3 Logic used in the team submission where a sequence of terms is called a list. An N3 list is very similar to an RDF-collection with the difference that N3 treats lists as special terms in the language and not only as syntactic sugar. In this and its related documents created by the N3 group, we will sometimes also use the term N3 collection or just collection for N3 lists. These terms should be understood as synonyms.

Terms form triples:

A triple is made of

In contrast to RDF, N3 allows all kinds of terms in all positions of a triple. The triple :s _:x :o. is valid in N3. Even lists or graph terms can appear in the predicate position of a triple.
In the abstract N3 syntax, the concept of an unordered set of triples (an RDF graph) is extended by explicit information about quantification. In other words, we specify for each N3 graph which variables are universally and which are existentially quantified on that graph. To do so, we define:

A graph is a tuple $(U, E, F)$ where

A graph $G=(U, E, F)$ is finite if the sets $U$, $E$ and $F$ are finite.

As we will see in the semantics section below, the sets $U$ and $E$ act like quantifiers with variables for the graph and its subgraphs. We therefore call these sets also quantification sets.

To provide some intuition on the correspondence between concrete N3 syntax and abstract N3 syntax, we provide some examples below. We always write a graph in concrete N3 syntax followed by its counterpart in abstract N3 syntax.

In order to improve readability, we will omit the inner graph parentheses ("()") for all graph terms here and in the remainder of the document. That is, for example, we will write
$\qquad <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>$
instead of
$\qquad <(\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\})>$.
  1. :socrates :knows _:x.
    $(\{\},\{x\},\{(\text{:socrates}, \text{:knows}, x)\})$
  2. {?x a :Human} => {?x a :Mortal}.
    $(\{x\},\{\},\{(<\{\},\{\},\{(x, \text{rdf:type}, \text{:Human})\}>, \text{log:implies}, <\{\},\{\},\{(x, \text{rdf:type}, \text{:Mortal})\}>\})$
  3. :socrates :says {_:x a :Mortal}.
    $(\{\},\{\},\{(\text{:socrates}, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>) \})$
  4. :socrates :says {_:x a :Mortal}. _:y :knows :socrates.
    $(\{\},\{y\},\{(\text{:socrates}, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>), (y, \text{:knows}, \text{:socrates}) \})$
  5. {?x a :Human} => {?x :hasMother _:y}.
    $(\{x\},\{\},\{(<\{\},\{\},\{(x, \text{rdf:type}, \text{:Human})\}>, \text{log:implies}, <\{\},\{y\},\{(x, \text{:hasMother}, y)\}>)\})$
  6. _:y :says {?x a :Mortal}.
    $(\{x\},\{y\},\{(y, \text{:says}, <\{\},\{\},\{(x, \text{rdf:type}, \text{:Mortal})\}>)$

We will re-use these examples in the following sections.

In this context, an RDF graph is a graph that does not contain graph terms nor lists, does not have literals as subjects or predicates, does not have variables as predicates, and for which $U=\emptyset$. The blank nodes occurring in the graph would be labeled and stored in $E$.
The translation of nested blank nodes as explained here and for example applied in Example 3 follows the latest consensus of the community group. Some implementations apply a different interpretation of the scope of blank nodes occurring in non-logical graph terms, that is, graph terms which are not used in connection with logical predicates. More concretely, that means that the concrete triple
:socrates :says {_:x a :Mortal}.
is interpreted by some implementations as
$\qquad (\{\},\{x\},\{(\text{:socrates}, \text{:says}, <\{\},\{\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>) \})$
and not as
$(\{\},\{\},\{(\text{:socrates}, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>) \})$.
A solution for that problem is currently being discussed. The difference, however, does not influence the formal semantics of the abstract syntax, as quantification is always explicit there.


As N3 supports graph terms and thereby also allows for nesting of variables and their quantification, we need to introduce a distinction between variables occurring directly in a graph and variables which are nested. In order to do so, we introduce the following concept: In order to clarify the definition above, we go back to an earlier example (point 3):

Note that the definition makes a difference between graphs and graph terms. A graph term is a direct constituent of the graph ("containing graph") in which it occurs as a triple component. However, the direct constituents of the graph term's graph, and their direct constituents (and so on), are not direct constituents of the containing graph. Rather, they are constituents of the containing graph. This difference is crucial for the definitions below: a graph is not the same as a graph term.

With that definition, we now introduce free variables: these are variables which occur directly or nested in the graph but which are not covered by a quantification set.

The set of free variables ($FV$) of a term or a set of triples is defined as follows: The set $FV$ for a graph $G=(U,E,F)$ and a variable $v\in V\cap C(G)$:


  1. In $(\{x\},\{y\},\{(x, \text{:knows}, y) \})$ all variables are scoped.
  2. In $(\{\},\{y\},\{(x, \text{:knows}, y) \})$ the variable $x$ is free while $y$ is scoped.
  3. In $(\{\},\{\},\{(y, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>) \})$, the variable $x$ is scoped while the variable $y$ is free.

This enables us to introduce the notion of closed graphs and ground terms.

We denote the set of ground terms as $T_G$.

A triple is ground if all of its direct constituents are ground.

A graph $G=(U,E,F)$ is ground if $E=U=\emptyset$ and all triples in $F$ are ground.

An abstract N3 graph which is constructed from a graph in the direct N3 syntax cannot contain free variables. However, when considering a specific graph term in isolation, all variables that are quantified outside that graph term will appear to be free in that graph term.
For instance, the following N3 concrete syntax:
    `_:y :says { ?x :knows :bob }.`
corresponds to
$\qquad (\{x\}, \{y\}, \{( \text{:y}, \text{:says}, <\{\},\{\},\{(x, \text{:knows}, \text{:bob})\}>)\})$
When considering the graph term's graph in isolation:
    `({},{},{(x, :knows, :bob)})`
the variable $x$ will be a free variable (as it was quantified in the containing N3 graph).

An abstract graph $G=(U,E,F)$ can also contain quantified variables $v\in U\cup E$ which do not occur in any triple of $F$. These variables do not contribute to the interpretation of the graph. In order to simplify our considerations for the following sections, we introduce the notion of normalised graphs:

For each graph $G=(U,E,F)$, we call $G^N=(U\cap (FV(F)), E\cap(FV(F)), F)$ the normalisation of $G$.

  1. $(\{x,z\},\{y\},\{(x, \text{:knows}, y) \})^N=(\{x\},\{y\},\{(x, \text{:knows}, y) \})$.
  2. $(\{x_1, x_2, x_3\},\{y_1, y_2, y_3\},\{(\text{:socrates}, \text{:knows}, \text{:plato}) \})^N=(\{\},\{\},\{(\text{:socrates}, \text{:knows}, \text{:plato}) \})$.
  3. $(\{x\},\{y\},\{(y, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>) \})^N=$
    $(\{\},\{y\},\{(y, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>) \})$


We would like to define our semantics in a way which assigns the same meaning for structurally identical graphs, i.e., graphs which only differ in the naming of the variables they use. To enable this, we first introduce the concept of combined mappings which will be relevant to handling nested graphs with local scoping.

For two mappings $M$ and $N$ from terms to terms, we define their combination as follows:

Informally speaking, this definition means that the second $N$ mapping "overrides" the first $M$ mapping whenever a term is in the domain of $N$.

In this document, combinations will mainly be used to handle nested scoped variables. It is therefore no coincidence that this "overriding" behavior is very similar to how quantifiers behave in first order logic: when the same variable is quantified at different levels, the left-most quantifier is overridden by the right-most one.

With combinations of mappings we can define isomorphisms between abstract N3 graphs:

Let $M$ be a bijection between the variables of $V$, we define:

We call a graph $G_1$ isomorphic to a graph $G_2$, written as $G_1\simeq G_2$, if there exists some $M$ such that $G_1$ is isomorphic to $G_2$ under $M$.

If $G_1$ is isomorphic to $G_2$ then $G_2$ is also isomorphic to $G_1$.

Consider the following graphs:

Then $G_1$ is isomorphic to $G_2$:

$x$ as the subject of the first triple is replaced with $M(x)=y$, while $x$ as the subject of the unique triple in the graph term is replaced with $M\bullet P(x) = z$ (P overrides M).

On the other hand, G1 is not isomorphic to G3.

Base Semantics

With the definitions introduced in the previous sections, we are now able to define the semantics of Notation3 Logic. We do that in two steps: we first introduce a base semantics which does not take the meaning of special N3 terms into account. In that sense the base semantics is similar to simple interpretations for RDF. In the next section, we will introduce the log-interpretation which assigns a special meaning to all predicates in the N3 `log`-namespace.

A basic interpretation $I$ is defined by:

This definition is generally "compatible" with RDF simple interpretations, with the following superficial changes:

Note that the images of $Q_I$ are syntactic elements (graph terms), but they can (and most likely will) also be elements of the domain $Δ_I$. Note however that not all interpretations are required to have graph terms in their domain, because $Q_I$ is allowed to be the empty mapping. Such interpretations could still satisfy a graph that has no graph term constituent.

The basic interpretation maps graph terms to an isomorphic copy of themselves. As a consequence, two non-isomorphic graph terms cannot have the same meaning. For the abstract versions of the graph terms {_:x :p :o}, {_:y :p :o} and {_:x :p :o. _:y :p :o}, we thus get:

However, as we will see below, N3 provides mechanisms to unquote graph terms (that is, to transform them into graphs), and to compare them based on the meaning of the formulae they quote.

Ground graphs

We extend the previous definition to interpret ground graphs:

Given $I$ a basic interpretation, we recursively define $I(x) =$

The definition implies that the empty graph is always true and that the empty list is always mapped to itself.

Note that the interpretation function $Q_I(x)$ maps ground graphs into the domain of discourse without interpreting their content separately. This choice was made to guarentee referential opacity (see also referential opacity in RDF-star ). To illustrate this idea consider the superman example expressed in N3:

:superman owl:sameAs :clarkKent. :loisLane :believes {:superman :can :fly}.

Even if we assume that our logic is extended by an interpretation for owl:sameAs which assures that the function $D_I$ maps the IRIs :superman and :clarkKent to the same resource, it should still not yield the following conclusion:

:loisLane :believes {:clarkKent :can :fly}.

Graphs with variables

In order to introduce the interpretation of graphs containing variables, we rely on a few additional definitions. To better understand the need for these, consider the following example:

?x :says {?x :is :wise}.

which freely translates to everyone says about themselves that they are wise. In abstract syntax, the formula would be expressed as:

$G = (\{x\}, \{\}, \{(x, \text{:says}, <\{\}, \{\}, \{(x, \text{:is}, \text{:wise})\}>)\})$.

This formula is interesting because the universally quantified variable appears once as a direct constituent in the triple and once as only a constituent. If we replace the variable $x$ by, for example :bob, we get:

$G_{bob} = (\{\}, \{\}, \{(\text{:bob}, \text{:says}, <\{\}, \{\}, \{(\text{:bob}, \text{:is}, \text{:wise})\}>)\})$

The semantics for ground graphs maps IRIs to not further specified domain elements, while ground graph terms are mapped to an isomorphic version of themselves. The interpretation of the above example $I(G_{bob})$ will be true if $(D_I(\text{:bob}), D_I(\text{:says}), Q_I(<\{\}, \{\}, \{(\text{:bob}, \text{:is}, \text{:wise})\}>)\in EXT_I$.

If we revert back to our original example with variables, a regular valuation function (such as the mapping A used for blank nodes in [[RDF11-MT]]) will simply replace both occurrences of variable $x$ with a domain element $\delta_i$ from $\Delta_I$. In that case, $Q_I$ will have to map the graph term $<\{\}, \{\}, \{(\delta_i, \text{:is}, \text{:wise})\}>$ to an isomorphic copy. However, the isomorphism is only defined for concrete N3 terms, and not domain elements. If not applying the valuation function to the graph term, $Q_I$ will have to map the graph term $<\{\}, \{\}, \{(x, \text{:is}, \text{:wise})\}>$, which is however no longer ground as its graph is no longer closed ($x$ is quantified outside of the graph). In our basic interpretation, the mapping $Q_I$ is only defined for ground graph terms. We thus need to first ground these kinds of leaked variables, i.e., variables that become free when considering the graph term in isolation (as is required when determining isomorphisms).

We need to extend RDF's classical semantic condition for blank nodes and use a so-called assignment, which, instead of simply mapping variables to resources, maps variables to pairs of resources and term representations:

Given a basic interpretation $I$ and a set of variables $V_1$. We call a mapping $A$ from $V_1$ to $Δ_I\times T_G$ such that $A(v)=(A_1(v),A_2(v))$ and $I(A_2(v))=A_1(v)$ an assignment for $V_1$.

We can consider both values $A_1$ and $A_2$ of an assignment $A(v)=(A_1(v), A_2(v))$ as separate mappings. The mapping $A_2$ assigns variables to terms, and will be used to ground free variables within graph terms. Note that given an interpretation $I$ and two assignments $A$ for a set $V_1$, and $B$ for a set $V_2$ of variables, the combination $A\bullet B$ is again an assignment for $V_1\cup V_2$.

In order to apply mapping $A_2$ on graphs, we introduce the notion of total application.

Let $G=(U,E,F)$ be a graph and let $M$ be a mapping from a set of variables $V$ into a set $S$. A total application $M^t(G)$ of $M$ is defined as follows:

$M^t(G) = (U, E, \{ (M^t(s), M^t(p), M^t(o)) | \; (s, p, o) \in F \})$ such that:

The total application replaces all free variables occurring directly or nested in a graph by the value of function $M$. As an example, consider the example below, and let $M:\{x,y\}\rightarrow S$ be a mapping such that $M(x)=tom$ and $M(y)=mary$, then we get:

$M^t($$<\{\},\{y\},\{(x, \text{:hasMother}, y)\}>$$)$ $=$$<\{\},\{y\},\{(tom, \text{:hasMother}, y)\}>$

Variable $x$ is replaced by $M(x)$ as it is a free variable, while $y$ does not get replaced since it is scoped (i.e., quantified in the nested graph). This results in a ground graph term, which can be mapped by $Q_I$.

The definition of total applications enables us to define interpretations with assignment:

For a closed graph $G=(U,E,F)$, a basic interpretation $I$ and an assignment $A$ on the set of variables $U\cup E$, we define $I[A](x)$ as:

For a closed graph $G=(U, E, F)$ and a basic interpretation $I$, we say $I(G)=\textit{true}$ or interpretation $I$ satifies $G$, if for all assignments $A$ for $U$ (universal variables) there exist an assignment $B$ for $E$ (existential variables) such that $I[A\bullet B](F)=\textit{true}$. We also write that as $I\models G$.

Note that the interpretation of a variable $x$ depends on its position in a graph. In the expression $(\emptyset, \emptyset,\{(x, \text{:p}, <\emptyset, \emptyset, \{(x, \text{:q}, \text{:r})\}>)\})$, the first $x$ is interpreted as $A_1(x)$ while the second is interpreted as $A_2(x)$. The connection between these two values is established by the condition that $I(A_2(v))=A_1(v)$.

For instance:

$I(\{x\}, \{\}, \{(x, \text{:says}, < \{\}, \{\}, \{( x, \text{:is}, \text{:wise} )\} >)\})$

will be true if for all assignments $A:\{x\}\rightarrow Δ_I\times T_G$, the following is true:

$I(\{(A_1(x), \text{:says}, < \{\}, \{\}, \{ (A_2(x), \text{:is}, \text{:wise}) \} >)$

For assignments and free variables we define:

Let $G=(U,E,F)$ be a graph. We say that $G$ is true under the interpretation $I$ and the assignment $A$ if $I[A]\models G$. That is, for each assignment $A^1$ for the variables in $U$ there exists an assignment $B^1$ for the variables in $E$ such that $I[A\bullet A^1\bullet B^1](F)=true$.

This last definition handles all variables occurring freely in a graph as universally quantified.

Basic entailment

The previous definition allows us to introduce the notion of basic entailment:

Let $G$ and $H$ be two graphs, we say that $G$ b-entails $H$, noted $G ⊨ H$, if and only if every interpretation $I$ that satisfies $G$ $(I ⊨ G)$ also satisfies $H$ $(I ⊨ H)$.

In order to illustrate the properties of basic entailment, we give a few examples:

Entailment: Non-entailment: As these last examples of non-entailment show, basic interpretations only cover N3-constants and variables. The meaning of special predicates like for example the implication (written as log:implies or as a short-cut =>) is covered through an addition: log-interpretations which we introduce in the following section.

Log Semantics

This section defines an extension of base semantics providing the specific meaning of (some of) the builtins in the N3-logic namespace, short `log:` namespace.

For the definitions below, we assume that the set of literals $L$ contains the two boolean literals `true` and `false`. The literal `true` stands for the graph term $<\emptyset, \emptyset, \emptyset>$.

The set of logical predicates $LP$ contains the predicate `log:implies`.

The list of predicates in LP is planned to be extended by more predicates. The goal here is to cover all (or at least most of) the predicates in the `log:` namespace. For the other namespaces we plan to provide similar definitions.

Below, we give specify how log interpretations extend basic interpretations:

Let $I$ be a basic interpretation for a graph $G=(U, E, F)$. Then $G$ is true under log-interpretation or $I$ log satisfies $G$ ($I\models_{log} G$) if for each assignment $A$ for $U$ there exists an assignment $B$ for $E$ such that:

We define the meaning of $I[A\bullet B]\models_{log}(s,p,o)$ depending on the concrete $p\in LP$ below.

Note that if there are no logical predicates used in a graph, then the log-interpretation coincides with the basic interpretation. We call a graph $G=(U, E, F)$ log-free, if $p\not\in LP$ for all triples $(s,p,o)\in F$. All log-free graphs which are true under the basic interpretation are thus also true under log-interpretation.

Constraints for `log:implies`

The aim of the predicate log:implies is to provide a form of logical implication. This interpretation acts on the ground terms which are true under basic interpretations.

If $t = (s, \text{log:implies}, o )$ is a triple, then $I[A\bullet B]\models_{log} t$ if:

The first bullet of the above definition clarifies how implications with graph terms $< G_1>$ and $<G_2>$ in subject and object position are interpreted. Note that under the simple interpretation these graph terms are ground, that is, $I[A\bullet B](G_1)$ and $I[A\bullet B](G_2)$ are closed graphs. To determine the meaning of the implications these closed graphs are further interpreted using $I[A\bullet B]$ as an interpretation. The log-interpretation thus interprets the basic interpretation of a graph term.

The second bullet covers implications with the boolean literal false in the consequence. In log-semantics this literal is understood as truth constant "false" (or $\bot$). Note that the interpretation process here consists of two steps: we first consider the basic interpretation of the implication triple which needs to be true and then we test whether - using the same interpretation as a log interpretation - the premise is false. However, the mere fact that a closed graph $G_1$ is false under an interpretation $I$ ($I\not\models_{log} G_1$), does not allow us to conclude that $I\models_{log} (\{\}, \{\}, \{ (< G_1>, \text{log:implies}, \text{false})\})$.

The last bullet ensures that the truth value of triples having log:implies in predicate position but no graph term or truth value in subject or object position like for example :socrates log:implies :plato. is only determined by the basic interpretation of the triple. That is, log:implies only has a special meaning when used with graph terms and/or truth values.

Log entailment

The previous definitions allow us to introduce the notion of log entailment:

Let $G$ and $H$ be two graphs, we say that $G$ log-entails $H$, written as $G ⊨_{log} H$, if and only if every interpretation $I$ that log satisfies $G$ ($I ⊨_{log} G$) also log satisfies $H$ ($I ⊨_{log} H$).

To illustrate the definition, we discuss some examples of entailment and non-entailment in the sections below.

(Non-) Entailment of implications

For the log predicate log:implies we observe the following examples of log entailment:
  • $ (\{\},\{\},\{ \\ \qquad (\text{:socrates}, \text{rdf:type}, \text{:Human}), \\ \qquad (<\{\},\{\},\{ (\text{:socrates}, \text{rdf:type}, \text{:Human})\}>, \\ \qquad\ \ \text{log:implies}, \\ \qquad\ \ <\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:Mortal})\}>) \\ \})$
    – in concrete syntax: :socrates a :Human.
    {:socrates a :Human} => {:socrates a :Mortal}.

    $(\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:Mortal})\})$
    – in concrete syntax: :socrates a :Mortal.
  • $(\{x\},\{\},\{ \\ \qquad (\text{:socrates}, \text{rdf:type}, \text{:Human}), \\ \qquad (<\{\},\{\},\{(x, \text{rdf:type}, \text{:Human})\}>, \text{log:implies}, <\{\},\{\},\{(x, \text{rdf:type}, \text{:Mortal})\}>) \\ \})$
    – in concrete syntax: :socrates a :Human. {?x a :Human} => {?x a :Mortal}.
    $(\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:Mortal})\})$
    – in concrete syntax: :socrates a :Mortal.
  • $(\{\},\{\},\{( \\ \qquad (\text{:socrates}, \text{rdf:type}, \text{:Human}), \\ \qquad <\{\},\{x\},\{(x, \text{rdf:type}, \text{:Human})\}>, \text{log:implies}, <\{\},\{x\},\{(x, \text{rdf:type}, \text{:Mortal})\}>)\\ \})$
    – in concrete syntax: :socrates a :Human. {_:x a :Human} => {_:x a :Mortal}.
    $(\{\},\{x\},\{(x, \text{rdf:type}, \text{:Mortal})\})$
    – in concrete syntax: _:x a :Mortal.
  • $ (\{x\},\{\},\{ \\ \qquad (\text{:socrates}, \text{:says}, <\{\},\{\},\{(\text{:socrates},\text{rdf:type}, \text{:Mortal} )\}>), \\ \qquad (<\{\},\{\},\{(x, \text{:says}, <\{\},\{\},\{(x,\text{rdf:type}, \text{:Mortal})\}>)\}>, \\ \qquad\ \ \text{log:implies}, \\ \qquad\ \ <\{\},\{\},\{(x,\text{rdf:type}, \text{:WisePerson})\}>) \\ \})$
    – in concrete syntax: :socrates :says {:socrates a :Mortal}.
    {?x :says {?x a :Mortal}}=>{?x a :WisePerson}

    $(\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:WisePerson} \})$
    – in concrete syntax: :socrates a :WisePerson.
Examples for non-entailment:
  • $(\{\},\{\},\{(\text{:socrates} , \text{rdf:type}, \text{:Human}), (\text{:socrates}, \text{rdf:type}, \text{:Mortal})\})$
    – in concrete syntax: :socrates a :Human. :socrates a :Mortal.
    does not log-entail
    $ (\{\},\{\},\{( \\ \qquad <\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:Human})\}>, \\ \qquad \text{log:implies}, \\ \qquad <\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:Mortal})\}> \\ )\})$
    – in concrete syntax: {:socrates a :Human} => {:socrates a :Mortal}.
  • $ (\{\},\{\},\{\\ \qquad (\text{:socrates}, \text{:says}, <\{\},\{\},\{(\text{:socrates},\text{rdf:type}, \text{:Mortal} )\}>), \\ \qquad (<\{\},\{\},\{(\text{:socrates}, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal})\}>)\}>, \\ \qquad\ \ \text{log:implies}, \\ \qquad\ \ <\{\},\{\},\{(\text{:socrates},\text{rdf:type}, \text{:WisePerson} )\}>) \\ \})$
    – in concrete syntax: :socrates :says {:socrates a :Mortal}.
    {:socrates :says {_:x a :Mortal}}=>{:socrates a :WisePerson}
    does not log-entail
    $(\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:WisePerson} \})$
    – in concrete syntax: :socrates a :WisePerson.
  • $ (\{y\},\{\},\{ \\ \qquad (\text{:socrates}, \text{:says}, <\{\},\{x\},\{(x,\text{rdf:type}, \text{:Mortal} )\}>), \\ \qquad (<\{\},\{\},\{(\text{:socrates}, \text{:says}, <\{\},\{\},\{(y,\text{rdf:type}, \text{:Mortal})\}>)\}>, \\ \qquad\ \ \text{log:implies}, \\ \qquad\ \ <\{\},\{\},\{(\text{:socrates},\text{rdf:type}, \text{:WisePerson} )\}>) \\ \})$
    – in concrete syntax: :socrates :says {_:x a :Mortal}.
    {:socrates :says {?y a :Mortal}}=>{:socrates a :WisePerson}
    does not log-entail
    $(\{\},\{\},\{(\text{:socrates}, \text{rdf:type}, \text{:WisePerson} \})$
    – in concrete syntax: :socrates a :WisePerson.

As above, these examples follow the last agreement on the interpretation of N3 concrete syntax which might be implemented differently in some reasoners. The difference does not effect the meaning of abstract formulas. The community group is currently working on a solution for this problem.


A special form of entailment enabled by our semantics is the so-called unquoting. By that, we mean the entailment which enables us to make the graph contained in a graph term true. To illustrate the idea, we give an example.

Let's assume that simon says that birds can fly. In abstract N3, we can express that as:

$(\{\},\{\},\{(\text{:simon}, \text{:says}, <\{\},\{\},\{(\text{:birds},\text{:can}, \text{:fly} )\}>) \})$
– in concrete syntax: simon :says {:birds :can :fly}.

In N3 we can write a rule stating that everything Simon says is true. We do that as follows:

$(\{x\},\{\},\{(<\{\},\{\},\{(\text{:simon}, \text{:says}, x)\}>, \text{log:implies}, x\})$
– in concrete syntax: {:simon :says ?x}=>?x

From this last rule we can derive via b-entailment:

$ (\{\},\{\},\{(<\{\},\{\},\{( \\ \qquad \text{:simon}, \text{:says}, <\{\},\{\},\{(\text{:birds},\text{:can}, \text{:fly} )\}>)\}>, \\ \qquad \text{log:implies}, \\ \qquad <\{\},\{\},\{(\text{:birds},\text{:can}, \text{:fly} )\}> \\ )\}) $
– in concrete syntax: {:simon :says {:birds :can :fly}}=>{:bird :can :fly}.

Via log-entailment we get:

$(\{\},\{\},\{(\text{:birds},\text{:can}, \text{:fly} )\})$
– in concrete syntax: :birds :can :fly.

The example above showed us the basic idea of unquoting. The feature is supported by N3 semantics using the two step-interpretation. The b-interpretation treats the universally quantified variable in premise and conclusion of the rule as terms. We can replace the variable by graph terms if these (or graphs isomorphic to these) form part of $\Delta_I$ (which needs to be the case if $I$ is an interpretation of the first triple of this example). The log-interpretation now interprets these terms which allows us to come to our conclusion.