Jump to Table of Contents Collapse Sidebar

RDF 1.2 Concepts and Abstract Data Model

W3C Candidate Recommendation Snapshot

More details about this document
This version:
https://www.w3.org/TR/2026/CR-rdf12-concepts-20260407/
Latest published version:
https://www.w3.org/TR/rdf12-concepts/
Latest editor's draft:
https://w3c.github.io/rdf-concepts/spec/
History:
https://www.w3.org/standards/history/rdf12-concepts/
Commit history
Test suite:
https://w3c.github.io/rdf-tests/rdf/rdf12/
Implementation report:
https://w3c.github.io/rdf-tests/rdf/rdf12/reports/
Latest Recommendation:
https://www.w3.org/TR/rdf11-concepts
Editors:
Gregg Kellogg (until 2025-09-06), in memoriam
Olaf Hartig
Pierre-Antoine Champin
Andy Seaborne
Former editors:
Richard Cyganiak (RDF 1.1)
David Wood (RDF 1.1, Chair)
Markus Lanthaler (RDF 1.1)
Graham Klyne (RDF 1.0)
Jeremy J. Carroll (RDF 1.0)
Brian McBride (RDF 1.0, Chair)
Feedback:
GitHub w3c/rdf-concepts (pull requests, new issue, open issues)
public-rdf-star-wg@w3.org with subject line [rdf12-concepts] … message topic … (archives)

Abstract

The Resource Description Framework (RDF) is a framework for representing information on the Web. This document defines an abstract data model which serves to link all RDF-based languages and specifications. The abstract data model has two key data structures:

Compared to RDF 1.1, RDF 1.2 introduces the ability to use an RDF triple as a triple term, in the object position of another triple. RDF 1.2 also introduces directional language-tagged strings, which contain a base direction component that allows the initial text direction to be specified for presentation by a user agent. Finally, to ease the transition from RDF 1.1 to RDF 1.2, this specification introduces a mechanism for explicitly conveying the version of RDF that is used by a given piece of data.

This specification introduces key concepts and terminology for RDF 1.2, and subsequently discusses datatyping and the handling of fragment identifiers in IRIs within RDF graphs.

Status of This Document

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C standards and drafts index.

This document is part of the RDF 1.2 document suite. It is the central RDF 1.2 specification and defines the core RDF concepts. Test suites and implementation reports of a number of RDF 1.2 specifications that build on this document are available from the rdf-tests repository under rdf-tests/rdf/rdf12 as referenced in each of the specifications.

RDF 1.2 Concepts (this specification) describes an abstract data model, and does not have an independant test suite, as it is not directly implemented in software. Instead, it is implemented by the specifications which build on top of it. As a consequence, to exit the W3C Candidate Recommendation phase, the W3C RDF & SPARQL Working Group requires that [RDF12-SEMANTICS] and at least one specification for a concrete syntax (e.g. [RDF12-N-TRIPLES]) have met their own exit criteria for the W3C Candidate Recommendation phase.

RDF 1.2 Concepts is an update to [RDF11-CONCEPTS], which was itself, an update to [RDF-CONCEPTS-20040210].

This document was published by the RDF & SPARQL Working Group as a Candidate Recommendation Snapshot using the Recommendation track.

Publication as a Candidate Recommendation does not imply endorsement by W3C and its Members. A Candidate Recommendation Snapshot has received wide review, is intended to gather implementation experience, and has commitments from Working Group members to royalty-free licensing for implementations.

Future updates to this upcoming Recommendation may incorporate new features.

This Candidate Recommendation is not expected to advance to Recommendation any earlier than 05 May 2026.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 18 August 2025 W3C Process Document.

1. Introduction

This section is non-normative.

The Resource Description Framework (RDF) is a framework for representing information on the Web.

This document defines an abstract data model which serves to link all RDF-based languages and specifications, including the following:

1.1 Graph-based Abstract Data Model

The core structure of the abstract data model is a set of triples, each consisting of a subject, a predicate and an object. A set of such triples is called an RDF graph. An RDF graph can be visualized as a node and directed-arc diagram, in which each triple is represented as a node-arc-node link.

Figure 1 An RDF graph with two nodes (Subject and Object) and an arc (Predicate) connecting them.

There are four kinds of nodes that can be in an RDF graph: IRIs, literals, blank nodes, and triple terms.

