Skip to content

Commit

Permalink
Fixed vivo locale bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmrsulja committed Sep 27, 2024
1 parent 2949d51 commit d9b11b4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions sample-data-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,17 @@ def main():
if nw_uri % 10 == 0:
print("Adding coauthors for work", nw_uri)

f = open("sample-data.ttl", "w")
print(g.serialize(format="ttl"), file=f)
stop = time.time()
print(site_dns, "1 University;", n_colleges, "colleges;", n_departments, "departments;", n_people, "people;",
n_works, "works;", n_projects, "projects;", n_grants, "grants;", n_equipment, "units of equipment;", len(g), "triples in language", lang, "{:.2f} seconds".format(stop - start))
return
with open("sample-data.ttl", "w") as f:
triples_string = g.serialize(format="ttl")

for language_tag in content_langs:
language_tag_vivo_locale = language_tag.replace("_", "-")
triples_string = triples_string.replace(language_tag, language_tag_vivo_locale)

print(triples_string, file=f)
stop = time.time()
print(site_dns, "1 University;", n_colleges, "colleges;", n_departments, "departments;", n_people, "people;",
n_works, "works;", n_projects, "projects;", n_grants, "grants;", n_equipment, "units of equipment;", len(g), "triples in language", lang, "{:.2f} seconds".format(stop - start))


if __name__ == "__main__":
Expand Down

0 comments on commit d9b11b4

Please sign in to comment.