This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-18
Channels
- # announcements (22)
- # asami (7)
- # babashka (43)
- # beginners (68)
- # biff (2)
- # calva (10)
- # clj-kondo (7)
- # cljdoc (29)
- # clojure (41)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-europe (25)
- # clojure-gamedev (3)
- # clojure-nl (2)
- # clojure-norway (9)
- # clojure-uk (31)
- # clojurescript (3)
- # community-development (7)
- # cursive (3)
- # data-science (4)
- # datomic (17)
- # emacs (30)
- # honeysql (10)
- # hyperfiddle (39)
- # introduce-yourself (1)
- # jobs-discuss (5)
- # kaocha (1)
- # lsp (11)
- # malli (12)
- # pathom (18)
- # pedestal (3)
- # proletarian (2)
- # quil (11)
- # rdf (46)
- # reitit (8)
- # releases (2)
- # shadow-cljs (34)
- # sql (3)
- # squint (10)
- # tools-deps (24)
- # xtdb (10)
https://docs.oxfordsemantic.tech/4.0/reasoning-in-rdfox.html comparing RDFox datalog to Datomic is interesting
The essential elements of Datalog are: • a body, which matches patterns against data • a head, which uses bound values from the body to express new data
Traditionally, that’s done using predicate syntax, using comma separators in the body clause to separate multiple conjunctive terms, and :-
to separate the head and body clauses:
headTerm(arg,arg) :- pattern1(arg,arg), pattern2(arg,arg) .
arguments can be ground terms or variables.
However, this is awkward with RDF, since it reorders the triple into: predicate(subject,object) Also, because any of these terms can be IRIs or QNames, then it doesn’t look a lot like standard predicate syntax.
[?d, :deptAvgSalary, ?z] :-
[?d, rdf:type, :Department],
AGGREGATE(
[?x, :worksFor, ?d],
[?x, :salary, ?s]
ON ?d
BIND AVG(?s) AS ?z) .
is the rule I adapted from the RDFox documentationBut most importantly, predicate logic like this doesn’t expect variable predicates, which are just fine in RDF. So using a triple-based syntax seems much more appropriate. RDFox made that switch (triple patterns, rather than predicate statements), but left everything else as-is. Datomic also uses triple-patterns, but then went with its usual data structures for the body, wrapped them in a function-looking syntax, and uses it in a query like a function, rather than the head creating new statements. There’s enough familiarity that it works
yeah if the head were a pattern too then you could have a head like [?x :owl/sameAs ?y]
Well, that would result in a new transaction, which isn’t what Datomic queries are for. But the result of a query can easily be passed in as the data for a transaction that follows it 🙂
Well, I definitely would like to be able to infer triples inside a query, can't speak for most others though
That can be done where you say something like (rule-name ?entity ?attr ?value)
instead of a standard [?entity ?attr ?value]
pattern
Furthermore there is definitely alot of room to compile datalog rules that are more formally specified in a syntax like you shared into Clojure/datomic forms
https://www.w3.org/TR/rif-owl-rl/ this has been the most useful reference ive found because it provides RIF equivalents for the rules and deals with the lists
(* <#cls-int1> *)
Forall ?y ?c ?l (
?y[rdf:type->?c] :- And (
?c[owl:intersectionOf->?l]
_allTypes(?l ?y) ))
Forall ?l ?y ?ty ?tl (
_allTypes(?l ?y) :- And (
?l[rdf:first->?ty rdf:rest->?tl]
?y[rdf:type->?ty]
_allTypes(?tl ?y) ))
Forall ?l ?y ?ty (
_allTypes(?l ?y) :- And (
?l[rdf:first->?ty rdf:rest->rdf:nil]
?y[rdf:type->?ty] ))
http://webont.org/owled/2009/papers/owled2009_submission_16.pdf something like this is the "holy grail" for me -- what I want is to describe as much as possible with pure OWL and only drop down into rules when necessary. If there were a well specified syntax then we could create tools to statically analyze a subset of rules that are DL safe. I think that would be a tremendous result for safety. The thing that I have found most amazing about OWL, and this holds for all of its profiles, is how expressive it is. I can think almost in the same way I would think if I were in common lisp and modeling classes with CLOS. That ability to think at a high level about my domain and then actually use those classes in programs is enticing to me. In my ideal world there would be no rules that could not be encoded in RDF.
also relevant food for thought if anyone is interested in the problem of encoding rules in RDF: https://spinrdf.org/spin-shacl.html SPIN, which I did try to wrap my mind around and failed, apparently attempted to be a more expressive RDF syntax for SPARQL rules and now they moved to SHACL Which doesn't really help OWL but it does make me wonder if there's a way to combine the node expressions of SHACL with SHACL Triple pattern rules, but create a SWRL vocabulary mapping to Datomic built-ins instead of XML builtins. Thinking out loud. Have a good weekend everyone!
SPIN was a pseudo Datalog, where they decided that mapping standard Datalog constraints to SPARQL was too hard, and they just encoded the SPARQL directly. This made it unstructured, and consequently, there was ability to automate dependencies between productions and rule scheduling. This made it inefficient. But… it worked. There were issues with trying to use it at scale though.
SHACL is basically a concession to software engineers who can’t get their head around the open world assumption, and how to construct constraints in OWL
I do like that it’s declarative, but it is designed for a CWA system. That’s fine if you’re trying to use your RDF graph as a CWA representation of data, but it’s not “Semantic Web”, and breaks a number of assumptions for both RDF and OWL
https://github.com/spdx/spdx-3-model/issues/464 specifications are not easy to collaborate on if you have any insight feel free to add comments I’m trying to understand a bunch of different aspects of the new model and had to reimplement it myself
I’m at work, so I don’t have time to read this, but I’m instantly on my guard reading > “Blank Nodes” - generally said to be harmful in the literature
There are occasions where blank nodes are painful to deal with. In those cases, I advocate for the minting of IRIs. But I can’t fathom what’s considered wrong about them
Ha, yeah. But this kind of thing is common in my experience specifically in this domain
I just have to figure out how to contribute the right ideas :) maybe you can help, but not now
I mean… I’ve heard complaints. I’ve complained about them myself. But the complaints usually miss some elements of modeling. I know that I didn’t get it, because I was looking at it from a storage/querying point of view
I know that there have been some databases which allocated IDs that were externally addressable (e.g. Talis)
A bigger problem (which I’m not sure how to broach effectively) is that they are defining an RDF model with markdown using a WIP format that doesn’t really compile into turtle currently