Skip to content

Commit

Permalink
fix: Remove unecessary Identifier cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Murloc6 committed Nov 15, 2023
1 parent f453ec8 commit 97b8f18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions aas_core_codegen/jsonld/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down Expand Up @@ -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(
Expand All @@ -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}/"}
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 97b8f18

Please sign in to comment.