ogc-na 0.3.31__py3-none-any.whl → 0.3.33__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ogc-na might be problematic. Click here for more details.
- ogc/na/_version.py +2 -2
- ogc/na/annotate_schema.py +11 -9
- {ogc_na-0.3.31.dist-info → ogc_na-0.3.33.dist-info}/METADATA +2 -2
- {ogc_na-0.3.31.dist-info → ogc_na-0.3.33.dist-info}/RECORD +6 -6
- {ogc_na-0.3.31.dist-info → ogc_na-0.3.33.dist-info}/WHEEL +0 -0
- {ogc_na-0.3.31.dist-info → ogc_na-0.3.33.dist-info}/top_level.txt +0 -0
ogc/na/_version.py
CHANGED
ogc/na/annotate_schema.py
CHANGED
|
@@ -335,6 +335,7 @@ def resolve_context(ctx: Path | str | dict | list, expand_uris=True) -> Resolved
|
|
|
335
335
|
return ResolvedContext()
|
|
336
336
|
|
|
337
337
|
prefixes = {}
|
|
338
|
+
|
|
338
339
|
def expand_uri(curie, ctx_stack):
|
|
339
340
|
if not expand_uris or not ctx_stack or not curie or curie[0] == '@':
|
|
340
341
|
return curie
|
|
@@ -619,7 +620,7 @@ class ContextBuilder:
|
|
|
619
620
|
|
|
620
621
|
def __init__(self, location: Path | str = None,
|
|
621
622
|
compact: bool = True, ref_mapper: Callable[[str], str] | None = None,
|
|
622
|
-
version
|
|
623
|
+
version=1.1):
|
|
623
624
|
"""
|
|
624
625
|
:param location: file or URL load the annotated schema from
|
|
625
626
|
:param compact: whether to compact the resulting context (remove redundancies, compact CURIEs)
|
|
@@ -663,8 +664,8 @@ class ContextBuilder:
|
|
|
663
664
|
if subschema.get('type', 'object') != 'object':
|
|
664
665
|
return None
|
|
665
666
|
for prop, prop_val in subschema.get('properties', {}).items():
|
|
666
|
-
full_property_path = schema_path + [
|
|
667
|
-
full_property_path_str = f"{schema_path_str}/
|
|
667
|
+
full_property_path = schema_path + [prop]
|
|
668
|
+
full_property_path_str = f"{schema_path_str}/{prop}"
|
|
668
669
|
self.visited_properties[full_property_path_str] = None
|
|
669
670
|
if not isinstance(prop_val, dict):
|
|
670
671
|
continue
|
|
@@ -706,23 +707,23 @@ class ContextBuilder:
|
|
|
706
707
|
referenced_schema = self._resolver.resolve_schema(ref, from_schema)
|
|
707
708
|
if referenced_schema:
|
|
708
709
|
process_subschema(referenced_schema.subschema, referenced_schema, onto_context,
|
|
709
|
-
|
|
710
|
+
schema_path)
|
|
710
711
|
|
|
711
712
|
for i in ('allOf', 'anyOf', 'oneOf'):
|
|
712
713
|
l = subschema.get(i)
|
|
713
714
|
if isinstance(l, list):
|
|
714
715
|
for idx, sub_subschema in enumerate(l):
|
|
715
716
|
process_subschema(sub_subschema, from_schema, onto_context,
|
|
716
|
-
|
|
717
|
+
schema_path)
|
|
717
718
|
|
|
718
719
|
for i in ('prefixItems', 'items', 'contains', 'then', 'else', 'additionalProperties'):
|
|
719
720
|
l = subschema.get(i)
|
|
720
721
|
if isinstance(l, dict):
|
|
721
|
-
process_subschema(l, from_schema, onto_context, schema_path
|
|
722
|
+
process_subschema(l, from_schema, onto_context, schema_path)
|
|
722
723
|
|
|
723
724
|
for pp_k, pp in subschema.get('patternProperties', {}).items():
|
|
724
725
|
if isinstance(pp, dict):
|
|
725
|
-
process_subschema(pp, from_schema, onto_context, schema_path + [
|
|
726
|
+
process_subschema(pp, from_schema, onto_context, schema_path + [pp_k])
|
|
726
727
|
|
|
727
728
|
if ANNOTATION_EXTRA_TERMS in subschema:
|
|
728
729
|
for extra_term, extra_term_context in subschema[ANNOTATION_EXTRA_TERMS].items():
|
|
@@ -840,8 +841,8 @@ class ContextBuilder:
|
|
|
840
841
|
|
|
841
842
|
|
|
842
843
|
def dump_annotated_schema(schema: AnnotatedSchema, subdir: Path | str = 'annotated',
|
|
843
|
-
|
|
844
|
-
|
|
844
|
+
root_dir: Path | str | None = None,
|
|
845
|
+
output_fn_transform: Callable[[Path], Path] | None = None) -> None:
|
|
845
846
|
"""
|
|
846
847
|
Creates a "mirror" directory (named `annotated` by default) with the resulting
|
|
847
848
|
schemas annotated by a `SchemaAnnotator`.
|
|
@@ -941,6 +942,7 @@ def _main():
|
|
|
941
942
|
writer = csv.writer(stream, delimiter='\t')
|
|
942
943
|
writer.writerow(['path', '@id'])
|
|
943
944
|
writer.writerows(ctx_builder.visited_properties.items())
|
|
945
|
+
|
|
944
946
|
if args.dump_visited == '-':
|
|
945
947
|
write_visited(sys.stdout)
|
|
946
948
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.3.
|
|
2
|
+
Name: ogc_na
|
|
3
|
+
Version: 0.3.33
|
|
4
4
|
Summary: OGC Naming Authority tools
|
|
5
5
|
Author-email: Rob Atkinson <ratkinson@ogc.org>, Piotr Zaborowski <pzaborowski@ogc.org>, Alejandro Villar <avillar@ogc.org>
|
|
6
6
|
Project-URL: Homepage, https://github.com/opengeospatial/ogc-na-tools/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ogc/na/__init__.py,sha256=uzcNiJ3uKFNJ1HBfKxIwgAy2HMUFsLAe5RkrUg8ncac,464
|
|
2
|
-
ogc/na/_version.py,sha256=
|
|
3
|
-
ogc/na/annotate_schema.py,sha256=
|
|
2
|
+
ogc/na/_version.py,sha256=gG4AF8AndLXa7wrzi690B4552VXo2Y4q__jjiGcfCHI,413
|
|
3
|
+
ogc/na/annotate_schema.py,sha256=_4NnmW2JVADs8ni9xHFvCGfeD9Mw4dMD6tNq9GlGaQk,37625
|
|
4
4
|
ogc/na/domain_config.py,sha256=C6ao37dbXEKv_K7WcfzQgI3H1Hr3c4-3p24hgl2oH54,13896
|
|
5
5
|
ogc/na/download.py,sha256=2afrLyl4WsAlxkCgXsl47fs9mNKfDmhVpeT2iwNSoq0,3354
|
|
6
6
|
ogc/na/gsp.py,sha256=o_mwUG-FyDqLmA7Mx1eKkXqM7yX8BqxIwHuCS2eE1fo,5626
|
|
@@ -14,7 +14,7 @@ ogc/na/validation.py,sha256=5xjHH55NZKM8HtUk8XgVzm8W5ZlZY00u_qsWfXK_8dM,3732
|
|
|
14
14
|
ogc/na/input_filters/__init__.py,sha256=AhE7n_yECwxFKwOM3Jc0ft96TtF5i_Z-fHrS4HYOjaE,1179
|
|
15
15
|
ogc/na/input_filters/csv.py,sha256=nFfB1XQF_QApcGGzMqEvzD_b3pBtCtsfUECsZ9UGE6s,2616
|
|
16
16
|
ogc/na/input_filters/xml.py,sha256=XLy6FLewjjoDj6N4ZLVza2_rk6TVuMTwTleEMSbnRnc,1083
|
|
17
|
-
ogc_na-0.3.
|
|
18
|
-
ogc_na-0.3.
|
|
19
|
-
ogc_na-0.3.
|
|
20
|
-
ogc_na-0.3.
|
|
17
|
+
ogc_na-0.3.33.dist-info/METADATA,sha256=BQKpLkCbUWe9PJB7RLX6Ywuh5WSK3_lc4nIQTAoHcXU,3587
|
|
18
|
+
ogc_na-0.3.33.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
19
|
+
ogc_na-0.3.33.dist-info/top_level.txt,sha256=Kvy3KhzcIhNPT4_nZuJCmS946ptRr_MDyU4IIhZJhCY,4
|
|
20
|
+
ogc_na-0.3.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|