There doesn't appear to be any formal semantics around this term other than the domain and range. I am assuming it is there as a result of Open World Assumptions i.e a means to explicitly state that a list has no more items...


Mistook rdf:nil for a property.

It's an individual. Domain and Range referred to above are relevant for rdf:rest and rdf:first

asked 03 Mar '12, 15:33

William%20Greenly's gravatar image

William Greenly
accept rate: 13%

edited 12 Mar '12, 07:11

That is exactly its purpose. In contrast to RDF containers (Bag, Seq, Alt), which are open-ended (that is, it is impossible to explicitly say that a container has X items and no more), the RDF collection vocabulary (rdf:first, rdf:rest, rdf:nil) is designed to specifically allow you to model closed sets (see also the section on Collections in the Primer). As you can see in the example in the Primer, rdf:nil indicates the end of the list.

By the way: note that RDF itself poses no "well-formedness restrictions" on the use of the collection vocabulary. So you're free to create an RDF collection that does not terminate with an rdf:nil resource, or which has two rdf:first properties on the first node of the collection, or a loop, or whatever else you can think of.

However, most RDF processors will expect a collection to conform to the basic structure as illustrated in the Primer and therefore always be closed with a rdf:nil resource. So it's not exactly an optional part of a collection structure, at least not if you want a processor to be able to handle it.


answered 03 Mar '12, 16:33

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
accept rate: 37%

edited 03 Mar '12, 16:33

With limited effort with OWL constructs, you can define that a list or a container has exactly X elements.

(06 Mar '12, 09:12) Antoine Zimm... ♦ Antoine%20Zimmermann's gravatar image

First to say: rdf:nil is a resource (an individual), it doesn't have a domain or range. The only thing that is semantically specified for it is the RDF axiomatic triple:

rdf:nil rdf:type rdf:List .

And that's only the case in RDF(S) and OWL Full. In OWL DL, where it is used a lot in the RDF encoding of argument lists (e.g. for writing owl:oneOf(...) expressions), it does not have a semantic meaning at all.

On the other hand, in OWL 2 DL, it would be an (syntactic!) error not to use rdf:nil to terminate argument lists. Or, put it differently, there would then not be a reverse RDF mapping from an RDF graph containing such a non-terminated argument list to the OWL 2 Structural Specification, which is the actual syntax underlying OWL 2 DL: Table 3 of the RDF mapping spec requires argument lists to be terminated with rdf:nil.


answered 04 Mar '12, 17:27

Michael%20Schneider's gravatar image

Michael Schn... ♦
accept rate: 34%

Yes - my mistake. Don't know why I mistook it for a property.

I will edit my question

(12 Mar '12, 07:10) William Greenly William%20Greenly's gravatar image

rdf:nil is a particular type of list, the empty list.

:empty-list a rdf:nil .
is redundant but valid, :empty-list will be a list, :)
This is based on the idea that any list have a head, rdf:first, and a tail, rdf:rest. In this context, as @jeen-broekstra said, is used, indirect, to indicate the 'end', of the list by replacing the 'missing' values for head and tail with a empty list, rdf:nil ( in fact 'end' is 'ends' if you use lists in lists)

i don't see the connection with open/closed world assumption, maybe if you expand what you think.


answered 04 Mar '12, 01:43

oesxyl's gravatar image

accept rate: 3%

edited 04 Mar '12, 01:53

To be honest, I don't think that is valid: rdf:nil is not meant to be used as a class, AFAIK. As for the open world assumption: the connection is that in an open world, every list has potentially infinite members, unless you have an explicit way to say "this is the last element in the list".

(04 Mar '12, 02:33) Jeen Broekstra ♦ Jeen%20Broekstra's gravatar image

i don't see why rdf:nil can't be used as a class, is something that can't be used as a classes except literals and blank nodes?
in my mind the main difference between open and closed world is the use of negation which doesn't make sense in a open world, i didn't go deep in the theory to understand the implications, finite sets, empty sets. Anyway imo saying "this is the last element in the list" or "this element is a empty list" is same thing except if i expect to find something in a empty list. That is second is related to how is defined a empty list, no element in the list.

(04 Mar '12, 03:17) oesxyl oesxyl's gravatar image

Blank nodes are frequently used as classes. rdf:nil shouldn't be used as a class for the same reason dbpedia:Michael_Jackson shouldn't be used as a class - that reason being: it's a URI representing something that isn't a class.

(08 Mar '12, 12:59) tobyink ♦ tobyink's gravatar image

What about dbpedia:Michael_Jackson_(disambiguation)?

(08 Mar '12, 14:34) Michael Schn... ♦ Michael%20Schneider's gravatar image

what if an outer space alien will jump in the middle of a Michael Jackson look-alike contest? :)
don't ask!, they use rdf because are aliens, :)

(08 Mar '12, 17:01) oesxyl oesxyl's gravatar image

Hm, maybe it won't be the warp drive but the development of RDF that brings us into contact? :-)

(09 Mar '12, 03:28) Michael Schn... ♦ Michael%20Schneider's gravatar image
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 03 Mar '12, 15:33

Seen: 1,202 times

Last updated: 12 Mar '12, 07:11