This page is a translated version of the page PetScan and the translation is 74% complete.
Outdated translations are marked like this.
Coolest Tool Award 2022 logo
PetScan

2022 Coolest Tool
Award Winner

in the category
Reusable

PetScan è un potente strumento di interrogazione. L'interrogazione viene preparata tramite sottomissione di un modulo a PetScan. Inoltre, potete verificare le motivazioni sottese a questo strumento.

Introduzione

PetScan può generare liste di pagine di Wikipedia e di altri progetti Wikimedia o di elementi Wikidata che corrispondono a determinati criteri, ad esempio tutte le pagine in una certa categoria o tutti gli elementi con una determinata proprietà. PetScan può anche combinare alcune liste temporanee (qui chiamate "sorgenti") in vari modi, per crearne una nuova. Le sorgenti includono:

Pagine da Wiki(m|p)edia

Queste pagine sono definite nelle sezioni "Categorie", "Proprietà pagina" e "Template e collegamenti". Puoi cercare pagine in base alla loro categoria, all'utilizzo di specifici template, ai link da o verso specifiche pagine; poi filtrare i tuoi risultati limitandoli a certi namespace, alle modifiche di bot o di umani, in base alla data della modifica più recente o della creazione della pagina ecc. Queste tre sezioni rappresentano le vecchie funzionalità di CatScan2. Il risultato dell'interrogazione è quindi definito come "sorgente categoria".

Altre sorgenti

In questa sezione poi aggiungere più sorgenti, ad esempio le interrogazioni SPARQL (WDQS) di Wikidata o liste PagePile. Poi anche definire come combinare le diverse sorgenti; di default il risultato finale è impostato come massimo comune denominatore (cioè soltanto le pagine che si ritrovano in tutte le sorgenti). Poi anche specificare a quale wiki vuoi che la tua lista punti, se ad esempio hai combinato risultati da Wikipedia e da Wikidata.

Wikidata

In questa sezione poi ulteriormente filtrare i tuoi risultati, ad esempio selezionando soltanto gli elementi di Wikidata che non hanno dichiarazioni. Usare uno qualunque di questi filtri farà sì che il risultato dell'interrogazione punti a Wikidata.

Output

Qui puoi specificare delle opzioni per la tua lista, ad esempio il formato (pagina web, wiki, PagePile ecc.). Puoi anche filtrare ulteriormente i tuoi risultati, ad esempio usando delle espressioni regolari per i titoli delle pagine o le etichette degli elementi. Puoi anche sostituire la lista dei risultati con una lista ordinata di argomenti mancanti ("link rossi").

Definire la tua query

I campi che possono essere impostati nel modulo per compiere l'interrogazione sono i seguenti:

Campo Significato Default Nota
Lingua Seleziona il codice della lingua del progetto, ad esempio "en" per l'inglese o "de" per il tedesco. Seleziona "commons" per Wikimedia Commons "en"
Progetto Il progetto Wikimedia in cui compiere la ricerca (Wikipedia, Wikizionario, Wikiversità ecc.) "wikipedia"
Profondità Profondità dell'albero delle categorie in cui cercare. "0" significa escludere le sottocategorie. "0"
Categorie Lista delle categorie, una per riga senza il prefisso "category:". Vuoto Apporre "|" e un numero di fianco al nome di una categoria stabilirà la profondità per questo singolo albero delle categorie, sovrascrivendo la profondità scelta nel campo Profondità
Categorie da escludere Lista di categorie, come sopra. Saranno accettate soltanto le pagine che non sono incluse in queste categorie. Vuoto
Combinazione Come devono essere usate le categorie di cui sopra:
  • Sottoinsieme: Tutte le pagine che sono in ciascuno degli alberi delle categorie
  • Unione: Tutte le pagine che sono in almeno un albero delle categorie
  • Differenza: Tutte le pagine che sono soltanto in uno degli alberi delle categorie
  • Almeno (N): Tutte le pagine che sono in almeno N alberi delle categorie

Al momento le opzioni disponibili sono "sottoinsieme" e "unione".

"subset"
Namespace I namespace da usare come potenziali pagine (voce)
Redirect Entrambi
Template Usa soltanto le pagine che:
  • Box 1: contengono tutti i template specificati
  • Box 2: contengono uno dei template forniti
  • Box 3: non contengono alcuno dei template forniti

