p2m2 / discovery

Discovery provides a powerful toolset for developers who are looking to build UIs using RDF data in an a robust software development process
https://p2m2.github.io/discovery/
MIT License
0 stars 1 forks source link

Inference Rule Engine : addInferenceRule #158

Open ofilangi opened 2 years ago

ofilangi commented 2 years ago

add inference rule construction

set inference rule example

construct {
  ?x ?p ?z
}
where {
  ?p a owl:TransitiveProperty .
  ?x ?p ?y .
  ?y ?p ?z 
}

behaviours

Should be apply on the current query context

example

supposing property is a owl:TransitiveProperty

<p1> <property> <p4>
<p2> <property> <p4>
<p4> <property> <p6>

query

select ?v where {
<p1> <property> ?v .
}

expected results

<p1> <property> <p4>
<p1> <property> <p6>

owl:TransitiveProperty build new triplet without context

<p1> <property> <p6>
<p2> <property> <p6>

owl:TransitiveProperty build new triplet with context

<p1> <property> <p6>

add library of InferenceRules

reference http://ns.inria.fr/sparql-extension/rule.html#:~:text=Inference%20rules%20are%20construct%20where,XML%20syntax%20as%20shown%20below.

ofilangi commented 2 years ago
SWDiscovery(config)
   .rule("owl:transitive")
        .something("p")
           .isA("owl:TransitiveProperty")
        .root()
          .something("x")
            .isSubjectOf("p","y")
               .isSubjectOf("p","z")
            .construct()
              . something("x")
                   .isSubjectOf("p","z")
   .query()
       .something().set("<p1>")
         .isSubjectOf("<property>","v")
          .select("val")

note : add query operation for query part

ofilangi commented 2 years ago

some reasoners: