Skip to content

Latest commit

 

History

History
192 lines (152 loc) · 6.95 KB

README.org

File metadata and controls

192 lines (152 loc) · 6.95 KB

thi.ng/fabric-facts

Contents

About the project

Overview

This module provides the following features on top of the fabric-core compute graph setup:

  • Triple or Quad fact graphs
  • Specialized, more lightweight fact vertices
  • Fact indexing
  • Optional, customizable fact transformations (and untransform) for optimizing graph internal storage
  • Fact graph logging / fact persistence (via core.async)
  • Conversion of nested Clojure maps to facts (triples)
  • Query tree construction (vertex based)
    • Query variable bindings (SPARQL / Datalog style pattern queries)
    • Sub-queries (each with own filters, limits, projections)
    • Joins
    • Optional joins
    • Unions
    • Negation (result subtraction)
    • Bounded length path queries (min/max limits, forward & reverse)
    • Arbitrary filters at any query level
    • Pre-bound query variables (pre-filtered queries)
    • Result variable injection
    • Nested result sorting
    • Arbitrary result grouping
    • Grouped & un-grouped result aggregation fns & expressions
    • Result limiting
  • Map based query expression DSL (EDN serializable)
  • Query visualization (via Graphviz)
  • Extensive query & sub-query reuse/caching
  • Intelligent recursive query tree removal
  • Queries are only computed once, results are cached and only updated automatically when underlying fact set is changing
  • Rule based inferencing based on any query (execute arbitrary action for each new result, e.g. to add/remove facts)
  • RDF N-Triple parser

Status

ALPHA quality, in active development.

Example usage

The main README contains an example for this module and more detailed information can be found in the core and test namespaces:

Namespaces

Tests

In addition to the examples in the literate source code, currently there’re 150+ tests & examples showing common usage patterns of this module:

Module definition

Building & testing this project

Please see the parent project for further information.

Injected properties

thi.ng/fabric-facts

Extra module dependencies

thi.ng/dstruct

[thi.ng/dstruct "0.1.1"]

Leiningen project file

(defproject <<project-name>> "<<conf-version()>>"
  :description  "Signal/Collect inspired compute graph infrastructure - fact graph module"
  :url          "<<conf-project-url>>"
  :license      {:name "Apache Software License 2.0"
                 :url "http://www.apache.org/licenses/LICENSE-2.0"
                 :distribution :repo}
  :scm          {:name "git"
                 :url "<<conf-project-url>>"}

  :min-lein-vesion "2.4.0"

  :dependencies [<<dep-clj>>
                 <<dep-cljs>>
                 [thi.ng/fabric-core "<<conf-version()>>"]
                 <<dep-strf>>
                 <<dep-dstruct>>
                 <<dep-int-map>>]

  :profiles     {:dev {:dependencies [<<dep-criterium>>]
                       :plugins      [<<dep-cljsbuild>>
                                      <<dep-cljs-test>>]
                       :global-vars  {*warn-on-reflection* true}
                       :jvm-opts ^:replace []
                       :aliases {"cleantest" ["do" "clean," "test," "cljsbuild" "test"]}}}

  :cljsbuild    {:builds [{:source-paths ["src" "test"]
                           :id "dev"
                           :compiler {:output-to "<<cljs-artefact-path>>"
                                      :optimizations :whitespace
                                      :pretty-print true}}
                          {:source-paths ["src"]
                           :id "prod"
                           :compiler {:output-to "<<cljs-artefact-path>>"
                                      :optimizations :advanced
                                      :pretty-print false}}]
                 :test-commands {"unit-tests" ["phantomjs" :runner "<<cljs-artefact-path>>"]}}

  :pom-addition [:developers [:developer
                              [:name "Karsten Schmidt"]
                              [:url "http://thi.ng/fabric"]
                              [:timezone "0"]]])

ClojureScript HTML test harness

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title><<project-name>> <<conf-version()>> test</title>
  </head>
  <body>
    <script type="text/javascript" src="<<cljs-artefact-path>>"></script>
  </body>
</html>

Accessing library version during runtime

The autogenerated namespace thi.ng.fabric.facts.version contains a single symbol version holding the version string defined above:

(use '[thi.ng.fabric.facts.version])

(prn version)
; "<<conf-version()>>"

Version namespace

License

Copyright © 2015 Karsten Schmidt

This project is open source and licensed under the Apache Software License 2.0.