aboutsummaryrefslogtreecommitdiff
path: root/src/ee/souffle
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/souffle')
-rw-r--r--src/ee/souffle/digikey.dl7
-rw-r--r--src/ee/souffle/kicad.dl13
2 files changed, 11 insertions, 9 deletions
diff --git a/src/ee/souffle/digikey.dl b/src/ee/souffle/digikey.dl
index 5073e4d..e168db9 100644
--- a/src/ee/souffle/digikey.dl
+++ b/src/ee/souffle/digikey.dl
@@ -1,6 +1,7 @@
#include "facts.dl"
-.output fact
+.decl add_fact(part_uri:symbol, key:symbol, value:symbol)
+.output add_fact
#define RESISTANCE "http://purl.org/ee/digikey-fact-key#2085"
#define CAPACITANCE "http://purl.org/ee/digikey-fact-key#2049"
@@ -31,7 +32,7 @@ dk_to_ipc("0805 (2012 Metric)", "2012").
dk_to_ipc("1206 (3216 Metric)", "3216").
dk_to_ipc("1812 (4532 Metric)", "4532").
-fact(part, "http://purl.org/ee/fact-type/footprint", ipc) :-
+add_fact(part, "http://purl.org/ee/fact-type/footprint", ipc) :-
fact(part, "http://purl.org/ee/digikey-fact-key#16", dk),
dk_to_ipc(dk, ipc).
@@ -41,6 +42,6 @@ supplier_device_package_to_footprint("Mini-Dip (TO-269AA)", "TO-269AA").
supplier_device_package_to_footprint("SMA (DO-214AC)", "SMA").
supplier_device_package_to_footprint("SOD-323", "SOD-323").
-fact(part, "http://purl.org/ee/fact-type/footprint", footprint) :-
+add_fact(part, "http://purl.org/ee/fact-type/footprint", footprint) :-
fact(part, SUPPLIER_DEVICE_PACKAGE, dk),
supplier_device_package_to_footprint(dk, footprint).
diff --git a/src/ee/souffle/kicad.dl b/src/ee/souffle/kicad.dl
index f176dd4..ed9bf4a 100644
--- a/src/ee/souffle/kicad.dl
+++ b/src/ee/souffle/kicad.dl
@@ -1,7 +1,8 @@
#include "facts.dl"
#include "kicad-mpn.dl"
-.output fact
+.decl add_fact(part_uri:symbol, key:symbol, value:symbol)
+.output add_fact
/*
.decl is_resistor(uri:symbol)
@@ -31,15 +32,15 @@ capacitor_lib("Capacitor_SMD").
.decl inductor_lib(name:symbol)
inductor_lib("Inductor_SMD").
-fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#resistor") :-
+add_fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#resistor") :-
resistor_lib(lib),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
-fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#capacitor") :-
+add_fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#capacitor") :-
capacitor_lib(lib),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
-fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#inductor") :-
+add_fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#inductor") :-
inductor_lib(lib),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
@@ -53,7 +54,7 @@ net_tie_symbol("Device", "Net-Tie_3_Tee").
net_tie_symbol("Device", "Net-Tie_4").
net_tie_symbol("Device", "Net-Tie_4_Cross").
-fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#net-tie") :-
+add_fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#net-tie") :-
net_tie_symbol(lib, name),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#symbol-library", lib),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#symbol-name", name).
@@ -65,7 +66,7 @@ test_point_symbol("Connector", "TestPoint_Alt").
test_point_symbol("Connector", "TestPoint_Flag").
test_point_symbol("Connector", "TestPoint_Probe").
-fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#test-point") :-
+add_fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#test-point") :-
test_point_symbol(lib, name),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#symbol-library", lib),
fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#symbol-name", name).