67 271
contributi
mNessun oggetto della modifica |
(New loop to identify root class) |
||
Riga 221: | Riga 221: | ||
InstanceQ = Item.claims[Property][1].mainsnak.datavalue.value.id | InstanceQ = Item.claims[Property][1].mainsnak.datavalue.value.id | ||
--Initial setting | --Initial setting to calculate the root class of the item | ||
RootInstanceQ = InstanceQ | RootInstanceQ = InstanceQ | ||
--Loop only if the element is not a Class itself | --Loop only if the element is not a Class itself | ||
Riga 239: | Riga 239: | ||
RootInstance = mw.wikibase.getLabelByLang(RootInstanceQ, 'it') | RootInstance = mw.wikibase.getLabelByLang(RootInstanceQ, 'it') | ||
mw.smw.set("Istanza radice=" .. RootInstance) | mw.smw.set("Istanza radice=" .. RootInstance) | ||
-- | --If the item's root class is spaceship, then sets the name | ||
if RootInstance == "Astronave" or RootInstance == "Spaceship" then | if RootInstance == "Astronave" or RootInstance == "Spaceship" then | ||
--if InstanceQ == "Q876" or InstanceQ == "Q78" or InstanceQ == "Q890" then | --if InstanceQ == "Q876" or InstanceQ == "Q78" or InstanceQ == "Q890" then |