|
| 1 | +# Overview |
| 2 | + |
| 3 | +Examples of mapping between SPARQL language commands and some of the MeTTa concepts are collected in this folder. |
| 4 | + |
| 5 | +Each file except inference engine has commented example in SPARQL and corresponding example in MeTTa. |
| 6 | + |
| 7 | +## List of scripts |
| 8 | + |
| 9 | +[not_exist.metta](not_exist.metta) |
| 10 | + |
| 11 | +This script implements basic command, which returns false if pattern matches and true otherwise. |
| 12 | + |
| 13 | +[filter.metta](filter.metta) |
| 14 | + |
| 15 | +This script implements is a restriction on solutions over the whole group pattern in which the filter appears. |
| 16 | + |
| 17 | +[construct.metta](construct.metta) |
| 18 | + |
| 19 | +This script implements command that returns a single graph specified by a graph template. |
| 20 | +The result is formed by taking each query solution in the solution sequence, substituting for the variables in the graph template, |
| 21 | +and combining the triples into a single graph adding it to the space. |
| 22 | + |
| 23 | +[bind.metta](bind.metta) |
| 24 | + |
| 25 | +This script implements command that allows a value to be assigned to a variable from a basic graph pattern or property path expression. |
| 26 | +Very similar to a `let` function in Metta. |
| 27 | + |
| 28 | +[union.metta](union.metta) |
| 29 | + |
| 30 | +This script implements command that provides a means of combining graph patterns so that one of several alternative graph patterns may match. |
| 31 | +If more than one of the alternatives matches, all the possible pattern solutions are found. |
| 32 | + |
| 33 | +[very_simple_inference_engine.metta](very_simple_inference_engine.metta) |
| 34 | + |
| 35 | +This script implements simple variant of rule engine that takes a list of rules, each of which either populates space with new facts or returns Empty, |
| 36 | +and consistently applies these rules until knowledge base does not change. |
| 37 | + |
| 38 | +[transitive_closure_clr.metta](transitive_closure_clr.metta) |
| 39 | + |
| 40 | +This script provides simple transitive closure example for a family graph using some of the commands above and the inference engine. |
| 41 | + |
| 42 | +[transitive_closure_clr2.metta](transitive_closure_clr2.metta) |
| 43 | + |
| 44 | +This script provides simple transitive closure example for a book authors graph using some of the commands above and the inference engine. |
0 commit comments