Skip to content

Commit

Permalink
Replace empty_properties with missed_properties
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Feb 19, 2024
1 parent deec80f commit 511c713
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ogc/bblocks/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 5 additions & 6 deletions ogc/bblocks/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 511c713

Please sign in to comment.