From 511c71377d2cb8187d14b5ba55aea1eb84c03d40 Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Mon, 19 Feb 2024 20:39:14 +0100 Subject: [PATCH] Replace empty_properties with missed_properties --- ogc/bblocks/postprocess.py | 2 +- ogc/bblocks/util.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ogc/bblocks/postprocess.py b/ogc/bblocks/postprocess.py index 715f0c5..64e7e38 100644 --- a/ogc/bblocks/postprocess.py +++ b/ogc/bblocks/postprocess.py @@ -211,7 +211,7 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool: for p in itertools.chain((filter_p,), filter_p.parents): p = p.resolve() for bb in bbr.bblocks.values(): - if p in (bb.files_path, bb.tests_dir.resolve(), bb.annotated_path.resolve_ref()): + if p in (bb.files_path, bb.tests_dir.resolve(), bb.annotated_path.resolve()): filter_id = bb.identifier break if filter_id: diff --git a/ogc/bblocks/util.py b/ogc/bblocks/util.py index 48f3aa0..7a6d99c 100644 --- a/ogc/bblocks/util.py +++ b/ogc/bblocks/util.py @@ -678,16 +678,15 @@ def write_jsonld_context(annotated_schema: Path | str, bblocks_register: Buildin context_fn = annotated_schema.resolve().parent / 'context.jsonld' with open(context_fn, 'w') as f: json.dump(ctx_builder.context, f, indent=2) - with open(context_fn.parent / '_visited_properties.tsv', 'w', newline='') as f, \ - open(context_fn.parent / '_empty_properties.tsv', 'w', newline='') as fe: + with open(context_fn.parent / '_visited_properties.tsv', 'w', newline='') as f: writer = csv.writer(f, delimiter='\t') writer.writerow(['path', '@id']) - fe.write('path\n') - for e in ctx_builder.visited_properties.items(): writer.writerow(e) - if not e[1]: - fe.write(f"{e[0]}\n") + with open(context_fn.parent / '_missed_properties.tsv', 'w', newline='') as fm: + fm.write('path\n') + for mp in ctx_builder.missed_properties: + fm.write(f"{mp}\n") return context_fn