aboutsummaryrefslogtreecommitdiff
path: root/src/ee/souffle
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/souffle')
-rw-r--r--src/ee/souffle/digikey.dl3
-rw-r--r--src/ee/souffle/kicad.dl43
2 files changed, 46 insertions, 0 deletions
diff --git a/src/ee/souffle/digikey.dl b/src/ee/souffle/digikey.dl
new file mode 100644
index 0000000..735dd2d
--- /dev/null
+++ b/src/ee/souffle/digikey.dl
@@ -0,0 +1,3 @@
+#include "facts.dl"
+
+.output fact
diff --git a/src/ee/souffle/kicad.dl b/src/ee/souffle/kicad.dl
new file mode 100644
index 0000000..5448b05
--- /dev/null
+++ b/src/ee/souffle/kicad.dl
@@ -0,0 +1,43 @@
+#include "facts.dl"
+
+.output fact
+
+/*
+.decl is_resistor(uri:symbol)
+.decl is_capacitor(uri:symbol)
+.decl is_inductor(uri:symbol)
+
+is_resistor(Ref) :-
+ resistor_lib(lib).
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+
+is_capacitor(Ref) :-
+ capacitor_lib(lib).
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+
+is_inductor(Ref) :-
+ inductor_lib(lib).
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+*/
+
+.decl resistor_lib(name:symbol)
+resistor_lib("Resistor_SMD").
+resistor_lib("Resistor_THT").
+
+.decl capacitor_lib(name:symbol)
+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") :-
+ 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") :-
+ 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") :-
+ inductor_lib(lib),
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).