PetScan
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 consente di estrarre dati, generare elenchi di pagine di Wikipedia (e altri progetti correlati) o di elementi di Wikidata che soddisfino determinati criteri, come per esempio tutte le pagine in una certa categoria o tutti gli elementi con una determinata proprietà, e analizzare dati estratti dai progetti Wikiimedia. 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 si possono aggiungere più sorgenti, ad esempio le interrogazioni SPARQL (WDQS) di Wikidata o liste PagePile. Si può definire anche 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). È possibile anche specificare a quale wiki si vuole che punti la lista, per esempio per combinare risultati da Wikipedia e da Wikidata.
Wikidata
In questa sezione è possibile annotare o filtrare ulteriormente i 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 si possono specificare le opzioni per la lista, ad esempio il formato (pagina web, wiki, PagePile ecc.). Si possono anche filtrare ulteriormente i risultati, ad esempio usando delle espressioni regolari per i titoli delle pagine o le etichette degli elementi. È possibile infine sostituire la lista dei risultati con una lista ordinata di argomenti mancanti ("link rossi").
Definire la richiesta
I campi che possono essere impostati nel modulo per la richiesta sono i seguenti:
Campo | Significato | Default | Nota |
---|---|---|---|
Lingua | Selezionare il codice della lingua del progetto, ad esempio "en" per l'inglese o "de" per il tedesco. Selezionare "commons" per Wikimedia Commons | "en" | |
Progetto | Il progetto Wikimedia su cui compiere la ricerca (Wikipedia, Wikizionario, Wikiversità ecc.) | "wikipedia" | NOTE: If you choose "Commons," be sure to go to the "Page properties" tab and check the "File" namespace to get useful results. |
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:
Al momento le opzioni disponibili sono "intersezione" e "unione". |
"sottoinsieme" | |
Namespace | I namespace da usare come potenziali pagine | (Principale) | |
Redirect | Entrambi | ||
Template | Usa soltanto le pagine che:
Inserire 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:
| |
Wikidata | Ottieni l'elemento Wikidata, se disponibile. | ||
Formato | Formato di riporto dei risultati della ricerca: HTML: pagine web CSV: valori tra virgolette, separati da virgole TSV: valori separati da tabulazione 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)
- Creare un'interrogazione che dia come risultato una lista di pagine di Wikipedia (o di un altro progetto diverso da Wikidata), oppure incollare una lista in "Altre sorgenti/Lista manuale"
(削除) Nella sezione "Proprietà pagina" selezionare "Redirect=No" (削除ここまで)Questo ora è fatto automaticamente; puoi modificarlo se davvero vuoi dei redirect nella tua lista!- Nella sezione "Wikidata", selezionare "Solo pagine senza elemento" per l'opzione "Pagine ed elementi"
- Eseguire l'interrogazione
- I risultati avranno degli elementi aggiuntivi a fianco all'intestazione "Risultati" (a meno che non si abbia ancora compiuto l'accesso a WiDaR, nel qual caso si vedrà 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 con una spunta.
- Si può aggiungere o rimuovere la spunta manualmente, se necessario.
- Si possono aggiungere delle dichiarazioni di default nel box relativo alle dichiarazioni; queste saranno aggiunte a tutti i tuoi nuovi elementi. Ad esempio, per creare soltanto elementi relativi a persone, aggiungere "P31:Q5". Si possono aggiungere più dichiarazioni in questo modo (una per riga). Nota: è necessario che P e Q siano maiuscole - altrimenti le dichiarazioni non verranno aggiunte (senza alcuna notifica esplicita).
- È possibile aggiungere descrizioni di default per i nuovi elementi, come ad esempio
Dde:"some description"
per una descrizione in tedesco. - Cliccare il bottone verde "Procedi". Si aprirà una nuova pagina.
- Per eseguire la ricerca direttamente nel browser, cliccare "Esegui", oppure "Esegui in background" per eseguirla da un server Wikimedia. Vedi Help:QuickStatements per ulteriori informazioni.
Aggiungere/togliere dichiarazioni agli elementi Wikidata
Tramite PetScan è possibile aggiungere o togliere dichiarazioni agli elementi di Wikidata. Per far questo, è necessario selezionare "Wikidata" in "Altre sorgenti -> Usa Wiki". A fianco del numero comparirà un box di comando e si potrà procedere come descritto nella sezione precedente.
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:
- 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.
- 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.)
- 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.
- 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)
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 = Uncategorized files 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:
As of 15 March 2016, after hitting "run" the query requires about 105 seconds to finish, and yields 1748 uncategorized photos.
Notes:
- The "Language =" field is not used to select the desired language; the desired language code is set in the "Template" field instead.
- The language code is case-sensitive in the query! So for example use "ro" not "RO".
- 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:
- items without statements for a category at Wikipedia (sample: en:Category:United States geography stubs)
- items without statements for an entire Wikipedia language version (sample: "sowiki")
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 andwikipedia
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
External links
- Training video from EduWiki 2023
- Wiki World Heritage User Group: Capacity Building PetScan Training 2021