Skip to content

Commit

Permalink
Adding language tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Siudalski authored and Tomasz Siudalski committed Nov 22, 2023
1 parent 02ea289 commit 4bd9c60
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions paper_model_to_ttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,16 @@ def convert_paper_model_to_graph(article_data: PaperModel):
add_to_graph(g, paper, frbr.realization, article, to_literal=False)

if article_data.language:
if article_data.language == "english":
language = "en-US"
else:
language = article_data.language
add_to_graph(
g, article, dc.language, article_data.language, datatype=XSD.string
g, article, dc.language, language, datatype=XSD.string
)

if article_data.license:
add_to_graph(g, article, dc.licence, article_data.license, datatype=XSD.anyURI)
add_to_graph(g, article, dc.license, article_data.license, datatype=XSD.anyURI)

add_to_graph(g, article, fabio.hasURL, article_data.url, datatype=XSD.anyURI)

Expand All @@ -217,7 +221,7 @@ def convert_paper_model_to_graph(article_data: PaperModel):
g, article, prism.pageCount, article_data.page_count, datatype=XSD.integer
)

add_to_graph(g, article, datacite.doi, article_data.doi, datatype=XSD.string)
add_to_graph(g, article, datacite.doi, article_data.doi, datatype=XSD.anyURI)

add_to_graph(g, article, owl.sameAs, URIRef(article_data.url), to_literal=False)

Expand Down

0 comments on commit 4bd9c60

Please sign in to comment.