From 4afac7dc4c743284e5243428f00928aa7eaacfdc Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 15 May 2019 22:08:37 +0200 Subject: ee.project: Making sure all projects have an UUID. kicad-make-bom: Using the project's UUID to generate an URL for all parts. --- src/ee/xml/uris.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ee/xml') diff --git a/src/ee/xml/uris.py b/src/ee/xml/uris.py index bb961df..355df83 100644 --- a/src/ee/xml/uris.py +++ b/src/ee/xml/uris.py @@ -1,4 +1,5 @@ -from typing import Optional +import uuid +from typing import Optional, Union # Values for `..#ee-component-type` facts CAPACITOR = "http://purl.org/ee/part-type#capacitor" @@ -32,3 +33,7 @@ _FACT_KEY_PREFIX = "http://purl.org/trygvis/ee/fact-key#" def make_fact_key(name: str) -> str: return "{}{}".format(_FACT_KEY_PREFIX, name) + + +def make_schematic_part_uri(project: Union[str, uuid.UUID], schematic_reference: str) -> str: + return "http://purl.org/trygvis/ee/project/{}#{}".format(project, schematic_reference) -- cgit v1.2.3