From 0259c6f907875b54e5d1df4bc89efa1c293d2812 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 27 May 2019 08:52:38 +0200 Subject: Adding Soufflé based reasoning on parts. Replacing default configuration with applying python function with this new reasoner. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/souffle/test.souffle | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/souffle/test.souffle (limited to 'test') 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 -- cgit v1.2.3