Skip to content
Snippets Groups Projects
Commit 835d8ac9 authored by Philipp Schneider's avatar Philipp Schneider
Browse files

Make code docu more explicit

parent d3b5f57a
No related branches found
No related tags found
No related merge requests found
......@@ -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', '(', ')', '<', '>', '{', '}', '!', '°']
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment