diff --git a/src/rdf-mappings/functions.py b/src/rdf-mappings/functions.py index acf3d5d724bfed82fa29b0828559c3fa2ec6c0c5..1ab5d981824e4fa2e1cb9fe1eca792762f2829eb 100644 --- a/src/rdf-mappings/functions.py +++ b/src/rdf-mappings/functions.py @@ -39,9 +39,9 @@ def serialize_graph(g, output_file_list): print(f'Created {output_rdf_path}') -def clean_class_name_string(input_string): +def clean_iri_name_string(input_string): """ - Cleans string that is to be used as a class name from unwanted characters. + Cleans a given string from unwanted characters so that is to be used as part of an IRI/URI (e.g. as a class name). """ char_list = ["'", '"', '.', '+', ',', '*', '&', '/', '=', '’', ';', ':' '¨', '#', '?', '\n', '(', ')', '<', '>', '{', '}', '!', '°'] diff --git a/src/rdf-mappings/map-tblArmItems.py b/src/rdf-mappings/map-tblArmItems.py index 74b4bac0961a8376a8459101a09fdcc39ae2fce0..c822a430a42ca62525ce78123805b7793ff0a830 100644 --- a/src/rdf-mappings/map-tblArmItems.py +++ b/src/rdf-mappings/map-tblArmItems.py @@ -50,8 +50,8 @@ def create_identified_entity(row): # Check if string starts with a letter if not pd.isnull(row['ArmIdf']) and re.search("^[a-zA-Z]", new_class_name) is not None: - new_class_name = functions.clean_class_name_string(new_class_name) - new_class_name = str(new_class_name).title() + new_class_name = functions.clean_iri_name_string(new_class_name) + new_class_name = str(new_class_name).title() # Capitalize all words in the name new_class_name = new_class_name.replace(' ', '') new_entity_node = URIRef(dho_ent_n + new_class_name)