aboutsummaryrefslogtreecommitdiff
path: root/test/souffle
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-27 08:52:38 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-27 08:52:38 +0200
commit0259c6f907875b54e5d1df4bc89efa1c293d2812 (patch)
treed27f62ac6eb6fc09d8e989088978d959176ca6dd /test/souffle
parent101d17f0993795769fa125d26ceec71ccfecd057 (diff)
downloadee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.tar.gz
ee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.tar.bz2
ee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.tar.xz
ee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.zip
Adding Soufflé based reasoning on parts. Replacing default configuration
with applying python function with this new reasoner.
Diffstat (limited to 'test/souffle')
-rw-r--r--test/souffle/test.souffle29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/souffle/test.souffle b/test/souffle/test.souffle
new file mode 100644
index 0000000..1072e9a
--- /dev/null
+++ b/test/souffle/test.souffle
@@ -0,0 +1,29 @@
+.symbol_type Ref
+.symbol_type Uri
+.symbol_type Value
+
+.decl part(uri:Uri, supplier:Uri)
+.input part
+
+.decl fact(part:Uri, key:Uri, value:Value)
+.input fact
+
+.decl warning(part:Uri, msg:symbol)
+.output warning
+
+.decl part_status(part:Uri, status:Value)
+.decl active(part:Uri)
+
+part_status(part, status) :- fact(part, "http://purl.org/ee/digikey-fact-key#1989", status).
+
+active(part) :- part_status(part, "Active").
+
+warning(part, cat("Not active from ", supplier)) :- part(part, supplier), !active(part).
+
+/*
+active(part) :- fact(part, "http://purl.org/ee/digikey-fact-key#1989", "Active").
+
+warning(part, "Not active") :-
+ fact(part, "http://purl.org/ee/digikey-fact-key#1989", status),
+ status != "Active".
+*/ \ No newline at end of file