From this definition, it follows that when one term appears in multiple triples, these are simply multiple occurrences of that same term. For example, in a graph containing two triples (here expressed in common set and tuple notation, and using abstract names as distinct terms):

{ (R1, P1, R3),
  (R2, P2, R3) }

the term R3 is the same single term used twice, and there are five terms in total. This is more readily shown in two-dimensional graph diagrams, where one single node can simply be connected from or to multiple other nodes using labelled arcs.

Figure 2 An RDF graph with three nodes (R1, R2, and R3) and two arcs (P1 and P2), the arcs respectively connecting R1 and R2 to R3.

This abstract data model can be encoded in different ways while preserving the same stucture, as described in 1.9 RDF Documents and Syntaxes.

Note

1.2 Resources and Statements

Any IRI or literal denotes something in the world (the "universe of discourse"). These things are called resources. Anything can be a resource, including physical things, documents, abstract concepts, numbers and strings; the term is synonymous with "entity" as it is used in RDF 1.2 Semantics [RDF12-SEMANTICS]. The resource denoted by an IRI is called its referent, and the resource denoted by a literal is called its literal value. Literals have datatypes that define the range of possible values, such as strings, numbers, and dates. Special kinds of literals — language-tagged strings and directional language-tagged strings — respectively denote plain-text strings in a natural language and plain-text strings in a natural language including an initial text direction.

Asserting an RDF triple says that some relationship, indicated by the predicate, holds between the resources denoted by the subject and object (as explained below, not all triples are asserted). This statement corresponding to an RDF triple is known as an RDF statement. The predicate itself is an IRI and denotes a property, that is, a resource that can be thought of as a binary relation. (Relations that involve more than two entities can only be indirectly expressed in RDF [SWBP-N-ARYRELATIONS].)

Unlike IRIs and literals, blank nodes do not identify specific resources. Statements involving blank nodes say that something with the given relationships exists, without explicitly naming it.

1.3 The Referent of an IRI

The resource denoted by an IRI is also called its referent. For some IRIs with particular meanings, such as those identifying XSD datatypes, the referent is fixed by this specification. For all other IRIs, what exactly is denoted by any given IRI is not defined by this specification. Other specifications may fix IRI referents, or apply other constraints on what may be the referent of any IRI.

Guidelines for determining the referent of an IRI are provided in other documents, like Architecture of the World Wide Web, Volume One [WEBARCH] and Cool URIs for the Semantic Web [COOLURIS]. A very brief, informal, and partial account follows:

Perhaps the most important characteristic of IRIs in web architecture is that they can be dereferenced, and hence serve as starting points for interactions with a remote server. This specification is not concerned with such interactions. It does not define an interaction model. It only treats IRIs as globally unique identifiers in a graph data model that describes resources. However, those interactions are critical to the concept of Linked Data Design Issues, [LINKED-DATA], which uses the RDF abstract syntax and concrete RDF syntaxes, the latter also referred to as serialization formats.

1.4 RDF Vocabularies and Namespace IRIs

An RDF vocabulary is a collection of IRIs intended for use in RDF graphs. For example, the IRIs documented in [RDF12-SCHEMA] are the RDF Schema vocabulary. RDF Schema can itself be used to define and document additional RDF vocabularies. Some such vocabularies are mentioned in the RDF 1.2 Primer [RDF12-PRIMER].

The IRIs in an RDF vocabulary often begin with a common substring known as a namespace IRI. Some namespace IRIs are associated by convention with a short name known as a namespace prefix.

Some namespace prefixes and IRIs used in this specification
Namespace prefix Namespace IRI RDF vocabulary
rdf http://www.w3.org/1999/02/22-rdf-syntax-ns# The RDF built-in vocabulary [RDF12-SCHEMA]
rdfs http://www.w3.org/2000/01/rdf-schema# The RDF Schema vocabulary [RDF12-SCHEMA]
xsd http://www.w3.org/2001/XMLSchema# The RDF-compatible XSD types

In some serialization formats, it is common to associate some namespace IRIs with arbitrary namespace prefixes, and to improve readability by abbreviating IRIs that start with one of those namespace IRIs by using the corresponding namespace prefix. For example, based on the prefix mapping in the table above, the IRI http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral would be abbreviated as rdf:XMLLiteral. Note however that such abbreviations are not meant to be processed directly as IRIs, and are not to be used in syntactic contexts where IRIs are expected. Note also that namespace IRIs and namespace prefixes are not a formal part of the RDF abstract data model. They are merely a syntactic convenience for abbreviating IRIs; for processing, the actual IRIs are reconstructed by replacing each namespace prefix with the corresponding namespace IRI.

