Skip to content

Commit

Permalink
remove sitelinks for imported entities
Browse files Browse the repository at this point in the history
  • Loading branch information
eloiferrer committed Oct 30, 2024
1 parent 6f068d8 commit 1ec7323
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mardi_importer/mardi_importer/integrator/MardiIntegrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .MardiEntities import MardiItemEntity, MardiPropertyEntity
from mardiclient import MardiClient
from wikibaseintegrator import wbi_login
from wikibaseintegrator.models import Claim, Claims, Qualifiers, Reference
from wikibaseintegrator.models import Claim, Claims, Qualifiers, Reference, Sitelinks
from wikibaseintegrator.wbi_config import config as wbi_config
from wikibaseintegrator.wbi_enums import ActionIfExists
from wikibaseintegrator.wbi_helpers import search_entities, execute_sparql_query
Expand Down Expand Up @@ -300,6 +300,7 @@ def import_entities(self, id_list=None, filename="", recurse=True):
self.insert_id_in_db(wikidata_id, local_id, has_all_claims=recurse)
else:
# Create entity
entity.sitelinks = Sitelinks()
local_id = entity.write(login=self.login, as_new=True).id
self.insert_id_in_db(wikidata_id, local_id, has_all_claims=recurse)

Expand Down Expand Up @@ -418,6 +419,7 @@ def import_claim_entities(self, wikidata_id):
local_id = entity.write(login=self.login).id
else:
entity.add_linker_claim(wikidata_id)
entity.sitelinks = Sitelinks()
local_id = entity.write(login=self.login, as_new=True).id

self.insert_id_in_db(wikidata_id, local_id, has_all_claims=False)
Expand Down

0 comments on commit 1ec7323

Please sign in to comment.