From 4389cc3b7f4fa8fc8c16025a47138cfbc5ce7d9d Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Fri, 5 Jul 2024 11:08:25 +0200 Subject: [PATCH] Process ldContext even when not annotating schema --- ogc/bblocks/postprocess.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ogc/bblocks/postprocess.py b/ogc/bblocks/postprocess.py index 9ea25f7..dcfdf59 100644 --- a/ogc/bblocks/postprocess.py +++ b/ogc/bblocks/postprocess.py @@ -130,6 +130,12 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool: bblock.metadata['ldContext'] = PathOrUrl(bblock.jsonld_context).with_base_url( base_url, cwd if base_url else output_file_root ) + elif bblock.metadata.get('ldContext') and not is_url(bblock.metadata['ldContext']): + # Unprocessed JSON-LD context instead of generated from annotations + ld_context_path = bblock.files_path / bblock.metadata['ldContext'] + bblock.metadata['ldContext'] = PathOrUrl(ld_context_path).with_base_url( + base_url, cwd if base_url else output_file_root + ) if bblock.output_openapi.is_file(): bblock.metadata['sourceOpenAPIDocument'] = bblock.openapi.with_base_url( base_url, cwd if base_url else output_file_root