Re: Functional database
On 2018-02-12 00:30, amirouche wrote: Le dim. 11 févr. 2018 à 0:44, amirouche a écrit : Le sam. 10 févr. 2018 à 8:34, amirouche a écrit : Héllo all, # Introduction I figured a usecase for an immutable / functional database that works like git. I will continue my work using 'chez scheme' because performances. I will log my progress at http://hyperdev.fr/projects/neon/ Happy hacking! -- Amirouche ~ amz3 ~ http://www.hyperdev.fr
Re: Functional database
Le dim. 11 févr. 2018 à 0:44, amirouche a écrit : Le sam. 10 févr. 2018 à 8:34, amirouche a écrit : Héllo all, # Introduction I figured a usecase for an immutable / functional database that works like git. There is some data [0] about the subject applied to triple stores aka. subject-predicate-object data store [1]. So now, I understand that triple store manipulates - triples. To be precise, the public facing API doesn't expose unique identifiers generated by the database system. The striking thing, is that it seems like the triple store doesn't require extra work to pull/push triples since FK / relations / links are handle by the user. [0] http://events.linkeddata.org/ldow2013/papers/ldow2013-paper-01.pdf [1] https://en.wikipedia.org/wiki/Triplestore There is another interesting article called R43ples [2] which is a very similar idea to what I had in mind 3 years ago when trying to work with opencog people [3]. That is use a triple store to store history and references of the version-ed triple store! I did not dig much deeper into the paper even if it's very well written with lots of diagrams. [2] http://www.hyperdev.fr/projects/neon/10.1.1.662.1619.pdf [3] https://wiki.opencog.org/w/User_talk:Amz3 I started the code but did not have time to compile it yet... My plan demo add/del triples and ref at different points in database history in the following days. If you find the idea interesting and you'd like to help here are few tasks that can be achieved independently: - Create a parser for sparql query language and / or a guile DSL to achieve the same - Create parser for turtle syntax https://en.wikipedia.org/wiki/Turtle_(syntax) - Package microkanren for guix https://framagit.org/a-guile-mind/microkanren - Update guile-gnome package to use guile 2.2.3 and create a graphical user interface that allows to: navigate the history (like a git graph), merge conflicting branches, make banana flavored ice cream. Happy hacking!
Re: Functional database
Le sam. 10 févr. 2018 à 8:34, amirouche a écrit : Héllo all, # Introduction I figured a usecase for an immutable / functional database that works like git. There is some data [0] about the subject applied to triple stores aka. subject-predicate-object data store [1]. So now, I understand that triple store manipulates - triples. They do not manipulate unique identifiers referencing association list. That said, if you group-by 'subject' a set of triples you get an association lists. It means there is an equivalence between the two. The striking thing, is that it seems like the triple store doesn't require extra work to pull/push triples since FK / relations / links are handle by the user. [0] http://events.linkeddata.org/ldow2013/papers/ldow2013-paper-01.pdf [1] https://en.wikipedia.org/wiki/Triplestore The interface of my database (based on Entity Attribute Value model) is: (fs:add alist) -> unique identifier which will call a `get-unique-identfier` procedure and call: (fs:add-pair uid key value) For every pairs of the alist. The interface of a triple store is: (add subject predicate object) That is, it's exactly the same as 'fs:add-pair' or almost because in my target implementation SUBJECT is positive integer (max 2^64) PREDICATE is a symbol and OBJECT a scheme value. That allows to use more integers which leads to faster comparisons. I could map SUBJECT and PREDICATE to an integer via another table... Not sure what is the best solution. Related to git, it's possible to change git backend using libgit2's ODB API [2]. [2] https://www.perforce.com/blog/your-git-repository-database-pluggable-backends-libgit2 # TODO - code the "bare database" ie. the gist of the story that is the immutable association list that takes inspiration from git. - create benchmarks - Index conceptnet and wikidata and demo the git-like features over the dictionary based named entity recognition.