#include "facts.dl" .output fact #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"). dk_to_ipc("1206 (3216 Metric)", "3216"). dk_to_ipc("1812 (4532 Metric)", "4532"). 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).