Inserisci un template per riga, senza il prefisso "template:". Per ogni box può essere attivata l'opzione "usa invece la pagina di discussione"

Vuoto Questa opzione sembra essere compatibile soltanto coi template definiti nel namespace "template:". Non può essere usata per i template definiti nel namespace "utente:", né per i namespace "creator:" e "institution:" di Wikimedia Commons.
Link in ingresso
Ultima modifica Mostra le pagine la cui ultima modifica è o non è stata compiuta da un bot, da un utente anonimo o da un utente flaggato Entrambi, entrambi, entrambi
Ultima modifica Data o periodo di tempo dell'ultima modifica della pagina nel formato AAAAMMGGOOMMSS (sono ammesse forme abbreviate, es. solo AAAAMMMGG) L'opzione "Solo pagine create nel periodo indicato" permette di prendere in considerazione la prima modifica anziché l'ultima modifica
Dimensioni Grandezza del file in byte Vuoto Permette di selezionare voci i cui file sono più grandi di un tot e/o più piccoli di un tot
Collegamenti Numero di link interni nella pagina Vuoto Permette di selezionare voci con molti o pochi link
Link rossi
Categorie apicali Funzionalità non ancora disponibile.
Ordina Funzionalità non ancora disponibile, che stabilirebbe i criteri di ordinamento per l'output.
Lista manuale Permette di fornire una lista di pagine (precedute dal prefisso del namespace) o di elementi di Wikidata da un determinato progetto

È importante usare i codici corretti per specificare i progetti:

  • Wikipedia in italiano: "itwiki"
  • Wikisource in italiano: "itwikisource" o "itwikisourcewiki"
  • Wikinews in italiano "itwikinews"
  • Wikidata: "wikidatawiki"
Wikidata Ottieni l'elemento Wikidata, se disponibile.
Formato Formato dell'output dei risultati della ricerca:
HTML: pagine web
CSV: valori tra virgolette, separati da virgole
TSV: Tab Separated Values
WIKI: tabella in formato wiki
PHP: file PHP
XML: file XML
Vai! Premi questo pulsante per inviare il modulo che hai compilato.

Know-how

PetScan ID (PSID)

Dal 4 aprile 2016 ogni interrogazione che viene compiuta per mezzo di PetScan è registrata (anonimamente!) e ottiene un identificativo numerico univoco e stabile chiamato PSID. Puoi usare lo PSID per:

  • usare questa interrogazione di PetScan come input nei tool che supportano lo PSID (come ad esempio WD-FIST)
  • completare l'"URL breve": https://petscan.wmflabs.org/?psid=PSID farà partire la interrogazione avente quel PSID con tutte le sue caratteristiche
  • espandere una precedente interrogazione sovrascrivendone i parametri: https://petscan.wmflabs.org/?format=wiki&psid=PSID farà partire la stessa interrogazione di prima, ma l'output avrà il formato wiki (anziché il formato di default HTML, o qualunque formato fosse stato scelto originariamente).

Note:

  • Solo l'interrogazione sarà registrata, non i suoi risultati!
  • Grandi interrogazioni (ad esempio con liste manuali di elementi) non saranno registrate. In questo caso non sarà mostrato alcun PSID.
  • Il link interwiki petscan: può essere usato per generare scorciatoie a interrogazioni permanenti, ad esempio [[petscan:PSID]]

Creare elementi di Wikidata per voci di Wikipedia che ne sono prive (funzionalità Creator)

  • Crea un'interrogazione che dia come risultato una lista di pagine di Wikipedia (o di un altro progetto diverso da Wikidata), oppure incolla la lista in "Altre sorgenti/Lista manuale"
  • Nella sezione "Proprietà pagina" seleziona "Redirect=No" Questo ora è fatto automaticamente; puoi modificarlo se davvero vuoi dei redirect nella tua lista!
  • Nella sezione "Wikidata", seleziona "Solo pagine senza elemento" per l'opzione "Pagine ed elementi"
  • Fai partire l'interrogazione
  • I tuoi risultati avranno degli elementi aggiuntivi a fianco all'intestazione "Risultati" (a meno che tu non abbia ancora compiuto l'accesso a WiDaR, nel qual caso vedrai invece il link apposito)
  • Tutte le pagine per le quali non c'è un esatto abbinamento in alcuna etichetta o alias su Wikidata sono segnate di default colla spunta.
  • Puoi aggiungere o rimuovere la spunta manualmente, se necessario.
  • Puoi aggiungere delle dichiarazioni di default nel box relativo alle dichiarazioni; queste saranno aggiunte a tutti i tuoi nuovi elementi. Ad esempio, se crei soltanto elementi relativi a persone, aggiungi "P31:Q5". Puoi aggiungere più dichiarazioni in questo modo (una per riga). Nota che è necessario che P e Q siano maiuscole - altrimenti le dichiarazioni non verranno aggiunte (senza alcuna notifica esplicita).
  • Clicca il bottone verde "Procedi". I nuovi elementi saranno creati (e ad essi verranno aggiunte le dichiarazioni) per tutte le pagine colla spunta.
  • Puoi sempre fermare il processo per mezzo del bottone rosso (appare non appena il processo comincia).
  • Quando un elemento viene creato e tutte le dichiarazioni sono state ad esso aggiunte, la sua riga sarà completamente rimossa dall'interfaccia.
  • Puoi cercare manualmente e abbinare le pagine di Wikipedia rimanenti ad elementi di Wikidata esistenti, ove possibile.


Add/remove statements for Wikidata items

It is possible to add or remove statements for Wikidata items with PetScan. For this it is crucial that you choose "Wikidata" in "Other sources -> Use Wiki". Then you will see the command box next to the number and can continue as described in the previous section.

Referrer

(V2 only) If you open PetScan from another tool to let the user create a query, you can pass the referrer_url and referrer_name (defaults to referrer_url) parameters. referrer_url should have a {PSID} string which will be replaced with the PSID the user sees. Once a query was run, a box at the top of the page will prompt the user to return to the original tool, using the PSID-modified referrer_url.

Esempi

Voci in un progetto

A request on the Talk page of this Manual: Find all mainspace articles within "WikiProject UK geography". Starting with a default PetScan submission form, just add "WikiProject UK geography" to the first box of the Templates row, and, just below, select "Use talk pages instead". Here is the query filled out. Hit "Do it!" at bottom. When run on 16 August 2015, the query required 1.5 seconds to run, and yielded a list of 21,408 articles. The list appears BELOW the submission form (which remains on your screen), so you have to scroll down to see the results.

Link ambigui in un progetto

