datalog

simongray 2021-04-13T07:50:54.045700Z

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

simongray 2021-04-13T07:52:11.047200Z

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.

refset 2021-04-13T09:10:49.059600Z

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! ( 🙏 )

👍 3
simongray 2021-04-13T09:53:02.060800Z

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

📝 1
marciol 2021-04-14T14:18:26.075100Z

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

Joe Lane 2021-04-13T13:07:30.065100Z

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.

quoll 2021-04-13T15:37:53.066600Z

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

quoll 2021-04-13T15:38:44.066700Z

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

Joe Lane 2021-04-13T15:40:43.067200Z

TIL: thanks @quoll 👍

👍 1
quoll 2021-04-13T15:46:03.067300Z

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.

quoll 2021-04-13T15:47:31.067500Z

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

quoll 2021-04-13T15:48:02.067700Z

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

quoll 2021-04-13T15:48:34.067900Z

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

quoll 2021-04-13T16:08:30.068300Z

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)

marciol 2021-04-13T20:27:15.068500Z

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.

marciol 2021-04-13T20:32:08.071700Z

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