There seems to be two approaches to store data in NoSQL databases:Key-Value - The Key is usually stored in a hash-table referencing a Value, or Object, which can be either a key (with specific semantic) or any arbitrary data. Examples are Riak, Redis, Dynamo, CouchDB...Subject-Predicate-Object - Subject and Predicate are interpreted as keys and Object can be either a key or an arbitrary data. This will cover not only all RDF stores, but also graph databases. Examples are Neo4j, Virtuoso, AllegroGraph...Now I am not that interested in exact definition and which database falls into which category. We know that there are plenty of RDF triple stores implemented on top of SQL databases, as well as that any SQL database can be represented using only RDF triples. And there are other database types too, like column and document databases.I am interested in finding out which representation is more fundamental in the sense that for example for a given processor assembler is more fundamental than C (because C is written in assembler) and C is more fundamental than Erlang (because Erlang is written in C), and so on. Or also that binary representation is more fundamental than any other (octet, decimal, hexadecimal) because it uses the smallest amount of different numbers (0 and 1). Unfortunately I don't have a strict definition of what more fundamental means exactly.In other words, if we assume the following:A Key is an IRI resource (globally unique identifier, like used in RDF)A Blob is some arbitrary binary data we can't interpretThen we can define the following two database types:Key-Value: Where Key is an IRI and Value is either an IRI or a BlobSubject-Predicate-Object: Where Subject, Predicate are IRIs, and Object is either an IRI or a BlobIn particular, those would be the fundamental data types stored in those two databases:Ad 1: Key-Key, Key-BlobAd 2: Key-Key-Key, Key-Key-BlobI have no doubt that any data stored in any database type (graph, column, table, key-value, triple, etc) can be represented in either of those databases. I have also no doubt that data stored in one of those databases can be represented in the other, for example let's assume to represent a Key-Value pair as {Key, Value} and Subject-Predicate-Object as {Subject, Predicate, Object}. Then:Example 1:{1, abc} can be represented as two triples {2, 3, 1}, {4, 3, abc} where 2 means Key, 3 means Stores or Holds, 4 means Value.Example 2:{1, 2, abc} can be represented as three tuples {1, 1}, {1, 2}, {1, abc} where Key = 1 means triple number 1, Value = 1 means Subject position, Value = 2 means Predicate position, Value = 3 means Object position.The means is a conceptual shortcut for having a proper IRI representing that meaning.Is there any scientific evidence that one representation is more fundamental than the other? Or, because there is no strict definition of more fundamental, if we could put it as which representation can more easily and/or efficiently represent data stored in any other database type? And I am asking that because I hope that there isn't just an answer like it depends :)
Which is more fundamental: key-value or subject-predicate-object?
graph theory;data structures;database theory
Following your simplicity argument (binary is more fundamental than octal), I'd say that key-value stores are more fundamental.I think that Subject-Predicate is essentially a 'compound' or 'aggregate' key, so a subject-predicate-object store is a key-value store with additional requirements on the key (namely that it can be split into two).