Extension:CommonsMetadata/it

L'estensione CommonsMetadata è un tentativo di estrarre metadati dalle pagine di Wikimedia Commons. Aggiunge alcune informazioni extra all'API imageinfo, basate su template e categorie presenti nella descrizione dell'immagine.

L'estensione nella sua forma attuale è intesa come soluzione temporanea, da sostituirsi con Wikidata su Commons.

Motivazioni e scelte progettuali
Vedi http://lists.wikimedia.org/pipermail/wikitech-l/2013-August/071593.html

Le assunzioni fatte per questa estensione sono le seguenti.


 * Ad un certo punto in futuro, wikidata prenderà in mano la gestione dei metadati su commons. Per evitare cambiamenti troppo marcati, che verrebbero subito modificati nuovamente, l'estensione dovrebbe lavorare con i metadati di commons, come avviene attualmente (senza introdurre nuove funzioni di analisi). Da qui lo screen scraping.


 * The content of many of the fields on a commons description page include rich formatting (In particular: Links, italics, bold. In some cases more complex things like embedded images)
 * As a result, extension outputs parsed html (wikitext sucks, plain text doesn't capture the data)
 * Futhermore, the data tends to be formatted for human display, rather than (for example) machine formatted dates. When the date field says something like "circa 1600s", its hard to convert that to a precise date (otoh, many examples can be).
 * To carry that forward, also apply formatting to exif metadata, which is controlled on wiki (For example, commons links the camera name to a wikipedia article)


 * If we can't extract info from the description page, but the file has the author tagged in exif/XMP/iptc metadata, we should use that as a fallback.
 * Ideally such a system would be as commons-inspecific as possible, with the commons and non-commons part separated.


 * Commons description pages have multilingual descriptions. Lots of users probably just want one language.
 * In this implementation, it applies per language conventions to dates and things. Additionally for explicitly multi-lingual fields (description), there is an option to return all, or just a single language. Even in single language mode, some things are still language specific (like the thousands seperator on numbers)

Testing
When testing with remote images (e.g. Commons images if you have enabled ), you can set   to force CommonsMetadata to parse the description page of the image and extract the metadata (normally, if the remote repository had CommonsMetadata installed as well, it would just copy the API output from there).

Uso
Usa l'API imageinfo ed inserisci  come proprietà dell'informazione dell'immagine specificata attraverso il parametro.

Example usage:
 * https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&format=json&iiprop=extmetadata&iilimit=10&titles=File%3ACommon%20Kingfisher%20Alcedo%20atthis.jpg

View this example in the API sandbox:
 * https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&prop=imageinfo&format=json&iiprop=extmetadata&iilimit=10&titles=File%3ACommon%20Kingfisher%20Alcedo%20atthis.jpg

Returned data
The extension currently provides the following items in the  field of the response (the field names were chosen, where possible, to follow the IPTC-IIM format used in EXIF headers):

Data based on machine-readable data in the Information template:
 * ImageDescription - image description
 * Artist/Credit - authorship information
 * DateTimeOriginal - time of creation
 * ObjectName - title (for a book/painting)

Data based on machine-readable data in the Location template:
 * GPSLatitude - latitude
 * GPSLongitude - longitude

Data based on machine-readable data in the license template: For multi-licensed images these values are currently unreliable.
 * LicenseShortName - short human-readable license name
 * LicenseUrl
 * UsageTerms
 * Copyrighted -  or   (for public domain images)

Other data:
 * CommonsMedadataExtension - this is just a convenient way of testing that the extension is installed
 * License - a best guess at the license of the image (mostly for internal use by MediaViewer, might change; LicenseShortName is probably more reliable)
 * Categories - a -separated list of the categories of the image. (this is mostly broken at the moment)

Vedi anche

 * Gestione dei metadati dei file
 * Extension:MultimediaViewer attualmente l'utente principale delle informazioni fornite da CommonsMetadata
 * Richiesta di commenti sulla gestione delle informazioni delle immagini
 * Template detection on local wikis with locally uploaded files – Describes how to prepare the templates for fetching metadata and thus displaying them when using the MultimediaViewer extension.