aboutsummaryrefslogtreecommitdiff
path: root/src/ee/souffle
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-27 15:16:12 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-27 15:16:12 +0200
commitd8bb3aa6f51b331ef6ce3558707627be7a50c7ad (patch)
tree780e426f8286fe9223d1fa6235464868bbef3d7c /src/ee/souffle
parent94e8537430ab7496e4b8e697581d65b06cf8b979 (diff)
downloadee-python-d8bb3aa6f51b331ef6ce3558707627be7a50c7ad.tar.gz
ee-python-d8bb3aa6f51b331ef6ce3558707627be7a50c7ad.tar.bz2
ee-python-d8bb3aa6f51b331ef6ce3558707627be7a50c7ad.tar.xz
ee-python-d8bb3aa6f51b331ef6ce3558707627be7a50c7ad.zip
souffle:
o Allowing to set MPNs when importing facts. o ninja: Allowing the user to have its own datalog files under ee/custom/kicad-souffle.dl and ee/custom/$supplier-souffle.dl. make_bom: Generate per-field URIs for custom URIs. Better than making values that contain custom field name + value.
Diffstat (limited to 'src/ee/souffle')
-rw-r--r--src/ee/souffle/digikey.dl3
-rw-r--r--src/ee/souffle/kicad-mpn.dl8
-rw-r--r--src/ee/souffle/kicad.dl1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/ee/souffle/digikey.dl b/src/ee/souffle/digikey.dl
index 735dd2d..06123ea 100644
--- a/src/ee/souffle/digikey.dl
+++ b/src/ee/souffle/digikey.dl
@@ -1,3 +1,6 @@
#include "facts.dl"
.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)").
diff --git a/src/ee/souffle/kicad-mpn.dl b/src/ee/souffle/kicad-mpn.dl
new file mode 100644
index 0000000..5f92dd9
--- /dev/null
+++ b/src/ee/souffle/kicad-mpn.dl
@@ -0,0 +1,8 @@
+.decl mpn(part:symbol, mpn:symbol)
+.output mpn
+
+mpn(part, value) :-
+ fact(part, "http://purl.org/ee/kicad-sch-custom-fact-type#mpn", value).
+
+mpn(part, value) :-
+ fact(part, "http://purl.org/ee/kicad-sch-custom-fact-type#MPN", value).
diff --git a/src/ee/souffle/kicad.dl b/src/ee/souffle/kicad.dl
index 5448b05..16b76dd 100644
--- a/src/ee/souffle/kicad.dl
+++ b/src/ee/souffle/kicad.dl
@@ -1,4 +1,5 @@
#include "facts.dl"
+#include "kicad-mpn.dl"
.output fact