From 97b8f189f3da72fd0695f842fc6453b9aae5520a Mon Sep 17 00:00:00 2001 From: Fabien Amarger <881739+Murloc6@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:43:55 +0100 Subject: [PATCH] fix: Remove unecessary Identifier cast --- aas_core_codegen/jsonld/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aas_core_codegen/jsonld/main.py b/aas_core_codegen/jsonld/main.py index 807bf2b0f..557180932 100644 --- a/aas_core_codegen/jsonld/main.py +++ b/aas_core_codegen/jsonld/main.py @@ -44,8 +44,8 @@ def _property_uri(prop: intermediate.Property) -> Stripped: """Generate a JSON-LD URI corresponding to the property.""" - property_vocab = rdf_shacl_naming.class_name(Identifier(prop.specified_for.name)) - prop_uri_fragment = rdf_shacl_naming.property_name(Identifier(prop.name)) + property_vocab = rdf_shacl_naming.class_name(prop.specified_for.name) + prop_uri_fragment = rdf_shacl_naming.property_name(prop.name) return Stripped(f"aas:{property_vocab}/{prop_uri_fragment}") @@ -126,8 +126,8 @@ def _generate_for_property( # This is necessary for mypy. assert name_set_of_exported_properties is not None - property_vocab = rdf_shacl_naming.class_name(Identifier(prop.specified_for.name)) - prop_uri_fragment = rdf_shacl_naming.property_name(Identifier(prop.name)) + property_vocab = rdf_shacl_naming.class_name(prop.specified_for.name) + prop_uri_fragment = rdf_shacl_naming.property_name(prop.name) property_uri = f"aas:{property_vocab}/{prop_uri_fragment}" rdfs_range = rdf_shacl_common.rdfs_range_for_type_annotation( @@ -147,7 +147,7 @@ def _generate_for_property( if isinstance(underlying_atomic_type_annotation, intermediate.Enumeration): enum_fragment = rdf_shacl_naming.class_name( - Identifier(underlying_atomic_type_annotation.name) + underlying_atomic_type_annotation.name ) property_json_ld_context["@context"] = cast( JsonLdType, {"@vocab": f"aas:{enum_fragment}/"} @@ -257,7 +257,7 @@ def _generate_class_context( class_context_definition: JsonLdType = {} class_name = naming.json_model_type(cls.name) - uri_fragment = rdf_shacl_naming.class_name((Identifier(cls.name))) + uri_fragment = rdf_shacl_naming.class_name(cls.name) class_context_definition[class_name] = { "@id": uri_fragment, "@context": {