#include "facts.dl" #include "kicad-mpn.dl" .decl add_fact(part_uri:symbol, key:symbol, value:symbol) .output add_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"). 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). 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). 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). // Net ties and test points should probably not be marked as components to buy. Test points is possible to buy and // install so that needs to be an option. .decl net_tie_symbol(lib:symbol, name:symbol) net_tie_symbol("Device", "Net-Tie_2"). net_tie_symbol("Device", "Net-Tie_3"). net_tie_symbol("Device", "Net-Tie_3_Tee"). net_tie_symbol("Device", "Net-Tie_4"). net_tie_symbol("Device", "Net-Tie_4_Cross"). 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). .decl test_point_symbol(lib:symbol, name:symbol) test_point_symbol("Connector", "TestPoint"). test_point_symbol("Connector", "TestPoint_2Pole"). test_point_symbol("Connector", "TestPoint_Alt"). test_point_symbol("Connector", "TestPoint_Flag"). test_point_symbol("Connector", "TestPoint_Probe"). 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).