TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introduction to Datalog

203 pointsby x775about 6 years ago

10 comments

JoelMcCrackenabout 6 years ago
Can anyone recommend any implementation of Datalog (+ negation) that is not datomic?<p>I haven&#x27;t tried datascript, which appears to support negation. Maybe I will try that if&#x2F;when I revisit this interest someday.
评论 #19424111 未加载
评论 #19424109 未加载
评论 #19425596 未加载
评论 #19425910 未加载
sdbradyabout 6 years ago
Thanks for sharing. There is one very significant conceptual error early on, however, and it is captured first in this statement: &quot;The :- means if and only if, or iff&quot;. `:-` means if - or more precisely represents material conditional - where the consequent is on the left and the antecedent is on the right. iff is logical biconditional.
评论 #19425233 未加载
评论 #19423933 未加载
hombre_fatalabout 6 years ago
Pretty cool deep-dive on Datalog.<p>The interactive tutorials on <a href="http:&#x2F;&#x2F;www.learndatalogtoday.org" rel="nofollow">http:&#x2F;&#x2F;www.learndatalogtoday.org</a> (Datomic&#x27;s dialect) quickly sold me on the idea.<p>Though coming from Datomic, I&#x27;m curious how much of my knowledge is Datomic-specific rather than how you&#x27;d generally approach a database queryable with Datalog. For example, do you need four indexes like Datomic (<a href="https:&#x2F;&#x2F;docs.datomic.com&#x2F;on-prem&#x2F;indexes.html" rel="nofollow">https:&#x2F;&#x2F;docs.datomic.com&#x2F;on-prem&#x2F;indexes.html</a>) to make Datalog queries fast?
评论 #19423612 未加载
nmaddenabout 6 years ago
Great post! Still working through it, but there is a slight error in the nested diagram at the start. Relational algebra has set difference, which is akin to negation-as-failure, but it lacks recursion. So the positive Datalog and RA circles should overlap without either containing the other. See <a href="http:&#x2F;&#x2F;www.lifl.fr&#x2F;%7Ekuttler&#x2F;elfe&#x2F;biblio&#x2F;datalog-overview-gottlob.pdf" rel="nofollow">http:&#x2F;&#x2F;www.lifl.fr&#x2F;%7Ekuttler&#x2F;elfe&#x2F;biblio&#x2F;datalog-overview-g...</a>
评论 #19425750 未加载
burakemirabout 6 years ago
Nice post. Still, I find the most accessible article describing datalog is &quot;What you Always Wanted to Know About Datalog (And Never Dared to Ask).&quot; by Ceri, Gottlob, Tanca (1989)
评论 #19424990 未加载
radomir_cernochabout 6 years ago
&gt; The :- means if and only if, or iff.<p>Is it really the case?<p><pre><code> Human(&quot;Socrates&quot;). Animal(&quot;Turtle&quot;). Mortal(x) :- Human(x). Mortal(x) :- Animal(x). </code></pre> Suppose :- means iff. Turtle is Mortal (lines 2+4, implication to the left). Because Turtle is Mortal, it must be a Human (line 3, implication to the right).<p>Is it really valid according to Datalog semantics?
评论 #19423976 未加载
bobjordanabout 6 years ago
Sharing an interesting implementation in python which I stumbled upon yesterday. Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;pcarbonn&#x2F;pyDatalog" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pcarbonn&#x2F;pyDatalog</a> Tutorial: <a href="https:&#x2F;&#x2F;sites.google.com&#x2F;site&#x2F;pydatalog&#x2F;Online-datalog-tutorial" rel="nofollow">https:&#x2F;&#x2F;sites.google.com&#x2F;site&#x2F;pydatalog&#x2F;Online-datalog-tutor...</a>
ComNikabout 6 years ago
If model-theoretic semantics and the various ways to slice, dice, and extend Datalog are interesting to you, then almost any talk by Peter Alvaro might be as well.<p>In particular: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=R2Aa4PivG0g" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=R2Aa4PivG0g</a>
fspeechabout 6 years ago
Can you specify symmetric and transitive closure in Datalog?
评论 #19423320 未加载
slifinabout 6 years ago
Thank you, bookmarking this for later