Skip to content

Commit

Permalink
don't call get_prop_types (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 authored Jul 27, 2024
1 parent 5b3edd5 commit 915fc83
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions archeutils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ def get_prop_types(repo_schema_url=repo_schema):
return prop_types


ARCHE_PROPS_LOOKUP = get_prop_types()


def serialize_project():
g = Graph()
sub = URIRef(f"{ARCHE_BASE_URL}")
Expand All @@ -79,7 +76,7 @@ def serialize_project():
(proj_sub, acdh_ns.hasDescription, Literal(f"{PROJECT_DESC}", lang=ARCHE_LANG))
)
for const in ARCHE_CONST_MAPPINGS:
arche_prop_domain = ARCHE_PROPS_LOOKUP.get(const[0], "No Match")
arche_prop_domain = get_prop_types().get(const[0], "No Match")
if arche_prop_domain == "date":
proj_g.add(
(proj_sub, acdh_ns[const[0]], Literal(const[1], datatype=XSD.date))
Expand Down Expand Up @@ -239,7 +236,7 @@ def serialize_project():
g.add((sub, acdh_ns.hasCreator, pmarck))
g.add((sub, acdh_ns.hasDescription, Literal(f"{TOP_COL_DESC}", lang=ARCHE_LANG)))
for const in ARCHE_CONST_MAPPINGS_SIMPLE:
arche_prop_domain = ARCHE_PROPS_LOOKUP.get(const[0], "No Match")
arche_prop_domain = get_prop_types().get(const[0], "No Match")
if arche_prop_domain == "date":
g.add((sub, acdh_ns[const[0]], Literal(const[1], datatype=XSD.date)))
if arche_prop_domain == "string":
Expand Down Expand Up @@ -411,7 +408,7 @@ def as_arche_graph(res):
)
)
for const in ARCHE_CONST_MAPPINGS_SIMPLE:
arche_prop_domain = ARCHE_PROPS_LOOKUP.get(const[0], "No Match")
arche_prop_domain = get_prop_types().get(const[0], "No Match")
if arche_prop_domain == "date":
col.add()
g.add((sub, acdh_ns[const[0]], Literal(const[1], datatype=XSD.date)))
Expand Down Expand Up @@ -453,7 +450,7 @@ def title_img():
)
g.add((sub, acdh_ns.isTitleImageOf, URIRef(f"{ARCHE_BASE_URL}")))
for const in ARCHE_CONST_MAPPINGS_SIMPLE:
arche_prop_domain = ARCHE_PROPS_LOOKUP.get(const[0], "No Match")
arche_prop_domain = get_prop_types().get(const[0], "No Match")
if arche_prop_domain == "date":
g.add((sub, acdh_ns[const[0]], Literal(const[1], datatype=XSD.date)))
if arche_prop_domain == "string":
Expand Down

0 comments on commit 915fc83

Please sign in to comment.