Jena: Implementing The RDF Model and Syntax Specification: Brian Mcbride
Jena: Implementing The RDF Model and Syntax Specification: Brian Mcbride
Specification
Brian McBride
Hewlett Packard Laboratories
Filton Road, Stoke Gifford
Bristol, UK
+44 117 312 9560
brian_mcbride@hp.com
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that
copies bear this notice and the full citation on the first page. To copy
otherwise, to republish, to post on servers or to redistribute to lists,
requires prior specific permission by the authors.
Semantic Web Workshop 2001 Hong Kong, China Figure 1
Copyright by the authors. It is important, as will be seen below, to distinguish between the
abstract data model and its representations. The specifications
define constraints which apply to the abstract data model. The constraint that applies to the abstract model. A particular
abstract model is infinite; representations of the abstract data representation of a resource need not include the URI.
model must be finite and incomplete. The Model and Syntax An alternative interpretation, that all representations of RDF
specification defines no formal semantics for RDF. must have a URI for each resource is inconsistent with the rest of
2.1 Resources and URI’s the Model and Syntax specification, seems draconian and is not
enforceable.
RFC 2396 [8] defines a resource to be a conceptual mapping:
The resource is the conceptual mapping to an entity or
Anonymous resources can be thought of as existentially qualified
set of entities, not necessarily the entity which
variables. The graph in figure 2 shows an anonymous resource
corresponds to that mapping at any particular instance
with a number of properties. This graph can be thought of as
in time. Thus, a resource can remain constant even when
stating that Ora created a specification, whose URI is not
its content ---the entities to which it currently
represented, called "RDF M&S".
corresponds---changes over time, provided that the
conceptual mapping is not changed in the process.
However, in figure 2 of the specification and its preceding text, it In section 6 it states:
introduces the concept of an anonymous resource, that is a It is recommended that property names always be
resource that does not have a URI, and subsequently refers to qualified with a namespace prefix to unambiguously
such resources in three places in section 6. connect the property definition with the corresponding
The repeated references to anonymous resources indicate clearly schema.
the intention of the authors that an RDF graph should be able to
represent a resource without representing its URI. This can be
reconciled with the statement quoted above if it is interpreted as
meaning that whilst a resource must always have a URI, that is a
Two issues arise with these statements: resource itself. Representations of statements typically use URI's
as part of the representation of a resource, but it is important to
· the second statement seems to undermine the first, in understand that the representations are not the same thing as the
that it merely recommends that properties be connected actual statements and resources.
with a namespace, whilst the former requires it. Whilst section 5 of the Model and Syntax specification, the
formal model for RDF, does not explicitly say so, the set of
· the first statement suggests that it is the use of a resources and the set of literals are disjoint. If literal is the
property that is associated with a namespace whilst the literal "http://foo" and resource is the resource whose URI is
latter suggests it is the property that is associated with http://foo, then the statement (predicate, subject, literal) is not
a namespace. the same statement as (predicate, subject, resource).
The first issue is resolved by taking the first statement as Implementations therefore, cannot use just the URI or the literal
definitive. The second statement is explained by the fact that it string to represent a resource or literal; they must have some way
is not possible for an RDF processor, given the URI of a of distinguishing the two.
property, to always determine unambiguously the namespace
with which it is associated. Given a property with URI 2.6 Reified Statements
http://foo/bar, it is not possible algorithmically to determine RDF statements are not resources. Through a mechanism known
whether the namespace is http://foo/ or http://foo/b or as reification, there are resources that represent RDF statements.
http://foo/ba. All are possible. The usual algorithm employed by The Model and Syntax specification (in section 5, rule 9) defines
processors is to search back from the end of URI for the first the reification of an RDF statement to be a resource r which
character that cannot appear in the LocalPart of an XML represents the statement along with four statements, one which
QName. This, however, is not guaranteed to be correct. The defines the type of the resource to be an RDF statement, and
second statement therefore is an admonition to the creators of three others which describe the subject, the predicate and the
XML representations of RDF to remove this ambiguity by object of the statement. The reification of a statement is thus a
specifying the namespace explicitly. small RDF graph containing these four statements.
RDF XML parsers and other RDF processors should retain this Section 5 goes on to state:
information, representing properties not just by their URI, but by The resource r in the definition above is called the reified
the pair consisting of their namespace URI and LocalPart. This statement. When a resource represents a reified
will enable them to acquire and process the RDF Schema [11] statement; that is, it has an RDF:type property with a
that describes each property and to write correctly an RDF graph value of RDF:Statement, then that resource must have
as XML. exactly one RDF:subject property, one RDF:object
The second issue is that the first statement quoted above, allows property, and one RDF:predicate property.
an interpretation in which the property identified by The language here is rather loose. The phrase "When a resource
http://foo/bar could be associated with the namespace http://foo/ represents a reified statement" should be read as "When a
in one statement and the namespace http:/foo/b in another. This resource is a reified statement" to be consistent with the first
would imply that a property, identified by a particular URI could sentence of the paragraph.
have multiple interpretations. RDF Schema would be
undermined by this interpretation, as it would not be possible, Thus a reified statement is the single resource that represents a
when asserting say a domain or range constraint on a property, to statement.
specify to which interpretation of the property, the constraint The paragraph quoted above applies to the RDF abstract data
applied. This interpretation is therefore rejected. model. In the abstract data model, every reified statement does
have all four properties. A representation may represent only
2.4 Literals part of the abstract data model, and so need not include all the
Though the Model and Syntax specification is clear, the nature of properties.
literals is commonly misunderstood. A literal is not just a string
of characters, but also optionally encodes a language identifier. As with trees in the park, or any other object or concept, there is
This language identifier is part of the value of the literal and nothing to preclude statements being given multiple URIs. Thus,
must be represented by implementations. whilst there can only be one statement with a given subject,
predicate and object, there may be many reified statements
2.5 Statements representing that statement. Since each such reified statement
An RDF statement is defined to be a triple consisting of a represents the same statement, the simplest semantics for RDF
predicate, a subject and an object. A triple is a mathematical implies that any property of one is a property of them all.
structure that is uniquely defined by its three components. Thus,
there can be only one statement with a given subject, predicate 2.7 Statements, Statings and Occurrences
and object. There can be many representations of a single triple, An RDF statement is defined to be a triple of the form
e.g. in multiple XML files, databases or computer memories, but (predicate, subject, object). The need of some applications to
those are representations of a triple, not the triple itself. represent occurrences of statements has been identified. For
example, an application may wish to represent the fact that a
The subject of a statement is defined to be a resource. The particular statement occurred in a particular document at a
subject of a statement is not the URI of a resource, it is the
particular time. Occurrences of statements are often called say and implementers are divided on this question. An informal
'statings'. poll of implementers had a majority implementing a graph as a
The term "occurrences" is preferred to "statings". Has a set of statements.
statement that occurs in a collection of fallacies been stated? It The suggested interpretation of an RDF statement is as a fact.
certainly occurs in that collection, but it is not clear that it has There is little point in including the same fact in a collection
been stated. more than once. When graphs are merged, it is wasteful if
The Model and Syntax specification states that a reified statements that occur in more than one of the source graphs occur
statement represents a statement. For example, in section 4.1 more than once in the resulting graphs. For this interpretation, a
para 6: graph is a set of statements.
3. RDF Interest Group - Issue Tracking, 12. Arnaud le Hors et al (eds), Document Object Model
http://www.w3.org/2000/03/rdf-tracking/ (DOM) Level 2 Core Specification,
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-
4. B. McBride, Issues Raised in the RDF Interest Group 20001113/
Mailing List, http://www-
uk.hpl.hp.com/people/bwm/rdf/issues.htm 13. JDom, http://www.jdom.org/
5. B. McBride, Jena, An RDF API in Java, http://www- 14. Janne Saaarela, Art Barstow, Sergey Melnick, Dan
uk.hpl.hp.com/people/bwm/rdf/jena Brickley, SiRPAC - A Simple RDF Parser and
Compiler,
6. Wolfram Conen, Reinhold Klapsing: A Logical http://www.w3.org/RDF/Implementations/SiRPAC/
Interpretation of RDF, http://nestroy.wi-inf.uni-
essen.de/rdf/logical_interpretation/index.html 15. David Megginson, DATAX: Data Exchange in XML,
http://www.megginson.com/DATAX/index.html
7. Richard Fikes, Deborah L McGuinness, An Axiomatic
Semantics for RDF, RDF Schema, and DAML-ONT, 16. David Megginson, RDF Filter,
http://www.ksl.stanford.edu/people/dlm/daml- http://www.megginson.com/Software/
semantics/