Reputation: 6664
People consider resource description framework (RDF) as a schemaless data model. However, there is something called RDF Schema (RDFS). So, why is RDF a schemaless data model?
Upvotes: 3
Views: 535
Reputation: 22052
RDF Schema is somewhat misnamed. It's not a real schema language, at least not in the same sense that XML Schemas or ER models are schemas.
The main difference is this: schemas are prescriptive: they prescribe the exact form the data must take: this column must be present, this can be left out, this must have this particular relation with something else, etc. etc. Any data that does not fully conform to the schema (either by leaving something out, or by having some additional column / element / attribute that is not in the schema) is automatically considered invalid (relational databases give errors when you try to insert data that does not have the right number of columns for the table you wish to insert it in, etc).
RDF Schema, on the other hand, should more accurately be called a "Vocabulary Description language": it is descriptive in nature. In other words, it gives you means to define a vocabulary for your data ("these classes and relations exist, and this is how they hang together"), but it does not force your data to conform to that schema: it is perfectly fine to have an RDF dataset that uses some parts of a particular RDF Schema, but not others, or which in addition uses other vocabulary from some other schema (or even vocabulary that is not explicitly defined in any RDF Schema).
Upvotes: 7
Reputation: 3662
Think about it this way; With relational databases, here's a typical oversimplified workflow:
With RDF, much like with other No(t-only)SQL solutions you can go about it the other way round. You simply start creating some data and the schema is thus created on the fly.
After all, if you have say, a document database, and insert some JSON object
{
"type": "User",
"id:" "123",
"name": "John Doe"
}
one could argue that the type
, id
and name
keys form some kind of schema, your application probably relies on. The only difference is what I wrote above, that the schema doesn't have to be declared up-front.
RDF goes only one step further by introducing URIs everywhere, but works similarly otherwise. When deciding on RDF terms (properties and classes) you use, you actually build or reuse schemas as you go.
Upvotes: 3
Reputation: 39313
In saying that RDF’s only benefit is schemalessness, I’m talking about RDF as a modelling framework; the many vocabularies, ontologies and tools that make up the linked data stack aren’t “RDF”, but they are facilitated by it. These are indispensable in working with data on the Web in a distributed, Web-like fashion, but they don’t need RDF to work.
On the other hand RDF Schema provides a vocabulary for RDF.
It seems to me, that as soon as you're exclusively using certain vocabularies to validate your RDF, it's not schemaless anymore. In that regard it's like XML: you can use it without schemas, but most people don't.
Upvotes: 1