aboutsummaryrefslogtreecommitdiff
path: root/trygvis/eda/cli/make_bom.py
diff options
context:
space:
mode:
Diffstat (limited to 'trygvis/eda/cli/make_bom.py')
-rwxr-xr-xtrygvis/eda/cli/make_bom.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/trygvis/eda/cli/make_bom.py b/trygvis/eda/cli/make_bom.py
index 7805ead..a47e04a 100755
--- a/trygvis/eda/cli/make_bom.py
+++ b/trygvis/eda/cli/make_bom.py
@@ -22,11 +22,11 @@ class Component(object):
self.fields[field_name] = field_value
-def run(schematic_url):
- cli.with_database(lambda g: work(schematic_url, g))
+def run(project_url):
+ cli.with_database(lambda g: work(project_url, g))
-def work(schematic_url, g):
+def work(project_url, g):
components = {}
dk_parts = {}
@@ -36,14 +36,14 @@ def work(schematic_url, g):
SELECT
?ref ?value
WHERE {
- ?schematic a kicad-type:schematic ;
+ ?project a kicad-type:project ;
kicad:component ?cmp .
?cmp a kicad-type:schematic_component ;
kicad:value ?value ;
rdfs:label ?ref .
}
ORDER BY ?ref
-""", init_bindings={"schematic": rdflib.URIRef(schematic_url)})
+""", init_bindings={"project": rdflib.URIRef(project_url)})
for row in res:
c = Component(row.ref, row.value)
@@ -55,7 +55,7 @@ ORDER BY ?ref
SELECT
?ref ?field ?field_name ?field_value
WHERE {
- ?schematic a kicad-type:schematic ;
+ ?project a kicad-type:project ;
kicad:component ?cmp .
?cmp a kicad-type:schematic_component ;
rdfs:label ?ref ;
@@ -64,7 +64,7 @@ WHERE {
?field a kicad-type:field ; kicad:field_value ?field_value .
}
ORDER BY ?ref ?field_name
-""", init_bindings={"schematic": rdflib.URIRef(schematic_url)})
+""", init_bindings={"project": rdflib.URIRef(project_url)})
for row in res:
c = components[row.ref]
@@ -72,12 +72,12 @@ ORDER BY ?ref ?field_name
c.set_field(row.field_name, row.field_value)
cli.info('%5s: %-20s %s' % (c.ref, row.field_name + ':', row.field_value))
- cli.info("Loading Digi-Key parts for schematic")
+ cli.info("Loading Digi-Key parts for project")
res = cli.sparql(g, """
SELECT
?ref ?part_number ?type ?value ?attr_type
WHERE {
- ?schematic kicad:component ?cmp .
+ ?project kicad:component ?cmp .
?cmp a kicad-type:schematic_component ;
rdfs:label ?ref ;
kicad:field ?d .
@@ -93,7 +93,7 @@ WHERE {
dk:value ?attr_value .
}
ORDER BY ?ref ?attr_type ?attr_value
-""", init_bindings={"schematic": rdflib.URIRef(schematic_url)})
+""", init_bindings={"project": rdflib.URIRef(project_url)})
for row in res:
pn = row.part_number
@@ -113,7 +113,7 @@ SELECT
?ref ?footprint ?part_number ?package_value ?case_value
# *
WHERE {
- ?schematic kicad:component ?cmp .
+ ?project kicad:component ?cmp .
?cmp a kicad-type:schematic_component ;
rdfs:label ?ref ;
kicad:field ?dk_field .
@@ -138,12 +138,12 @@ WHERE {
# ?case_type a dk:attributeType ; dk:value ?case_url .
# } .
-# VALUES (?schematic_url) { (<https://trygvis/purl/kicad-board#SweetZpot+Sensor>) } .
+# VALUES (?project_url) { (<https://trygvis/purl/kicad-board#SweetZpot+Sensor>) } .
# VALUES (?package_type) { (dk-attr-type:pv16) } .
# VALUES (?case_type) { (dk-attr-type:pv1291) } .
}
ORDER BY ?ref
-""", init_bindings={"schematic": rdflib.URIRef(schematic_url),
+""", init_bindings={"project": rdflib.URIRef(project_url),
"package_type": digikey_rdf.DIGIKEY_ATTRIBUTE_TYPE["pv16"],
"cast_type": digikey_rdf.DIGIKEY_ATTRIBUTE_TYPE["pv1291"]})