3

From RDF Schema 1.1

2.4 rdfs:Datatype

rdfs:Datatype is the class of datatypes. All instances of rdfs:Datatype correspond to the RDF model of a datatype described in the RDF Concepts specification [RDF11-CONCEPTS]. rdfs:Datatype is both an instance of and a subclass of rdfs:Class. Each instance of rdfs:Datatype is a subclass of rdfs:Literal.

Why must rdfs:Datatype subclass rdf:Class? Why can't it just be an instance of rdfs:Class? I don't understand the meaning of subclassing class.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
Francis M. Bacon
  • 665
  • 7
  • 20
  • 1
    (i) "If X is a rdfs:Datatype, then X is a rdfs:Class." That's the traditional *definition* of a subclass relationship, so rdfs:Datatype is a subclass of a rdfs:Class. (ii) Additionally, since there are things that are rdfs:Datatypes, rdfs:Datatype is itself an rdfs:Class. (iii) Thus rdfs:Datatype is both a subclass of rdfs:Class and an instance of rdfs:Class. – Joshua Taylor Jul 19 '14 at 02:57

2 Answers2

6

Subclasses and Instances

While there may be subtle differences, it's usually OK to think about classes as sets, and subclasses of subsets. We typically recognize subset relationships when we say "every X is also a Y", in which case X ⊆ Y. We typically realize things as sets when we can say that "X is a Y", in which case X is an element and Y is a set.

We definitely want to be able to say that "X is an rdfs:Datatype" for values of X such as xsd:integer, so we do want rdfs:Datatype to be a class, which means that we want

(1) rdfs:Datatype rdf:type rdfs:Class.

The question is whether we want

(2) rdfs:Datatype rdfs:subClassOf rdfs:Class.

Because of the domain of rdfs:subClassOf is rdfs:Class, (2) actually implies (1). That is, everything that's a subclass of something is a class, so if we assert (2), then (1) logically follows. We definitely want (1). The question is whether we assert (2) and get both (1) and (2) for free, or if we only assert (1), and skip (2).

Conceptually, (2) makes sense. Everything that is a datatype is something that is a type. If some D is a datatype, then a sentence like "x is a D" makes sense. That means that the set of datatypes is a subset of all classes. This justifies accepting (2).

The specific possibilities

(2) (and implicitly (1))

It may be helpful to think of this as a hierarchy of instances, classes, and meta-classes. rdfs:subClassOf is a link between elements of the same tier, whereas rdf:type is link between elements of one tier and the tier higher up. If rdfs:Datatype a subclass of rdfs:Class, then we keep all of our "things" at the same level:

enter image description here

(1) alone (without (2))

If we make rdfs:Datatype an instance of rdfs:Class, then the specific datatypes, e.g., xsd:integer, are now on the same tier as our individuals (like John Doe), and the instance of those datatype, e.g., Thirty, are on a lower tier:

enter image description here

Now, whether this is a big deal or not is open to some debate. The notion of class and metaclass isn't really strict in an open ended representation like RDF. After all, rdfs:Class is an instance of rdfs:Class!

An option in the comments

You mentioned a third alternative in your comment on Jeen's answer (emphasis added):

But suppose rdf:Datatype was just an instance of a class not a subclass. What difference would it make?! Everything you mentioned still holds. xsd:integer could still subclass rdf:Datatype, and instances of xsd:integer, would have class xsd:integer. There seems no reason to introduce sub classing of rdf:Class at all. I don't understand what it adds to the ~semantics.

You don't want xsd:integer to be a subclass of rdfs:Datatype, because that would say that "if X is an integer, then X is a datatype", and that's really not what we expect. Thirty is an integer, but it's not a datatype; we don't typically say that something "is of type Thirty". In your chain

rdsf:Class ←X— rdfs:Datatype ←Y— xsd:integer

you can make an argument for X being either rdfs:subClassOf (case (2)) or rdf:type (case (1)), but Y really needs to be rdf:type, not rdfs:subClassOf, because integers and datatypes are different kinds of things.

