Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Materialize "The Semantics of Schema Vocabulary" OWL RL subset for Datomic #11

Open
aamedina opened this issue Aug 24, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@aamedina
Copy link
Owner

Problem:
In order to get to OWL RL reasoning I need to bootstrap a datomic schema that will support the necessary datalog queries.

Proposed solution:
Implement the following inferences over the bootstrapping environment:

Semantics If Then
scm-cls T(?c, rdf:type, owl:Class) T(?c, rdfs:subClassOf, ?c)
T(?c, owl:equivalentClass, ?c)
T(?c, rdfs:subClassOf, owl:Thing)
T(owl:Nothing, rdfs:subClassOf, ?c)
scm-sco T(?c1, rdfs:subClassOf, ?c2)
T(?c2, rdfs:subClassOf, ?c3)
T(?c1, rdfs:subClassOf, ?c3)
scm-eqc1 T(?c1, owl:equivalentClass, ?c2) T(?c1, rdfs:subClassOf, ?c2)
T(?c2, rdfs:subClassOf, ?c1)
scm-eqc2 T(?c1, rdfs:subClassOf, ?c2)
T(?c2, rdfs:subClassOf, ?c1)
T(?c1, owl:equivalentClass, ?c2)
scm-op T(?p, rdf:type, owl:ObjectProperty) T(?p, rdfs:subPropertyOf, ?p)
T(?p, owl:equivalentProperty, ?p)
scm-dp T(?p, rdf:type, owl:DatatypeProperty) T(?p, rdfs:subPropertyOf, ?p)
T(?p, owl:equivalentProperty, ?p)
scm-spo T(?p1, rdfs:subPropertyOf, ?p2)
T(?p2, rdfs:subPropertyOf, ?p3)
T(?p1, rdfs:subPropertyOf, ?p3)
scm-eqp1 T(?p1, owl:equivalentProperty, ?p2) T(?p1, rdfs:subPropertyOf, ?p2)
T(?p2, rdfs:subPropertyOf, ?p1)
scm-eqp2 T(?p1, rdfs:subPropertyOf, ?p2)
T(?p2, rdfs:subPropertyOf, ?p1)
T(?p1, owl:equivalentProperty, ?p2)
scm-dom1 T(?p, rdfs:domain, ?c1)
T(?c1, rdfs:subClassOf, ?c2)
T(?p, rdfs:domain, ?c2)
scm-dom2 T(?p2, rdfs:domain, ?c)
T(?p1, rdfs:subPropertyOf, ?p2)
T(?p1, rdfs:domain, ?c)
scm-rng1 T(?p, rdfs:range, ?c1)
T(?c1, rdfs:subClassOf, ?c2)
T(?p, rdfs:range, ?c2)
scm-rng2 T(?p2, rdfs:range, ?c)
T(?p1, rdfs:subPropertyOf, ?p2)
T(?p1, rdfs:range, ?c)
scm-hv T(?c1, owl:hasValue, ?i)
T(?c1, owl:onProperty, ?p1)
T(?c2, owl:hasValue, ?i)
T(?c2, owl:onProperty, ?p2)
T(?p1, rdfs:subPropertyOf, ?p2)
T(?c1, rdfs:subClassOf, ?c2)
scm-svf1 T(?c1, owl:someValuesFrom, ?y1)
T(?c1, owl:onProperty, ?p)
T(?c2, owl:someValuesFrom, ?y2)
T(?c2, owl:onProperty, ?p)
T(?y1, rdfs:subClassOf, ?y2)
T(?c1, rdfs:subClassOf, ?c2)
scm-svf2 T(?c1, owl:someValuesFrom, ?y)
T(?c1, owl:onProperty, ?p1)
T(?c2, owl:someValuesFrom, ?y)
T(?c2, owl:onProperty, ?p2)
T(?p1, rdfs:subPropertyOf, ?p2)
T(?c1, rdfs:subClassOf, ?c2)
scm-avf1 T(?c1, owl:allValuesFrom, ?y1)
T(?c1, owl:onProperty, ?p)
T(?c2, owl:allValuesFrom, ?y2)
T(?c2, owl:onProperty, ?p)
T(?y1, rdfs:subClassOf, ?y2)
T(?c1, rdfs:subClassOf, ?c2)
scm-avf2 T(?c1, owl:allValuesFrom, ?y)
T(?c1, owl:onProperty, ?p1)
T(?c2, owl:allValuesFrom, ?y)
T(?c2, owl:onProperty, ?p2)
T(?p1, rdfs:subPropertyOf, ?p2)
T(?c2, rdfs:subClassOf, ?c1)
scm-int T(?c, owl:intersectionOf, ?x)
LIST[?x, ?c1, ..., ?cn]
T(?c, rdfs:subClassOf, ?c1)
T(?c, rdfs:subClassOf, ?c2)
...
T(?c, rdfs:subClassOf, ?cn)
scm-uni T(?c, owl:unionOf, ?x)
LIST[?x, ?c1, ..., ?cn]
T(?c1, rdfs:subClassOf, ?c)
T(?c2, rdfs:subClassOf, ?c)
...
T(?cn, rdfs:subClassOf, ?c)
@aamedina aamedina added enhancement New feature or request help wanted Extra attention is needed labels Aug 24, 2023
@aamedina aamedina self-assigned this Aug 24, 2023
@aamedina
Copy link
Owner Author

(defn scm-cls
       [with-db]
       (transduce (map (fn [[?c]]
                         [[:db/add ?c :rdfs/subClassOf ?c]
                          [:db/add ?c :owl/equivalentClass ?c]
                          [:db/add ?c :rdfs/subClassOf :owl/Thing]
                          [:db/add :owl/Nothing :rdfs/subClassOf ?c]]))
                  (completing
                    (fn [with-db tx-data]
                      (try
                        (:db-after (d/with with-db {:tx-data tx-data}))
                        (catch Throwable ex
                          (throw (ex-info (.getMesage ex) {:tx-data tx-data} ex))))))
                  with-db
                  (d/qseq '[:find ?c
                            :where
                            [?c :rdf/type :owl/Class]]
                          with-db)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant