Skip to content

Commit

Permalink
Output visited nodes on context building
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Dec 18, 2023
1 parent ac3a96e commit 1f3539d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ogc/bblocks/util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import csv
import dataclasses
import functools
import hashlib
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 1f3539d

Please sign in to comment.