aboutsummaryrefslogtreecommitdiff
path: root/src/ee/souffle
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/souffle')
-rw-r--r--src/ee/souffle/digikey.dl29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/ee/souffle/digikey.dl b/src/ee/souffle/digikey.dl
index 06123ea..940e31d 100644
--- a/src/ee/souffle/digikey.dl
+++ b/src/ee/souffle/digikey.dl
@@ -2,5 +2,30 @@
.output fact
-fact(part, "http://purl.org/ee/fact-type/footprint", "1005") :-
- fact(part, "http://purl.org/ee/digikey-fact-key#16", "0402 (1005 Metric)").
+#define RESISTANCE "http://purl.org/ee/digikey-fact-key#2085"
+#define CAPACITANCE "http://purl.org/ee/digikey-fact-key#2049"
+#define SURFACE_MOUNT_LAND_SIZE "http://purl.org/ee/digikey-fact-key#884"
+#define PACKAGE "http://purl.org/ee/digikey-fact-key#16"
+#define MOUNTING_TYPE "http://purl.org/ee/digikey-fact-key#69"
+
+/*
+I though this rule would be good enough, but I keep on getting errors like this:
+
+warning: wrong index position provided by substr("DO-21",6,5) functor.
+
+fact(part, "http://purl.org/ee/fact-type/footprint", res) :-
+ fact(part, PACKAGE, package),
+ match(".*\([0-9][0-9][0-9][0-9] Metric\)", package),
+ res_ = substr(package, 0, strlen(package)-8),
+ res = substr(res_, 6, strlen(res_))
+ .
+*/
+
+.decl dk_to_ipc(dk:symbol, ipc:symbol)
+
+dk_to_ipc("0402 (1005 Metric)", "1005").
+dk_to_ipc("0805 (2012 Metric)", "2012").
+
+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).