The term “namespace” on its own does not have a well-defined meaning in the context of RDF, but is sometimes informally used to mean “namespace IRI” or “RDF vocabulary”.

1.5 Triple Terms and Reification

A triple term is an RDF triple used as an RDF term within another triple. Being an RDF triple, it denotes a proposition.

A reifying triple is a triple where the predicate is rdf:reifies and the object is a triple term. The subject of that triple is called a reifier, and it can be the subject or object of other triples.

A reifier may denote a variety of things that are related to the triple term's proposition, such as a statement or belief that the proposition holds. It is expected that the reifiers (rather than the triple terms) will be used in further statements. This section briefly describes this common usage. For more examples, refer to the RDF 1.2 Primer [RDF12-PRIMER].

For example, the following diagram represents a reifying triple of a triple term, together with a triple that includes the reifier as the subject. The latter describes the reifier as a claim, made by :Bob, that the proposition denoted by the reified triple term holds. In other words, :Bob claims that :Alice's family name is "Liddell".

Figure 3 An RDF graph containing a reifying triple that references a triple term (which is unasserted, depicted using a grey, dashed arc) from a reifier; and a triple describing this reifier.

In this example, the proposition denoted by the triple term (i.e., the proposition that :Alice's family name is "Liddell") is not claimed to be true. That would only be the case if the triple used as a triple term was also an asserted triple in the RDF graph. By using non-asserted triple terms, as in the figure, one can make statements about unasserted statements; for example, if one is unsure whether :Alice's family name is actually "Liddell".

Here is a variation on the graph shown in Figure 3. This represents a graph where an asserted triple corresponds to the triple term object of a reifying triple. In this case, the subset of triples including the reifier as subject—as illustrated in these examples— is called a triple annotation.

Figure 4 An RDF graph containing a triple annotation, where the triple term of a reifying triple corresponds to an asserted triple. Due to the asserted triple, the diagram represents the proposition as a fact, meaning that the relationship holds.

Concrete syntaxes, such as Turtle [RDF12-TURTLE], may have shortcuts for specifying reifying triples and triple annotations more succinctly.

Finally, RDF terms that appear in a triple term have the same denotation as when they appear in an asserted triple in the graph. For example, the term :Alice from a triple term and :Alice in an asserted triple both denote the same resource. For this reason, we say that triple terms are transparent.

Note

As already stated, reifiers are meant to serve a broad range of use cases: statements or beliefs that a proposition is true, situations in which the proposition is true, events that caused the proposition to become true, etc. Because of this diversity, the meaning of the rdf:reifies property is deliberately generic.

There can be multiple, distinct reifiers related to the same abstract proposition, such as statements with different sources, or situations with different characteristics. One reifier may also be used to reify multiple, distinct propositions, expressing for example the fact that the same situation could stem from different propositions.

Since a proposition that is reified does not have to hold, it is possible to make statements about any kind of statement, including an unasserted statement that contradicts another statement, whether asserted or not.

1.6 RDF and Change over Time

The RDF abstract data model is atemporal: RDF graphs are static snapshots of information.

However, RDF graphs can express information about events and about temporal aspects of other entities, given appropriate vocabulary terms.

Since RDF graphs are defined as mathematical sets, adding or removing triples from an RDF graph yields a different RDF graph.

We informally use the term RDF source to refer to a persistent yet mutable source or container of RDF graphs. An RDF source is a resource that may be said to have a state that can change over time. A snapshot of the state can be expressed as an RDF graph. For example, any web document that has an RDF-bearing representation may be considered an RDF source. Like all resources, RDF sources may be named with IRIs and therefore described in other RDF graphs.

Intuitively speaking, changes in the universe of discourse can be reflected in the following ways:

1.7 Working with Multiple RDF Graphs

As RDF graphs are sets of triples, they can be combined easily, supporting the use of data from multiple sources. Nevertheless, it is sometimes desirable to work with multiple RDF graphs while keeping their contents separate. RDF datasets support this requirement.

An RDF dataset is a collection of RDF graphs. All but one of these graphs have an associated IRI or blank node. They are called named graphs, and the IRI or blank node is called the graph name. The remaining graph does not have an associated IRI, and is called the default graph of the RDF dataset.

There are many possible uses for RDF datasets. One such use is to hold snapshots of multiple RDF sources.

1.8 Equivalence, Entailment and Inconsistency

An RDF triple denotes a proposition — a simple logical expression, describing a relationship between two entities. An asserted triple is a claim that the corresponding proposition is true. An RDF graph is the conjunction (logical AND) of all the claims made by its asserted triples. The precise details of this meaning of RDF triples and RDF graphs are the subject of RDF 1.2 Semantics [RDF12-SEMANTICS], which yields the following relationships between RDF graphs:

Entailment
An RDF graph A entails another RDF graph B if every possible arrangement of the world that makes A true also makes B true. When A entails B, if the truth of A is presumed or demonstrated then the truth of B is established.
Equivalence
Two RDF graphs A and B are equivalent if they make the same claim about the world. A is equivalent to B if and only if A entails B and B entails A.
Inconsistency
An RDF graph is inconsistent if it contains an internal contradiction. There is no possible arrangement of the world that would make the expression true.

An entailment regime [RDF12-SEMANTICS] is a specification that defines precise conditions that make these relationships hold. RDF itself recognizes only some basic cases of entailment, equivalence and inconsistency. Other specifications, such as RDF 1.2 Schema [RDF12-SCHEMA] and OWL 2 [OWL2-OVERVIEW], add more powerful entailment regimes, as do some domain-specific vocabularies.

This specification does not constrain how implementations use the logical relationships defined by entailment regimes. Implementations may or may not detect inconsistencies, and may make all, some or no entailed information available to users.

1.9 RDF Documents and Syntaxes

An RDF document is a document that encodes an RDF graph or RDF dataset in a concrete RDF syntax, such as N-Triples [RDF12-N-TRIPLES], Turtle [RDF12-TURTLE], RDFa [RDFA-CORE], JSON-LD [JSON-LD11], or TriG [RDF12-TRIG]. RDF documents enable the exchange of RDF graphs and RDF datasets between systems.

A concrete RDF syntax may offer many different ways to encode the same RDF graph or RDF dataset, for example through the use of namespace prefixes, IRI references, blank node identifiers, and different ordering of triples. While these aspects can have great effect on the convenience of working with the RDF document, they are not significant for its meaning.

The basis for concrete RDF syntaxes is the structure of the abstract data model, called the abstract syntax; summarized in the following two tables.

The abstract syntax of RDF graphs
Production Defined as
RDF graph a set of zero or more triples
triple a 3-tuple of a subject, a predicate, and an object
subject either an IRI or a Blank node
predicate an IRI
object either an IRI or a Blank node or a Literal or a triple

The abstract syntax of RDF datasets
Production Defined as
RDF dataset a pair of a default graph and a set of zero or more named graphs
default graph an RDF graph
named graph a pair of a graph name and an RDF graph
graph name either an IRI or a Blank node

1.10 RDF Version Announcement

To allow RDF parsers to error or warn about unsupported RDF versions as early as possible, RDF serialization formats are expected to allow a version to be specified, via either a media-type parameter, a version announcement in a format-specific syntax, or both.

When the version is indicated both in a media-type parameter and in syntax, they are expected to be the same. If they differ, parsers use the version from the media-type parameter and might emit a warning about the mismatch.

To retain compability that is as broad as possible with older parsers, only RDF documents that make use of RDF 1.2-specific functionality are encouraged to announce their version (i.e., for RDF documents that do not make use of RDF 1.2-specific functionality it is discouraged to announce a version).

To announce the version in the HTTP responses using the Content-Type header, the server is expected to use the version parameter, as illustrated in the following example response.

HTTP/1.1 200 OK
Content-Type: text/turtle; version=1.2
Location: http://example.com/document.ttl

Servers are also expected to announce the version in-line, when the format supports in-line version announcement (such as RDF 1.2 Turtle [RDF12-TURTLE]).

When requesting an RDF document from an HTTP server, a client can use the version parameter during content negotiation [WEBARCH], by including it in the Accept request header, as illustrated in the following example request.

GET /document.ttl HTTP/1.1
Host: example.com
Accept: text/turtle; version=1.2

Section 2.1 Version Labels defines version labels to be used with the version parameter and in concrete RDF syntax.

Note

As HTTP content negotiation is advisory, clients receiving a document should be prepared to properly handle a document of the requested media type but potentially having a version other than what was requested. Clients may consider down-grading the content to an appropriate version themselves as discussed in 2.1.1 Server Considerations.

2. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

The key words MAY, MUST, MUST NOT, RECOMMENDED, SHOULD, and SHOULD NOT in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

This specification, RDF 1.2 Concepts and Abstract Data Model, defines an abstract data model and related vocabulary for use in other specifications, such as concrete RDF syntaxes, API specifications, and query languages. Implementations cannot directly conform to RDF 1.2 Concepts and Abstract Data Model, but can conform to such other specifications that normatively reference terms defined here.

This specification establishes two conformance levels:

2.1 Version Labels

A version label is a string that identifies the syntax and semantics conformance for the RDF data.

Version Labels
Version Label Syntax Semantics
"1.2" RDF 1.2 syntax RDF 1.2 Semantics
"1.2-basic" RDF 1.2 syntax without triple terms RDF 1.2 Semantics
"1.1" RDF 1.1 syntax except for use of a version directive RDF 1.1 Semantics

Data conforming to version "1.1" is valid as data with version "1.2-basic", and data conforming to version "1.2-basic" is valid as data with version "1.2". Data conforming to version "1.1" has the same semantics under RDF 1.1 Semantics and under RDF 1.2 Semantics.

See RDF 1.2 Interoperability for details of encoding "1.2" as "1.2-basic".

For serializations supporting in-line version announcement, the version announcement SHOULD be made early in the document and certainly before serializing any feature depending on that version.

2.1.1 Server Considerations

This section is non-normative.

When serializing a graph or dataset which uses features incompatible with a requested version, servers can consider different alternatives:

  1. Eliminate triple terms by using an algorithm such as basic encoding as defined in RDF 1.2 Interoperability (downgrading from version "1.2" to "1.2-basic").
  2. Replace directional language-tagged strings by literals with a datatype IRI that uses the i18n namespace, as defined in [JSON-LD11] (downgrading from version "1.2" or "1.2-basic" to "1.1").
  3. Return 406 "Not Acceptable".
  4. Ignore the requested version and return a native representation.
Note

The suggestion here is to follow the Robustness principle (also known as Postel's Law): servers should be conservative in what they send, be liberal in what they accept.

2.1.2 Client Considerations

This section is non-normative.

If a document has no stated version (either by HTTP header or internal), systems can assume the version is "1.2", which continues to support all prior RDF versions.

When parsing a document with conflicting versions, or when parsing a document using unsupported versions, a parser may do any of the following:

  • Ignore the version directive.
  • Raise an error and abort.
  • Issue a warning and ignore the triple.
  • Parse the structure and only emit triples consistent with the declared version.

2.2 Strings in RDF

RDF uses Unicode [Unicode] as the fundamental representation for string values. Within this and related specifications, the term RDF string, or simply string, is used to describe an ordered sequence of zero or more Unicode code points which are Unicode scalar values. Unicode scalar values do not include the surrogate code points. Note that most concrete RDF syntaxes require the use of the UTF-8 character encoding [RFC3629], and use the \u0000 or \U00000000 forms to express certain non-character values.

A string is identical to another string if it consists of the same sequence of code points. An implementation MAY determine string equality by comparing the code units of two strings that use the same Unicode character encoding (UTF-8 or UTF-16) without decoding the string into a Unicode code point sequence.

3. RDF Graphs

An RDF graph is a set of RDF triples.

An RDF triple that is an element of an RDF graph is also said to be asserted in that RDF graph.

3.1 Triples

An RDF triple (often simply called "triple") is a 3-tuple that is defined inductively as follows:

The three components (s, p, o) of an RDF triple are respectively called the subject, predicate and object of the triple.

Note

The definition of triple is recursive. That is, a triple can itself have an object component which is another triple. However, by this definition, cycles of triples cannot be created.

The set of nodes of an RDF graph is the set of subjects and objects of the asserted triples of the graph. It is possible for a predicate IRI to also occur as a node in the same graph.

Triple equality: Two triples (s, p, o) and (s', p', o') are equal (the same RDF triple) if and only if all of the following three conditions hold.

3.2 RDF Terms

IRIs, literals, blank nodes, and triple terms are collectively known as RDF terms.

IRIs, literals and blank nodes are said to be basic RDF terms.

RDF term equality: Two RDF terms t and t' are equal (the same RDF term) if and only if one of the following four conditions holds:

Note

The set of RDF terms appearing in an RDF triple t is defined inductively as follows:

By extension, an RDF term is said to appear in an RDF graph if it appears in an asserted triple of that graph. An RDF triple is said to appear in an RDF graph if it is either an asserted triple of that graph or a triple term appearing in that graph.

An RDF term is said to be ground if any of the following three conditions holds:

By extension, an RDF triple is said to be ground if its subject, predicate, and object are all ground. An RDF graph is said to be ground if all its asserted triples are ground.

3.3 IRIs

An IRI (Internationalized Resource Identifier) within an RDF graph is a string that conforms to the syntax defined in RFC 3987 [RFC3987].

An IRI in the RDF abstract syntax MUST be resolved per [RFC3986] and MUST NOT be a relative reference. An IRI MAY contain a fragment identifier. An IRI SHOULD follow rules defined by the IRI scheme.

IRI equality: Two IRIs are equal if and only if they consist of the same sequence of Unicode code points, as in Simple String Comparison in section 5.3.1 of [RFC3987]. (This is done in the abstract syntax, so the IRIs are resolved IRIs with no escaping or encoding.) Further normalization MUST NOT be performed before this comparison.

Note

For convenience, a complete [ABNF] grammar from [RFC3987] is provided in F. IRI Grammar.

Note

URIs and IRIs: IRIs are a generalization of URIs [RFC3986] that permits a wider range of Unicode characters [UNICODE]. Every URI and URL is an IRI, but not every IRI is an URI. In RDF, IRIs are used as IRI references, as defined in [RFC3987] section 1.3. An IRI reference is common usage of an Internationalized Resource Identifier. An IRI reference refers to either a resolved IRI or relative IRI reference, as described by the IRI-reference production in F. IRI Grammar. The abstract syntax uses only fully resolved IRIs. When IRIs are used in operations that are only defined for URIs, they must first be converted according to the mapping defined in section 3.1 of [RFC3987]. A notable example is retrieval over the HTTP protocol. The mapping involves UTF-8 encoding of non-ASCII characters, %-encoding of octets not allowed in URIs, and Punycode-encoding of domain names.

URLs: The URL Standard is largely compatible with [RFC3987] IRIs, but is based on a processing model important for implementation within web browsers and are not described using an [ABNF] grammar.

3.3.1 RDF Reference IRIs

This section is non-normative.

This section provides advice to data publishers.

IRIs are used to denote resources, and each IRI should identify the same resource regardless of where that IRI is used. Note that the general syntax for IRIs, defined by [RFC3987], can express IRIs which do not meet the requirement of being a global reference. Some URI schemes add additional requirements; for example, the HTTP URI scheme defines http-URI, which requires the presence of a non-empty host name, and, as a consequence, the path component will start with /. The [RFC3987] syntax permits IRIs such as http:abcd and http:///abcd, but these are invalid because they do not satisfy the HTTP URI scheme definition.

An RDF Reference IRI, sometimes called simply RDF Reference, is an IRI that is suitable for use as a global reference.

Reference Resolution: An RDF Reference IRI is unchanged by reference resolution. In URI schemes such as http and https, the path component is part of the hierarchy visible to the resolution algorithm. When resolved, the path component starts with a / character and does not contain . or .. segments. For example, https://example/data resolved against any base IRI is https://example/data (unchanged), whereas https://example/path/../data resolved against an arbitrary base IRI is https://example.com/data.

Relative IRI references: Some concrete RDF syntaxes permit relative IRI references (see the irelative-ref production in the IRI Grammar) as a convenient shorthand that allows RDF documents to be authored without knowing their final publishing location. Relative IRI references must be resolved against a base IRI. Therefore, the RDF graph serialized in such syntaxes is well-defined only if a base IRI can be established [RFC3986].

URI Schemes: Implementations are encouraged to follow the scheme-specific rules of the common schemes, such as the scheme rules for HTTP/HTTPS and the DID syntax. Implementations ignore URI scheme rules for schemes they do not recognize.

IRI normalization: Interoperability problems can be avoided by minting only IRIs that are normalized according to Section 5 of [RFC3987].

  • Use lowercase characters in scheme names.
  • Only use percent-encoding of characters where required by the IRI syntax.
  • Omit the HTTP or HTTPS default port; http://example/ is preferred over http://example:80/.
  • Use uppercase hexadecimal letters within percent-encoding triplets;"%3F" is preferred over "%3f".
  • An empty path in an HTTP IRI http://example/ is preferred over having no path http://example.
  • Normalize IRIs to remove "/./" and "/../" in the path component of an IRI.
  • Use lowercase characters in domain names. Note that, while ASCII characters in domain names are case-insensitive, non-ASCII characters in domain names are case-sensitive [RFC5890]. Domains are generally only registered with lowercase letters [RFC5892].
  • Avoid using the A-label (ASCII, punycode-encoded name]) for Internationalized Domain Names [RFC5890] in IRIs.
  • Use IRIs in Unicode Normalization Form C [I18N-Glossary].

3.4 Literals

Literals are used for values such as strings, numbers, and dates.

A literal consists of two, three, or four components, as below:

  1. A lexical form, being an RDF string.
  2. A datatype IRI, being an IRI identifying a datatype that determines how the lexical form maps to a literal value.
  3. If and only if the datatype IRI is http://www.w3.org/1999/02/22-rdf-syntax-ns#langString or http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString, there is a non-empty language tag as defined by [BCP47]. The language tag MUST be well-formed according to section 2.2.9 of [BCP47], and MUST be treated accordingly, that is, in a case-insensitive manner. Two [BCP47]-complying strings that differ only by case represent the same language tag.
  4. If and only if the datatype IRI is http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString, there is a base direction that MUST be one of the following:
    • ltr, indicating that the initial text direction is set to left-to-right
    • rtl, indicating that the initial text direction is set to right-to-left

A literal is a language-tagged string if the language tag is present and the base direction is not present. A literal is a directional language-tagged string if both the language tag and the base direction are present.

Literal term equality: two literals are term-equal (the same RDF term) if and only if the following are all true:

3.4.1 Representation of Literals

Some concrete syntaxes support simple literals consisting of only a lexical form without any datatype IRI, language tag, or base direction. Simple literals are syntactic sugar for abstract syntax literals with the datatype IRI http://www.w3.org/2001/XMLSchema#string (which is commonly abbreviated as xsd:string).

Similarly, most concrete syntaxes represent language-tagged strings and directional language-tagged strings without the datatype IRI because it is always either http://www.w3.org/1999/02/22-rdf-syntax-ns#langString (rdf:langString) or http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString (rdf:dirLangString), respectively.

Any string complying with [BCP47] MAY be used to represent a language tag in concrete syntaxes or implementations. Such strings MAY be case normalized (for example, by canonicalizing as defined by BCP 47 section 4.5). Alternatively, an implementation MAY preserve the case from the original representation, provided that it processes it in a case-insensitive manner.

Note

3.4.2 Literal Value

The literal value associated with a literal is defined as follows.

It follows from the above that two literals can have the same value without being the same RDF term. For example:

"1"^^xsd:integer
"01"^^xsd:integer

denote the same value, but are not the same literal RDF term because their lexical forms differ.

3.4.3 Initial Text Direction

This section is non-normative.

The base direction of a directional language-tagged string provides a means of establishing the initial direction of text, including text which is a mixture of right-to-left and left-to-right scripts. The Unicode Bidirectional Algorithm [I18N-Glossary] provides support for automatically rendering a sequence of characters in logical order, so that they are visually ordered as expected, but this is not always sufficient to correctly render bidirectional text.

Consider the Arabic translation of the book title "HTML and CSS: Designing Websites". In a left-to-right context (such as an English web page), with proper bidi isolation but without an explicit base direction, it would be incorrectly displayed as follows:

HTML و CSS: تصميم مواقع الويب

while the correct rendering is as follows:

HTML و CSS: تصميم مواقع الويب

That example demonstrates the importance of using directional language-tagged strings instead of simple language-tagged strings in contexts where bidirectional text can be encountered.

Note that the language and base direction address string external bidirectional issues, related to correctly displaying the string in context (e.g., avoiding spillover problems). It does not address directional issues internal to the string, which may occur in more complex examples, such as the following:

"HTML و CSS: تصميم مواقع الويب" is the Arabic title of the book.

A directional language-tagged string representing that example will have the language tag en and the base direction ltr, but also requires specific Unicode bidirectional formatting characters to isolate and mark the text between the quotes as rtl.

Note
Other datatypes provide their own way to encode [Truncated]