Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DHO Knowledge Graph Data Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital History
Digital History Forschung
Digital Heraldry
DHO Knowledge Graph Data Integration
Commits
835d8ac9
Commit
835d8ac9
authored
1 year ago
by
Philipp Schneider
Browse files
Options
Downloads
Patches
Plain Diff
Make code docu more explicit
parent
d3b5f57a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rdf-mappings/functions.py
+2
-2
2 additions, 2 deletions
src/rdf-mappings/functions.py
src/rdf-mappings/map-tblArmItems.py
+2
-2
2 additions, 2 deletions
src/rdf-mappings/map-tblArmItems.py
with
4 additions
and
4 deletions
src/rdf-mappings/functions.py
+
2
−
2
View file @
835d8ac9
...
...
@@ -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
'
,
'
(
'
,
'
)
'
,
'
<
'
,
'
>
'
,
'
{
'
,
'
}
'
,
'
!
'
,
'
°
'
]
...
...
This diff is collapsed.
Click to expand it.
src/rdf-mappings/map-tblArmItems.py
+
2
−
2
View file @
835d8ac9
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment