Modulo:Collegamenti esterni/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
controllo template
Omega Bot (discussione | contributi)
m Bot: rimuovo no globals obsoleto
 
(32 versioni intermedie di 3 utenti non mostrate)
Riga 3:
]]--
 
require('Modulo:No globalsstrict')
 
local getArgs = require('Modulo:Arguments').getArgs
Riga 11:
-- Permette di definire l'ordine di visualizzazione dei vari gruppi
local orderedGroupNames = {
'sandbox/Test',
'Ufficiali', 'Enciclopedie', 'Biografie', 'Testi',
'Letteratura', 'Politica', 'Religione', 'Architettura',
'Astronomia', 'Biologia', 'Editoria', 'Geografia',
'Linguistica', 'MAB', 'Matematica', 'Software', 'Calcio', 'Sci',
'Sport/sandbox', 'Videogiochi', 'Musica', 'Fumetti', 'Cinema'
}
-- Soglie di attenzione sul numero elevato di collegamenti, per categorie di controllo
Line 29 ⟶ 28:
local catUnknownQual = 'Voci con template Collegamenti esterni e qualificatori sconosciuti'
local catExcessiveLoad = 'Voci con template Collegamenti esterni e molte entità Wikidata caricate'
local catDuplicates = 'Voci con template Collegamenti esterni e doppioni disattivati'
-- Avvisi per i link omessi
local tmpFound = 'Link visibile solo nell\'anteprima della pagina. È già presente il template $1'
local tmpSection = 'Questo link potrebbe essere visibile solo nell\'anteprima della pagina se in altre sezioni c\'è già uno dei seguenti template: $1'
-- Tabella dei qualificatori riconosciuti
-- Qui vanno elencati solo quelli generali, validi per tutte le dichiarazioni
-- Ciascuno ha la sua configurazione che può essere lasciata vuota o compilata come di seguito:
-- "par" è il parametro del modulo Citazione da compilare col qualificatore
-- "fallback" è una sottotabella coi qualificatori di ripiego in ordine di priorità
-- "restricted" è true se il qualificatore impone una citazione diversa per url a stesso sito
local knownQualifiers = {
-- item o stringa dell'autore
P50 = { par = 'autore', fallback = { 'P2093' }, restricted = true },
P478 = { par = 'volume', restricted = true },
P304 = { par = 'pagina', restricted = true },
P577 = { par = 'data', restricted = true },
-- titolo o "indicato come" o "riferito come" o pseudonimo
P1476 = { par = 'titolo', fallback = { 'P1810', 'P1932', 'P742', 'P554' } },
-- url archiviato, solo per le proprietà di tipo URL
P1065 = { par = 'archivio' }, P2960 = { par = 'dataarch' }, P582 = { par = 'urlmorto' },
P407 = {}, P813 = {}
}
-- I qualificatori di ripiego sono automaticamente aggiunti con configurazione vuota
for _, t in pairs(knownQualifiers) do
if t.fallback then
for _, v in ipairs(t.fallback) do knownQualifiers[v] = {} end
end
end
 
-- =============================================================================
Line 115 ⟶ 142:
--
-- @param {table} [url] - uno o più URL, quanti sono i valori della proprietà Wikidata
-- @param {table} [qualifier] - eventuali qualificatori da annettere al titolo per ciascun URL
-- @param {table} linkConf - la configurazione fissa per questo collegamento esterno
-- @param {table} extraConf - altri elementi di configurazione ricavati dall'item
-- @param {string} from - entityId se diverso da quello collegato alla pagina corrente
-- @return {table} un nuovo oggetto ExtLink
function ExtLink:new(url, qualifier, linkConf, extraConf, from)
local self = {}
setmetatable(self, { __index = ExtLink })
 
-- sostituisce eventuali spazi con %20
for i = 1, #url do
url[i] = url[i]:gsub(' ', '%%20')
end
self.url = url
self.qualifier = #url > 1 and qualifier
self.linkConf = linkConf
self.extraConf = extraConf
Line 136 ⟶ 157:
self.title = self.from and mWikidata._getLabel({ self.from }) or self.title
self.extraConf.medium = self.linkConf.medium or 'web'
 
return self
end
Line 142 ⟶ 163:
-- Restituisce il parametro titolo per il modulo Citazione.
--
-- @param {number} i - il numero dell'URL a cui assegnare il titolo.
-- @return {string}
function ExtLink:_getTitolo(i)
local titolo = self.extraConf.titolo[1i] or self.title
if self.linkConf.titolo then
titolo = self.linkConf.titolo:gsub('$1', titolo)
end
if #self.qualifierurl > 1 and self.qualifierextraConf.titolodis[1i] ~= nil then
return string.format('%s (%s)', titolo, self.qualifierextraConf.titolodis[1i])
else
return titolo
Line 160 ⟶ 182:
-- @return {table}
function ExtLink:_getAltriLink()
if self.extraConf.restrictedData then return end
local tbl = {}
local titolo, specifica
for i = 2, #self.url do
titolo = self.extraConf.titolo[i] or self.title
if self.qualifier and selfextraConf.qualifiertitolodis[i] ~= nil then
specifica = self.qualifierextraConf.titolodis[i]
else
local ripetuto = false -- controllo se stesso titolo già usato
for j = 1, i - 1 do
if titolo == (self.extraConf.titolo[j] or self.title) then
ripetuto = true
break
Line 186 ⟶ 209:
end
return tbl
end
 
-- Restituisce il parametro cid per il modulo Citazione.
--
-- @param {number} i - il numero dell'URL a cui assegnare il cid.
-- @return {string}
function ExtLink:_getCid(i)
if #self.url > 1 and self.extraConf.restrictedData then
return self.extraConf.cid[i]
else
return self.linkConf.cid
end
end
 
function ExtLink:_formatPreviewMsg()
local ret = ''
if self.extraConf.previewMsg then
ret = mw.html.create('abbr')
:css('color', 'red')
:css('font-weight', 'bold')
:attr('title', self.extraConf.previewMsg)
:wikitext('!')
ret = tostring(ret) .. ' '
end
return ret
end
 
Line 199 ⟶ 247:
langs = (#langs == 1 and langs[1] == 'Q652') and {} or langs
for i, lang in ipairs(langs) do
langs[i] = mWikidatamw._getLabelwikibase.getLabel({ lang }) or lang
end
local formattedLink = mCitazione.cita_da_modulo(
Line 212 ⟶ 260:
urlmorto = self.extraConf.urlmorto[idx] and 'sì' or (self.extraConf.archivio[idx] and 'no')
})
table.insert(formattedLinks, '* ' .. self:_formatPreviewMsg() .. formattedLink ..
mEditAtWikidata._showMessage({ pid = self.linkConf.pid, qid = self.from }))
end
Line 222 ⟶ 270:
-- @return {string}
function ExtLink:getListItem()
-- restituisce il link se è già stato formattato
-- se è specificato l'URL di formattazione è una
if self.extraConf.formattedLink then
-- proprietà di tipo "identificativo esterno" altrimenti di tipo URL
return '* ' .. self:_formatPreviewMsg() .. self.extraConf.formattedLink
if self.linkConf.url then
-- se invece non è specificato l'URL di formattazione presume sia una
return '* ' .. mCitazione.cita_da_modulo(
-- proprietà di tipo URL e non di tipo "identificativo esterno"
elseif not self.linkConf.url then
return self:_formatPropertyURL()
end
local formattedLinks = {}
for i = 1, self.extraConf.restrictedData and #self.url or 1 do
local formattedLink = mCitazione.cita_da_modulo(
self.extraConf.medium,
{
url = self.url[1i],
titolo = self:_getTitolo(i),
altrilink = self:_getAltriLink(),
sito = self.linkConf.opera and '' or self.extraConf.sito,
Line 235 ⟶ 290:
editore = self.linkConf.editore,
lingua = self.linkConf.lingua,
cid = self.linkConf.cid:_getCid(i),
autore = self.linkConf.autore or self.extraConf.autore[i],
volume = self.extraConf.volume[i],
p = self.extraConf.pagina[i],
data = self.linkConf.data or self.extraConf.data[i],
tipo = self.linkConf.tipo or self.sitodis
})
}) .. mEditAtWikidata._showMessage({ pid = self.linkConf.pid, qid = self.from })
table.insert(formattedLinks, '* ' .. self:_formatPreviewMsg() .. formattedLink ..
else
mEditAtWikidata._showMessage({ pid = self.linkConf.pid, qid = self.from }))
return self:_formatPropertyURL()
end
return table.concat(formattedLinks, '\n')
end
 
Line 282 ⟶ 338:
 
return self
end
 
-- Formatta e carica una o più categorie di servizio.
function LinksManager:_addCategory(...)
for _, category in pairs({ ... }) do
if category then
category = string.format('[[%sCategoria:%s]]', self.catColon, category)
table.insert(self.categories, category)
end
end
end
 
Line 308 ⟶ 374:
local ret, groupSites = {}, {}
local cfg = readConfig()
local lang = mw.language.getContentLanguage()
local pageContent, isPreview, isSection
local loadedEntities = setmetatable({}, {
__newindex = function(t1, key, t2)
Line 313 ⟶ 381:
for k, v in pairs(t2) do rawset(t1, k, v) end
end })
local duplicates = false -- per categoria temporanea
local pageContent = mw.title.getCurrentTitle():getContent()
for _, groupName in ipairs(orderedGroupNames) do -- per ogni gruppo tematico
pageContent = pageContent:gsub('<[Rr][Ee][Ff].->.-</[Rr][Ee][Ff]%s*>', '')
for _, groupName in ipairs(orderedGroupNames) do -- Per ogni gruppo tematico
groupSites[groupName] = {}
ret[groupName] = {}
Line 322 ⟶ 389:
cfg[groupName] = {}
end
for _, linkConf in ipairs(cfg[groupName]) do -- Perper ogni sito configurato
local claims, valido, templateextraConf
if linkConf.template then
local first_char = linkConf.template:match('^.')
first_char = string.format('[%s%s]', first_char:upper(), first_char:lower())
if pageContent:match('{{%s*' .. linkConf.template:gsub('^.', first_char) .. '%s*[|}]') then
template = true
end
end
-- se il sito non è escluso manualmente dall'utente, avviene la lettura da Wikidata
if not (self:_Escluso(linkConf.pid, self.soloprop) or
self:_Escluso(mw.getContentLanguage()lang:ucfirst(linkConf.medium or 'web'), self.solomedium) or template) then
claims = mWikidata._getClaims(linkConf.pid, { from = self.from })
end
-- controlla se ci sono valori
if claims and #claims > 0 then
extraConf = { cid = {}, titolodis = { count = 0 } }
-- controlla se è un sito da escludere per soggetto non pertinente
if type(linkConf.vincolo) == 'table' then
local Nvincolivincolo, tipo = 0{}, 'neg'
for _i, v in ipairs(linkConf.vincolo) do Nvincoli = Nvincoli + 1 end
if i % 2 ~= 0 then
for i = 2, Nvincoli, 2 do -- Per ogni coppia 'proprietà', {valori}
local ms, k = v:match('^(%-?)(.+)$')
valido, loadedEntities[i] = checkEntity(linkConf.vincolo[i - 1], linkConf.vincolo[i], self.from)
if validotipo then== break'neg' endand ms == '' then
vincolo, tipo = {}, 'pos'
end
if not (tipo == 'pos' and ms == '-') then
vincolo[k] = linkConf.vincolo[i + 1]
end
end
end
for k, v in pairs(vincolo) do
valido, loadedEntities[k] = checkEntity(k, v, self.from)
if tipo == 'neg' then
valido = not valido
if not valido then break end
elseif valido then
break
end
end
else
valido = true
end
-- controlla che il link non sia generato da altri template in voce
if valido and linkConf.template then
local templateList = linkConf.template
:gsub('%s*,%s*', ','):gsub(',+', ','):gsub('^,', ''):gsub(',$', '')
if templateList ~= '' then
if not pageContent then
pageContent = mw.title.getCurrentTitle():getContent()
:gsub('<!%-%-.-%-%->', '')
:gsub('<[Rr][Ee][Ff]%s.-/>', '') -- facilita la ricerca successiva
:gsub('<[Rr][Ee][Ff].->.-</[Rr][Ee][Ff]%s*>', '')
isPreview = mw.getCurrentFrame():preprocess('{{REVISIONID}}') == ''
end
for template in mw.text.gsplit(templateList, ',') do
template = template:gsub(' +', ' +')
local firstChar = template:match('^.')
firstChar = string.format('[%s%s]', firstChar:upper(), firstChar:lower())
if pageContent:match('{{%s*' .. template:gsub('^.', firstChar) .. '%s*[|}]') then
valido, duplicates = isPreview, true
if isPreview then
extraConf.previewMsg = mw.message.newRawMessage(tmpFound, template):plain()
end
break
end
end
if isPreview and not extraConf.previewMsg then
if isSection == nil then
isSection = pageContent:match('^=+[^=\n]+=+ *\n') and true or false
end
if isSection then
templateList = templateList:gsub(',', ', ')
extraConf.previewMsg = mw.message.newRawMessage(tmpSection, templateList):plain()
end
end
end
end
end
-- verifica se deve generare il link con un sottomodulo
-- che può fare a sua volta altri controlli
if valido and linkConf.sottomodulo then
local success, metamodule = pcall(require, 'Modulo:' .. linkConf.sottomodulo)
if success and type(metamodule._main) == 'function' then
extraConf.formattedLink = metamodule._main({
from = self.from,
['mostra errori'] = 'no'
})
end
if extraConf.formattedLink then
claims = {}
else
valido = false
end
end
-- se il sito è abilitato, viene aggiunto a quelli da mostrare
if valido then
local url, qualifier,= extraConf{}
-- per ogni dichiarazione
local Nqualtitoli = 0
-- Qualificatori generali
-- In caso di valori multipli, il titolo viene letto per tutti; gli altri qualificatori solo per il primo (altrimenti bisogna rivedere la formattazione dei valori multipli)
-- Ricordarsi di elencare i qual. generali anche in altriQualNoti
extraConf = {}
extraConf.autore = mWikidata._formatQualifiers(claims[1], 'P50') or mWikidata._formatQualifiers(claims[1], 'P2093') -- come item o stringa
extraConf.volume = mWikidata._formatQualifiers(claims[1], 'P478')
extraConf.pagina = mWikidata._formatQualifiers(claims[1], 'P304')
extraConf.data = mWikidata._formatQualifiers(claims[1], 'P577')
extraConf.titolo = {}
extraConf.archivio = {}
extraConf.dataarch = {}
extraConf.urlmorto = {}
for i, claim in ipairs(claims) do
extraConf.titolo[i] = mWikidata._formatQualifiers(claim, 'P1476') or mWikidata._formatQualifiers(claim, 'P1810') or mWikidata._formatQualifiers(claim, 'P1932') or mWikidata._formatQualifiers(claim, 'P742') -- titolo o "indicato come" o "riferito come" o pseudonimo
if extraConf.titolo[i] then Nqualtitoli = Nqualtitoli + 1 end
-- url archiviato, solo per le proprietà di tipo URL
extraConf.archivio[i] = mWikidata._formatQualifiers(claim, 'P1065')
extraConf.dataarch[i] = mWikidata._formatQualifiers(claim, 'P2960')
extraConf.urlmorto[i] = mWikidata._formatQualifiers(claim, 'P582') or mWikidata._formatQualifiers(claim, 'P582', { snaktype = 'somevalue' })
end
-- Uno o più url ed eventuali qualificatori per distinguerli
url = {}
for i, claim in ipairs(claims) do
for k, t in pairs(knownQualifiers) do
if t.par then
extraConf[t.par] = extraConf[t.par] or { count = 0 }
local properties = { k, unpack(t.fallback or {}) }
-- ricava i qualificatori generali e ne tiene il conto
for _, v in ipairs(properties) do
extraConf[t.par][i] = mWikidata._formatQualifiers(claim, v) or
t.par == 'urlmorto' and
mWikidata._formatQualifiers(claim, v, { snaktype = 'somevalue' }) or nil
if extraConf[t.par][i] then
extraConf[t.par].count = extraConf[t.par].count + 1
if t.restricted then
extraConf.restrictedData = true
end
break
end
end
end
end
if claim.qualifiers then
knownQualifiers.multi = {}
local qualifierIds = ParametroElenco(linkConf.multi)
-- cerca un disambiguante per il titolo di ogni url
for qualifierId, _ in pairs(qualifierIds) do
iffor claim.qualifiers[qualifierId] thenin mw.text.gsplit(linkConf.multi or '', ',') do
local formattedQualifier = mWikidata._formatQualifiers(claim,if qualifierId, { nq == '1', formattingthen = 'raw'break })end
qualifierId = mw.text.trim(qualifierId):upper()
if extraConf.titolodis[i] == nil and claim.qualifiers[qualifierId] then
local args = { nq = '1', formatting = 'raw' }
local formattedQualifier = mWikidata._formatQualifiers(claim, qualifierId, args)
if formattedQualifier then
extraConf.titolodis[i] = mw.wikibase.getLabel(formattedQualifier)
if not qualifier then qualifier = {} end
if extraConf.titolodis[i] then
qualifier[i] = mw.wikibase.getLabel(formattedQualifier)
extraConf.titolodis.count = extraConf.titolodis.count + 1
break
end
end
end
knownQualifiers.multi[qualifierId] = true
end
-- categoria di servizio in presenza di qualificatori non riconosciuti
local altriQualNoti = {P407 = true, P50 = true, P2093 = true, P1476 = true, P1810 = true, P1932 = true, P742 = true, P577 = true, P478 = true, P304 = true, P813 = true, P1065 = true, P2960 = true, P582 = true}
for qualifierId in pairs(claim.qualifiers) do
if qualifierIdsnot (knownQualifiers[qualifierId] ~=or true and altriQualNotiknownQualifiers.multi[qualifierId] ~= true) then
table.insert(self.categories, string.format:_addCategory('[[%sCategoria:%s]]', self.catColon, catUnknownQual))
break
end
Line 398 ⟶ 529:
-- crea l'url
claim = mWikidata._formatStatement(claim)
if linkConf.cid then
extraConf.cid[i] = linkConf.cid .. ' ' .. (extraConf.data[i] or claim)
end
if linkConf.url then
-- se proprietà di tipo id, il valore viene sotituitosostituito a "$1"
claim = mw.message.newRawMessage(linkConf.url, claim):plain()
end
table.insert(url, (claim:gsub(' ', '%%20')))
end
-- nome sito, di default il dominio estratto dall'url
extraConf.sito = linkConf.sito or getDomain(linkConf.url)
-- Creazionecreazione dell'oggetto collegamento esterno, con l'url (o gli url) e gli altri dati raccolti
table.insert(ret[groupName], ExtLink:new(url, qualifier, linkConf, extraConf, self.from))
-- categoria per proprietà letta; se multipla e indistinguibile, usa categoria di avviso
local tail = #url > 1 and linkConf.url and (qualifier == nil or #qualifier ~= #url) and (Nqualtitoli < #url - 1) and
extraConf.titolodis.count ~= #url and
catMultiSenzaQual or catLetta
extraConf.titolo.count < #url - 1 and
table.insert(self.categories, string.format('[[%sCategoria:%s%s]]', self.catColon, linkConf.pid, tail))
catMultiSenzaQual or catLetta
-- per verificare se un sito è ripetuto nel gruppo
self:_addCategory(linkConf.pid .. tail)
-- per verificare se un sito è ripetuto nel gruppo e necessita di disambiguazione
groupSites[groupName][extraConf.sito] = (groupSites[groupName][extraConf.sito] or 0) + 1
-- conteggio complessivo dei collegamenti
Line 429 ⟶ 565:
end
end
-- categoriacategorie di servizio sulsu numero di link/entità caricate e doppioni omessi
local catnumero = self.numExtLinks == 0 and catEmpty or
if self.numExtLinks ==> MOLTI_LINK_2 and 0catMoltiLink2 thenor
self.numExtLinks > MOLTI_LINK and catMoltiLink
catnumero = catEmpty
self:_addCategory(catnumero,
elseif self.numExtLinks > MOLTI_LINK then
#loadedEntities > 100 and catExcessiveLoad,
if self.numExtLinks > MOLTI_LINK_2 then catnumero = catMoltiLink2
duplicates and catDuplicates)
else catnumero = catMoltiLink end
end
if catnumero then
table.insert(self.categories, string.format('[[%sCategoria:%s]]', self.catColon, catnumero))
end
-- categoria di servizio sul numero di entità caricate
if #loadedEntities > 100 then
table.insert(self.categories, string.format('[[%sCategoria:%s]]', self.catColon, catExcessiveLoad))
end
return ret
end
Line 493 ⟶ 621:
local res = {}
local cfg = readConfig()
local formatString = '<tr><td>[[d:P:%s|%s (%s)]]</td><td>%s</td><td>%s</td><td>%s</td></tr>'
table.sort(orderedGroupNames)
for _, groupName in ipairs(orderedGroupNames) do
local wdLinks = {}
for _, linkConf in ipairs(cfg[groupName]) do
local templates = {}
local wdLink = string.format('<tr><td>[[d:Property:%s|%s (%s)]]</td><td>%s</td><td>%s</td><td>%s</td></tr>',
for template in string.gmatch(linkConf.template or '', '[^,]+') do
linkConf.pid, mWikidata._getLabel({ linkConf.pid }), linkConf.pid, linkConf.url or '', linkConf.cid or '', linkConf.template and ('[[t:'..linkConf.template..'|'..linkConf.template..']]') or '')
table.insert(wdLinkstemplates, wdLink)'[[t:' .. template .. '|' .. template .. ']]')
end
local wdLink = string.format(formatString,
linkConf.pid,
mWikidata._getLabel({ linkConf.pid }),
linkConf.pid,
linkConf.url or '',
linkConf.cid or '',
table.concat(templates, ', '))
table.insert(wdLinks, wdLink)
end
 
local group = frame.args[1] == 'modulo' and
local group
string.format('* [[Modulo:Collegamenti esterni/%s]] (%s)', groupName, #wdLinks) or
if frame.args[1] == 'modulo' then
mw.getCurrentFrame():expandTemplate {
group = string.format('* [[Modulo:Collegamenti esterni/%s]] (%s)',
groupName, #wdLinks)
else
local wikitable = mw.html.create('table')
local title = string.format('[[Modulo:Collegamenti esterni/%s|%s]] (%s)',
groupName, groupName, #wdLinks)
wikitable
:addClass('wikitable sortable plainlinks')
:tag('tr')
:tag('th'):wikitext('Proprietà')
:tag('th'):wikitext('Formato URL')
:tag('th'):wikitext('cid')
:tag('th'):wikitext('Template equivalenti')
:allDone()
:wikitext(table.concat(wdLinks))
group = mw.getCurrentFrame():expandTemplate{
title = 'Cassetto',
args = { titolo = title, testo = tostring(wikitable) }
titolo = string.format('[[Modulo:Collegamenti esterni/%s|%s]] (%s)', groupName, groupName, #wdLinks),
testo = '<table class="wikitable sortable plainlinks"><tr><th>Proprietà</th><th>Formato URL</th><th>cid</th><th>Template singolo</th></tr>' .. table.concat(wdLinks, '') .. '</table>'
}
}
end
table.insert(res, group)
end
Line 517 ⟶ 669:
-- Funzione di utilità per il manuale, verifica l'assenza di proprietà duplicate.
function p.checkdup(frame)
local ids, vin, res = {}, {}, {}
local cfg = readConfig()
for _, groupName in ipairs(orderedGroupNames) do
for _, linkConf in ipairs(cfg[groupName]) do
iflocal duplicate = ids[linkConf.pid] then
if vin[linkConf.pid] == nil then
vin[linkConf.pid] = { pos = {}, neg = {} }
end
if vin[linkConf.pid] ~= false and linkConf.vincolo then
duplicate, vin[linkConf.pid].cur = false, {}
local tipo = 'neg'
for i, v in ipairs(linkConf.vincolo) do
if i % 2 ~= 0 then
local ms, p = v:match('^(%-?)(.+)$')
if tipo == 'neg' and ms == '' then
vin[linkConf.pid].cur, tipo = {}, 'pos'
end
if not (tipo == 'pos' and ms == '-') then
for _, q in ipairs(linkConf.vincolo[i + 1]) do
vin[linkConf.pid].cur[p .. q] = true
end
end
end
end
if tipo == 'pos' then
for k in pairs(vin[linkConf.pid].cur) do
for _, t in ipairs(vin[linkConf.pid].pos) do
if t[k] then duplicate = true break end
end
for _, t in ipairs(vin[linkConf.pid].neg) do
if not t[k] then duplicate = true break end
end
end
else
if #vin[linkConf.pid].neg == 1 then
duplicate = true
else
for _, t in ipairs(vin[linkConf.pid].pos) do
for k in pairs(t) do
if not vin[linkConf.pid].cur[k] then
duplicate = true
break
end
end
end
end
end
table.insert(vin[linkConf.pid][tipo], vin[linkConf.pid].cur)
end
if duplicate then
table.insert(res, linkConf.pid)
else
ids[linkConf.pid] = true
if not linkConf.vincolo then vin[linkConf.pid] = false end
end
end