From 1f3539d554d3741826807e3ac2479b64995d1755 Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Mon, 18 Dec 2023 10:50:51 +0100 Subject: [PATCH] Output visited nodes on context building --- ogc/bblocks/util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ogc/bblocks/util.py b/ogc/bblocks/util.py index 9d53d3a..d2ffa27 100644 --- a/ogc/bblocks/util.py +++ b/ogc/bblocks/util.py @@ -1,5 +1,6 @@ from __future__ import annotations +import csv import dataclasses import functools import hashlib @@ -472,6 +473,11 @@ def write_jsonld_context(annotated_schema: Path) -> Path | None: context_fn = annotated_schema.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: + writer = csv.writer(f, delimiter='\t') + writer.writerow(['path', '@id']) + for e in ctx_builder.visited_properties.items(): + writer.writerow(e) return context_fn