Skip to content

Commit

Permalink
Merge pull request #129 from MaRDI4NFDI/zbmath_profile_type
Browse files Browse the repository at this point in the history
add profile types
  • Loading branch information
LizzAlice authored Mar 18, 2024
2 parents b672260 + 3bf88ce commit 92a4925
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mardi_importer/mardi_importer/zbmath/ZBMathAuthor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def init_item(self):
item.labels.set(language="en", value=self.name)
# instance of: human
item.add_claim("wdt:P31", "wd:Q5")
profile_prop = self.api.get_local_id_by_label("MaRDI profile type", "property")
profile_target = self.api.get_local_id_by_label("MaRDI person profile", "item")[
0
]
item.add_claim(profile_prop, profile_target)
if self.zbmath_author_id:
# if self.name:
# # is there a human with zbmath author ID = zbmath_author_id
Expand Down
10 changes: 9 additions & 1 deletion mardi_importer/mardi_importer/zbmath/ZBMathPublication.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ def __init__(
def init_item(self):
item = self.api.item.new()
item.labels.set(language="en", value=self.title)
item.descriptions.set(language="en", value=f"scientific article; zbMATH DE number {self.de_number}")
item.descriptions.set(
language="en",
value=f"scientific article; zbMATH DE number {self.de_number}",
)
return item

def create(self):
Expand Down Expand Up @@ -137,6 +140,11 @@ def insert_claims(self):
claim = self.api.get_claim(self.keyword_prop, k)
kw_claims.append(claim)
self.item.add_claims(kw_claims)
profile_prop = self.api.get_local_id_by_label("MaRDI profile type", "property")
profile_target = self.api.get_local_id_by_label(
"MaRDI publication profile", "item"
)[0]
self.item.add_claim(profile_prop, profile_target)

def exists(self):
"""Checks if a WB item corresponding to the publication already exists.
Expand Down

0 comments on commit 92a4925

Please sign in to comment.