Editors working on disambiguation seek to enlist members of a content area WikiProject, specifically WikiProject Canada, to help. A PetScan report is designed to find all articles having ambiguous links that are within the given WikiProject. Criteria applied:

  1. Articles having ambiguous links are within "Category:All articles with links needing disambiguation", so paste "All articles with links needing disambiguation" into the PetScan Categories field.
  2. Depth is set arbitrarily to 9, meaning that articles as far as 9 subcategories down from the "needing disambiguation" parent category will be found. (Searching to that depth is not necessary in this case but doesn't hurt.)
  3. Articles within WikiProject Canada have "Template:WikiProject Canada" on their talk pages, so paste "WikiProject Canada" into PetScan's "Has any of these templates" field, and just below select "Use talk pages instead" as a qualifier.
  4. Only regular articles, not disambiguation pages, are wanted, and disambiguation pages are distinguished by having template:disambiguation, so paste "Disambiguation" into PetScan's "Has none of these templates" field, and make sure "Use talk pages instead" is not selected.
  • These criteria are implemented by this PetScan submission form, filled out. To submit the query, select "Do it!" at the bottom.
  • When submitted on 16 August 2015, the query took 31 seconds to run, and results were a list of 255 articles. The results show BELOW the PetScan submission form, which remains in place, so you may see no change on your screen. You have to know to scroll down to find the results! That request was run with default Output format "HTML".
  • To obtain the results in a Wikitable, in order to share them at a subpage of the WikiProject, the request could be revised to select Format "WIKI". This time the results, in wikitable markup, replace the PetScan submission form on your screen.
  • To make a more useful list for disambiguators, set up so that DabSolver will open up on any item clicked, a several step process can be followed. Here the results were saved to Tab-Separated format instead, then brought into Excel, then a column was composed which concatenated simple text strings with the results, then that resulting column was copy-pasted. The results were pasted over to the English language Wikipedia page w:Wikipedia:Canadian Wikipedians' notice board/ArticlesNeedingDisambiguation2015-08-17 and were posted also within a scrolling window in discussion at the WikiProject Canada talk page. --Doncram (talk) 19:50, 24 August 2015 (UTC) link adjusted. DexDor (talk) 06:58, 29 March 2016 (UTC)[reply]

Individuare pagine che hanno combinazioni anomale di namespace e categorie

PetScan can be used to find pages that are in a category (or combination of categories) that is not appropriate for pages in a particular namespace - e.g. Wikipedia administration pages that are in a category that should only contain encyclopedic articles. This can then be fixed (e.g. by moving an article to the correct namespace or by editing a discussion to insert a missing ":" where a category is being referred to). The first step in this process is to identify (using PetScan) categories that cause incorrect categorization (e.g. Wikipedia administration categories that are in article categories).

Trovare foto non categorizzate su Commons in una certa lingua

(Based on Grants:Learning patterns/Treasures or landmines: detecting uncategorized, language-specific uploads in Commons. See the motivation and full explanation there! Thank you to wikimedia user User:Spiritia and other contributors/commenters there for contributing this! )

Run a query using PetScan with the following settings:

Language = commons
Project = wikimedia
Depth = 1
Categories = Media needing categories
Combination = ☑ Subset
Namespaces = ☑ File
Templates : Has all of these templates = <your language code> 
Format:  ☑ Extended data for files     ☑ File usage data

The English language code is "en"; the Romanian language code is "ro". To find uncategorized photos uploaded by users using Romanian language, a version of the query (with html output, and without autorun) is:

https://petscan.wmflabs.org/?language=commons&project=wikimedia&depth=1&categories=Media+needing+categories&ns%5B6%5D=1&templates_yes=ro&ext_image_data=1&file_usage_data=1

As of 15 March 2016, after hitting "run" the query requires about 105 seconds to finish, and yields 1748 uncategorized photos.

Notes:

  1. The "Language =" field is not used to select the desired language; the desired language code is set in the "Template" field instead.
  2. The language code is case-sensitive in the query! So for example use "ro" not "RO".
  3. To generate the results there, Format: ☑ Wiki was chosen, instead of the default output of Html.

Divertiti! Ancora grazie soprattutto all'utente Spiritia!

Elementi senza dichiarazioni

The option "Has no statements" can be used to find:

Importazione del Template:Bio da Wikipedia in italiano

Passi per importare il template, alcuni usando PetScan.

Get the sitelinks for a certain project from a SPARQL query

  • Indicate the project on the 'Categories' tab. E.g. de for Language and wikipedia in Project to use the German language edition of Wikipedia.
  • In Other sources enter your SPARQL query
  • Make sure to select From categories from the Use wiki options
  • Press Do it

This could be useful to get the pageviews of a specific set of pages, based on a SPARQL query. You can save this to a Pagepile (check the Output tab), then enter that Pagepile ID in Massviews Analysis (select 'Page Pile' from the Source dropdown).

Get a list of Wikidata items with exclusions based on a SPARQL query

Let's say you got a list of people with Wikidata ID's (QIDs) that you want to add an occupation (P106) of 'jewellery designer' (Q2519376) to, maybe with a tool like QuickStatements. However, you don't want to add this occupation to items that already have that occupation. Here's how to do that with PetScan:

  • Have your list of QIDs in a text file, with each QID on a new line
  • In the tab 'Other sources', paste this text into the field called 'Manual list'
  • In the form 'Wiki' enter the string wikidatawiki
  • In the field 'SPARQL' enter your SPARQL query. In this example, this query will give all humans with an occupation of 'jewellery designer':
  • select ?item where { ?item wdt:P31 wd:Q5; wdt:P106 wd:Q2519376. }
  • Finally, you want to make an exclusion, so in the field 'Combination' add the string manual NOT sparql to get all the QIDs from the 'manual list', but without the items from the SPARQL query.
  • Hit 'Do it!'

Aggiungi il tuo esempio qui...=

Bug reports, feature requests, code base

Pagine correlate