Community
  • 1
  • 1
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thanks for the detailed reply. I don't understand your objection to my alternative. In fact, I think my alternative is what you meant to propose in your second alternative. Your second alternative is flawed, or at least ambiguous: If xsd:integer is a rdf:dataType and not a rdf:Class then to say ex:Thirty is a xsd:integer does not make sense because xsd:integer is not a class. To fix this you'd have to make rdf:dataType a subclass of rdf:class and we are back to square one. My way rdf:Datatype and rdf:integer are classes, and rdf:integer subclass rdf:Datatype subclass rdf:literal. – Francis M. Bacon Jul 19 '14 at 00:02
  • @FrancisM.Bacon There's no hard and fast distinction between what things are classes and what things are "elements" that belong to classes in RDF. That's why, e.g., rdfs:Class can be an instance of rdfs:Class. As I understand it, the suggestion that you made in the comment was to make rdfs:Datatype an *instance* of rdfs:Class, as opposed to a *subclass* of rdfs:Class, and then make xsd:integer a subclass of rdfs:Datatype. Making xsd:integer a subclass of rdfs:Datatype doesn't make sense, because that means that "if something is an xsd:integer, then it is also an rdfs:Dtatype," but that… – Joshua Taylor Jul 19 '14 at 00:08
  • …doesn't make sense, since, e.g., the number 30 is an xsd:integer, but is not an rdfs:Datatype. Whether you make rdfs:Datatype an instance of rdfs:Class or a subclass of rdfs:Class doesn't really matter all that much, but xsd:integer has to be an instance of rdfs:Datatype, not a subclass of rdfs:Datatype, because the things that are xsd:integers are not rdfs:Datatypes. – Joshua Taylor Jul 19 '14 at 00:08
  • When I was thinking of "rdf:Datatype" I was thinking more "a type of data". It makes sense to me that "30" is "a type of data". But also thinking on it more, I can see your point, and start to see the meaning behind sub classing a class. Looking at xsd:integer as a data type, we want to reason about the data type - the class itself, and it becomes more than just a mechanism to create hierarchies of things like other classes. Hence we sub class class. OK! I think :). – Francis M. Bacon Jul 19 '14 at 00:33
  • I still maintain the second diagram is wrong or ambiguous. – Francis M. Bacon Jul 19 '14 at 00:35
  • @FrancisM.Bacon (i) I'm not sure what you mean that "30" is a type of data? What things would have that type? Is JohnDoe an instance of "30"? It Paris an instance of "30"? I don't see many cases where "30" is a type. (ii) I don't like the second diagram as much as the first; and the first is what we *actually* have, **but** the first implies all the links of the second, so we *also* have the second. rdfs:Datatype **is** a class because there are things that members of it (e.g., xsd:integer belongs to the class rdfs:Datatype). So Datatype is a class. But it's also the case that… – Joshua Taylor Jul 19 '14 at 02:52
  • @FrancisM.Bacon …everything that is a Datatype is also itself a Class. That is, "if X is a Datatype, then X is a Class". But that's the traditional definition for a subclass relationship (e.g., "If X is a Man, then X is a Person" means that "Man is a subclass of Person"), so rdfs:Datatype is also a subclass of rdfs:Class. – Joshua Taylor Jul 19 '14 at 02:54
  • So in your 2nd diagram rdf:dataType is actually a subclass of class? I don't read it as such. – Francis M. Bacon Jul 19 '14 at 10:56
  • @FrancisM.Bacon There's a difference between what RDFS entailment allows us to infer, and what the traditional idea of being a subclass means. In the second diagram, we cannot infer *via RDFS entailment* the triple **Datatype subClassOf Class**. However, it *would* be the case that everything that is a member of Datatype is also a member of Class. That's the traditional definition of subset/subclass, so *conceptually* Datatype is a subclass of Class, even though we can't infer it via RDFS inference. – Joshua Taylor Jul 19 '14 at 11:49
2

The reason is that a datatype is itself considered a class in the abstract model, with its instances being the actual occurrences of values with that datatype.

For example, the datatype xsd:integer can be considered to be "the class of all integers", and therefore, since the class rdfs:Datatype is "the class of all datatype classes", it is a subclass of rdfs:Class (the class of all classes).

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • But suppose rdf:Datatype was just an instance of a class not a subclass. What difference would it make?! Everything you mentioned still holds. xsd:integer could still subclass rdf:Datatype, and instances of xsd:integer, would have class xsd:integer. There seems no reason to introduce sub classing of rdf:Class at all. I don't understand what it adds to the ~semantics. – Francis M. Bacon Jul 18 '14 at 09:24
  • @FrancisM.Bacon Because the domain of rdfs:subClassOf is rdfs:Class, as soon as you assert that "Datatype subClassOf Class", you also implicitly assert that "Datatype rdf:type Class", so in both cases you end up with "Datatype rdf:type Class". – Joshua Taylor Jul 18 '14 at 13:31