Fork me on GitHub
#datalog
<
2021-04-13
>
simongray07:04:54

Am I right in thinking that https://github.com/fluree/db is basically Datomic in disguise? e.g. https://docs.flur.ee/lesson/bg-infra/1

simongray07:04:11

they call it RDF, but it is obviously modelled exactly like a Datomic datom. It also doesn’t seem to have any other RDF semantics other than the fact that the basic unit of modelling is a triplet.

refset09:04:49

That was roughly my conclusion also - I didn't note anything fundamentally different in the design when I last looked (discounting JSON APIs & blockchain signatures). I'm no expert on RDF but I gather "named graph" support is quite an important feature in those circles (i.e. SPARQL 1.1), and that doesn't seem to have made the cut. Also note that I believe it was proprietary for a long while before they open-sourced it in October, so kudos to their team for choosing to switch course and join the OSS party! ( 🙏 )

👍 8
quoll15:04:44

It’s definitely important, though not essential. Not every deployment uses them

simongray09:04:02

RDF also requires things like namespacing using URIs and other restrictions on the more free-form datom.

📝 3
quoll15:04:03

You can write RDF without it. The problem is that URIs are necessarily long, so everyone wants to namespace things. Given that RDF is supposed to be universal, namespacing MUST be globally uniform. The clojure equivalent is to have fully qualified namespaces like: :com.my-company.project.my-package.my-ns/some-key But we’re not forced to do this in Clojure. That’s usually OK, because we’re not trying to mix data from many different places, whereas RDF was specifically designed to do exactly that.

quoll15:04:31

Namespaces make RDF much, much easier to read and write. You end up with QNames, which look almost identical to a simple namespaced keyword. e.g. QName: foo:bar keyword: :foo/bar

quoll15:04:02

But in Clojure, you don’t need foo to be defined to anything, while RDF does need it

quoll15:04:34

But it does create some really useful mechanisms for translating between the 2!

quoll16:04:30

Thinking about this… It might be kinda nice to have namespace aliases in a database. Right now, if I’m using aliases, then the whole thing will go into the database:

(require '[org.project.my-ns :as mine])
::mine/data
This gets saved as: :org.project.my-ns/data Now if all of my attributes are stored that way, then it might be nice to have a schema-like entry saying:
{:schema/ns 'org.project.my-ns
 :schema/alias 'mine }
So then using data in the context of that database would be able to de-alias namespaces of mine into org.project.my-ns (I’m just speculating out loud here. Syntax would need some thinking, as would how to load the schema, and how to not intern too many things)

marciol20:04:15

It will solve some problems people have mapping keywords into datomic. It'd be nice to solve the alias into the database itself and wondering if someone on Datomic team already thought about it.

quoll03:04:52

Rich is aware of RDF, and he thinks about most things. I’d be surprised if he hadn’t considered it at all

quoll03:04:01

If asked, I’m reasonably confident that he would have a well-thought-out reason why it isn’t in Datomic

marciol14:04:26

Sure, there is a lot of "hammock time" poured on the Datomic Design hammock

Joe Lane13:04:30

JSON-LD has an interesting take on this with its context map. It supports aliasing of namespaces so you can refer a name ( like lexical scope) or add a ns alias to shorten the names. The context itself can be a link-rel to a URI.

quoll15:04:53

Namespace aliases appear all over RDF, since it’s such an important part of the data model. That’s why JSON-LD put so much effort into that part. But it’s in each of the other document types as well

Joe Lane15:04:43

TIL: thanks @quoll 👍

👍 2
marciol20:04:08

And talking about global namespaces and how to make the relationship between all those resources, I discovered that something similar to JSON-LD was implemented to IPFS. They called it IPFS-LD but renamed after sometime to IPLD. I think that IPFS and RDF are a good match that makes a lot of sense