aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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