Skip to content

Commit

Permalink
fix unnecessary creation
Browse files Browse the repository at this point in the history
  • Loading branch information
LizzAlice committed Mar 21, 2024
1 parent b15d60b commit dc6e441
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
9 changes: 3 additions & 6 deletions mardi_importer/mardi_importer/openml/OpenMLDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,24 @@ def create(self):
return(dataset_id)

def insert_claims(self):
prop_nr = self.api.get_local_id_by_label("OpenML dataset ID", "property")
self.item.add_claim(prop_nr, self.dataset_id)
self.item.add_claim("wdt:P11238", self.dataset_id)
if self.version is not None and self.version != "None":
prop_nr = self.api.get_local_id_by_label("dataset version", "property")
self.item.add_claim(prop_nr, str(self.version))
if self.creators and self.creators != "None":
creator_claims = []
prop_nr = self.api.get_local_id_by_label("author name string", "property")
if not isinstance(self.creators, list):
self.creators = [self.creators]
for c in self.creators:
claim = self.api.get_claim(prop_nr, c)
claim = self.api.get_claim("wdt:P2093", c)
creator_claims.append(claim)
self.item.add_claims(creator_claims)
if self.contributors and self.contributors != "None":
contributor_claims = []
prop_nr = self.api.get_local_id_by_label("author name string", "property")
if not isinstance(self.contributors, list):
self.contributors = [self.contributors]
for c in self.contributors:
claim = self.api.get_claim(prop_nr, c)
claim = self.api.get_claim("wdt:P2093", c)
contributor_claims.append(claim)
self.item.add_claims(contributor_claims)
if self.collection_date and self.collection_date != "None":
Expand Down
10 changes: 0 additions & 10 deletions mardi_importer/mardi_importer/openml/new_entities.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
"description": "the number of classes",
"datatype": "quantity"
},
{
"label": "author name string",
"description": "name string of the author",
"datatype": "string"
},
{
"label": "number of features",
"description": "the number of features",
Expand Down Expand Up @@ -85,11 +80,6 @@
"description": "the number of symbolic features",
"datatype": "quantity"
},
{
"label": "OpenML dataset ID",
"description": "identifier for a dataset in the OpenML database of open datasets for machine learning",
"datatype": "string"
},
{
"label": "citation text",
"description": "free-form text about citation",
Expand Down

0 comments on commit dc6e441

Please sign in to comment.