Commons:Machine-readable data/hu

Shortcut: COM:MRD

A Wikimédia Commonson rengeteg metaadat (a licencet és a szerzőt is beleértve) nem géppel olvasható. Van egy API-modul (iiprop=extmetadata), amivel bizonyos adatok kinyerhetők (példa), de mivel az információkat szabad szövegként kell bevinni közvetlenül a fájl leírólapjára, ez nem tökéletes. A folyamatban lévő Strukturált adatok a Commonson projekt célja az adatokat teljesen strukturálttá tenni, és egyszer elavulttá fogja tenni az ezen a lapon bemutatott géppel olvasható adatokat.

In the meantime, and to ease a transition towards more structured data at a future time, Wikimedia Commons use a set of standard templates which have been made machine-readable in some ways, through HTML elements. Some scripts already make use of that. It is worth noting that this data is available for any wiki using Wikimedia Commons, where it can be read from the html of the File: page just as other local data.

Géppel olvasható adatok

Infoboxsablonok által beállított géppel olvasható adatok

These are several standard infobox templates tagging different elements of the template with different tags to allow parsing of the information. Several different styles of tags are used:

  • Microformat tags follow industry standards and can be parsed by already existing tools.
  • <td> id attributes (identifiers) are custom markings which allow more complete tags, which have to be read by custom tools. Most universal infoboxes have two column structure: column #1 holds name of the field and column #2 holds the value
    • Traditionally <td> id attributes were used to tag the name call in the first column in a row. To get the data, you would need to get the contents of the following <td> cell in the second column.
    • {{Creator}} and {{Institution}} templates have more complicated structure, so the cells with the actual data are tagged with attributes using magenta background.
Sablon Sablonparaméter neve Leírás <td> id-attribútuma Mikroformátum Megjegyzés
{{Information}}descriptionfájl leírásafileinfotpl_deschProduct.description.Often contains multiple languages annotated with {{Lang}}.
{{Information}}dateaz eredeti mű készítési dátumafileinfotpl_datehCalendar vevent.dtstartNéha a közzététel dátumát – vagy a közzététel dátumát is – tartalmazza. A készítés és a közzététel dátumának szerzői jogi szempontból eltérő jelentése van. A {{Date context}} – ha használva van – tudja jelezni a különbséget. A mikroformátumot a {{Date}} sablon adja hozzá.
{{Information}}sourcea fájl forrásafileinfotpl_srcOften contains entire tables. We have no good way to deal with this source templates yet. Source templates often have references to catalogue IDs, but these are also not machine readable.
{{Information}}authora fájl szerzőjefileinfotpl_autThis can be author, creator and/or copyright holder and is used mixed. Often contains the {{Creator}} template which is described below.
{{Information}}permissionengedély/licenc a fájlhozfileinfotpl_perm
{{Information}}other versionsa fájl más változataifileinfotpl_ver
{{Artwork}}descriptiona műalkotás leírásafileinfotpl_deschProduct.description
{{Artwork}}dateaz eredeti műalkotás készítésének dátumafileinfotpl_datehCalendar vevent.dtstartmicroformat added by {{Date}} template
{{Artwork}}sourcea fájl forrásafileinfotpl_src
{{Artwork}}artista műalkotás készítőjefileinfotpl_aut"hProduct.fn value"
{{Artwork}}authora műalkotás szerzőjefileinfotpl_aut"hProduct.fn value"
{{Artwork}}permissionengedély/licenc a fájlhoz és a műalkotáshozfileinfotpl_perm
{{Artwork}}other versionsa fájl más változataifileinfotpl_ver
{{Artwork}}titlea műalkotás címefileinfotpl_art_titlehProduct.fn
{{Artwork}}object typeartwork object typefileinfotpl_art_object_type
{{Artwork}}mediuma műalkotás technikája vagy anyagafileinfotpl_art_medium
{{Artwork}}dimensionsa műalkotás méreteifileinfotpl_art_dimensions
{{Artwork}}gallerya műalkotást tároló intézményfileinfotpl_art_gallery
{{Artwork}}locationa műalkotás helye az intézményen belülfileinfotpl_art_locationhProduct.locality
{{Artwork}}accession numbera műalkotás leltári számafileinfotpl_art_idhProduct.identifier
{{Artwork}}object historya műalkotás származástörténetefileinfotpl_art_object_history
{{Artwork}}exhibition historya műalkotás kiállítástörténetefileinfotpl_art_exhibition_history
{{Artwork}}credit linecredit line of the artworkfileinfotpl_art_credit_line
{{Artwork}}inscriptionsa műalkotás felirataifileinfotpl_art_inscriptions
{{Artwork}}notesjegyzetek a műalkotásrólfileinfotpl_art_notes
{{Artwork}}referencesa műalkotáshoz kapcsolódó forráshivatkozásokfileinfotpl_art_references
{{Book}}Authora könyv szerőjefileinfotpl_author
{{Book}}Editora könyv szerkesztőjefileinfotpl_book_editor
{{Book}}Translatora könyv fordítójafileinfotpl_book_translator
{{Book}}Illustratora könyv illusztrátorafileinfotpl_book_illustrator
{{Book}}Titlea könyv címefileinfotpl_book_title
{{Book}}Subtitlea könyv alcímefileinfotpl_book_subtitle
{{Book}}Series titlea könyv sorozatcímefileinfotpl_book_series-title
{{Book}}Authority filenévkezelési adatokfileinfotpl_book_authority
{{Book}}Publishera könyv kiadójafileinfotpl_book_publisher
{{Book}}Printera könyv nyomtatójafileinfotpl_book_printer
{{Book}}Year of publicationa könyv kiadásának dátuma vagy évefileinfotpl_date
{{Book}}Place of publicationa könyv kiadásának helye vagy városafileinfotpl_book_place-of-publication
{{Book}}Languagea könyv nyelvefileinfotpl_book_language
{{Book}}Descriptiona könyv leírásafileinfotpl_desc
{{Creator}}Namea szerző nevecreatorvCard.fn
{{Creator}}Alternative namesa szerző további neveifileinfotpl_creator_alt-name_valuevCard.nickname
{{Creator}}Descriptiona szerző nemzetisége és foglalkozása(i)fileinfotpl_creator_desc_valuevCard.note
{{Creator}}Date of deatha szerző halálozási dátumafileinfotpl_creator_deathdate_value
{{Creator}}Date of birtha szerző születési dátumafileinfotpl_creator_birthdate_valuevCard.bday
{{Creator}}Location of birth/deatha szerző halálának helyefileinfotpl_creator_deathloc_value
{{Creator}}Location of birtha szerző születési helyefileinfotpl_creator_birthloc_value
{{Creator}}Work perioda szerző munkásságának időszakafileinfotpl_creator_work-period_value
{{Creator}}Work locationa szerző munkásságának helyefileinfotpl_creator_work-location_valuev
{{Creator}}Imagea szerzőt ábrázoló festmény vagy fényképfileinfotpl_creator_image
{{Creator}}Authority filea szerzőhöz kapcsolódó névkezelő rendszerekfileinfotpl_creator_authority_value


{{FileContentsByBot}}(változó)változó, lásd a {{FileContentsByBot}} sablonban(various)hproduct-by-botsok adat van beállítva és folyamatosan nő, lásd a {{FileContentsByBot}} sablont
{{Photograph}}titlea fénykép címefileinfotpl_art_titlehProduct.fn
{{Photograph}}descriptiona fénykép leírásafileinfotpl_deschProduct.description
{{Photograph}}original descriptionaz eredeti archívum leírása a fényképrőlfileinfotpl_deschProduct.description
{{Photograph}}dateaz eredeti műalkotás készítési dátumafileinfotpl_datehCalendar vevent.dtstartmicroformat added by {{Date}} template
{{Photograph}}mediuma fénykép technikája vagy anyagafileinfotpl_art_medium
{{Photograph}}dimensionsa fénykép méreteifileinfotpl_art_dimensions
{{Photograph}}artista fénykép készítőjefileinfotpl_aut"hProduct.fn value"
{{Photograph}}institutiona műalkotást tároló intézményfileinfotpl_art_gallery
{{Photograph}}locationa fénykép helye az intézményen belülfileinfotpl_art_locationhProduct.locality
{{Photograph}}sourcea fájl forrásafileinfotpl_src
{{Photograph}}permissionengedély/licenc a fájlhoz és a műalkotáshozfileinfotpl_perm
{{Photograph}}other versionsa fájl más változataifileinfotpl_ver
{{Photograph}}accession numbera fénykép leltári számahProduct.identifier

Alternative format for CommonsMetadata

Because the table + id based format proved very hard to add to templates which were not formatted similarly to the Commons information template, CommonsMetadata allows an alternative format, similar to license templates: the whole information template has to be enclosed in a fileinfotpl class and the tag containing the specific information needs to have a fileinfotpl_* class (same names as above, but class, not id).

Licencsablonok által beállított géppel olvasható adatok

2010 októbere óta <span class="licensetpl_XXX"> típusú osztályok használatával

licensetpl
Egy licencet azonosító elem. Beburkolja egy teljes licenc kódját, és egy EGYEDI licencnek kell lennie, nem egy többes licencnek.
licensetpl_short
A licenc rövid neve: „Public domain”, „CC BY SA 3.0”, „CC by 2.0 fr” stb.
licensetpl_long
A licenc hosszú neve: „Public domain”, „Creative Commons Attribution-Share Alike 3.0”, „Creative Commons Attribution 2.0 France” stb.
licensetpl_attr_req
Szükséges-e szerzőmegjelölés. „true” vagy „false”.
licensetpl_attr
A szükséges szerzőmegjelölés: szabad szöveg.
licensetpl_link_req
Szükséges-e linkelni a licencre. „true” vagy „false”.
licensetpl_link
A link a licenc összefoglalójára. „www.creativecommons.org/licenses/by-sa/XXX/YYY”
licensetpl_nonfree
„true”, ha ez egy nem szabad licenc (nincs használatban a Commonson, csak EDP-vel rendelkező wikiken).

Több azonos műhöz tartozó licensetpl-blokk be lehet burkolva egyetlen, licensetpl_wrapper osztályt használó blokkba.

Ezeket az információkat beállító sablonok

  • Templates setting licensetpl include:

{{PD-Layout}}, {{Cc-by-sa-3.0-migrated}}, {{Cc-by-layout}}, {{Cc-by-sa-layout}}, {{Cc-zero}}, {{FAL}}, {{GFDL}}, {{GFDL-1.2}}, {{GPL}} és {{LGPL}}.

Formázósablonok által beállított géppel olvasható adatok

A stílusformázó sablonok, amik arra vannak, hogy egységes stílust szolgáltassanak különböző nem-licenc sablonoknak, hordoznak géppel olvasható adatokat, amik azonosítják ezeket a sabloncsaládokat.

Sablon Cél Osztály neve
{{Restriction-Layout}} used by Restriction tags restrictiontemplate
{{FoP-Layout}} used by freedom of panorama tags foptemplate
{{Partnership-Layout}} used by Partnership templates partnershiptemplate
{{Source-Layout}} used by generic Source templates sourcetemplate
{{Created with}} used by Created with ... templates createdwithtemplate

Templates regarding non-copyright legal restrictions carry these classes to identify specific types of restrictions.

Template(s) Purpose class name
{{Trademarked}} Trademarked images restriction-trademarked
{{Copydesign}} Copyrighted designs restriction-design
{{Communist symbol}} Communist symbols restriction-communist
{{Italy-MiBAC-disclaimer}} {{Soprintendenza}} Italian cultural goods restriction-ita-mibac
{{Australian Commonwealth reserve}} Australian reserves restriction-aus-reserve
{{Personality rights}} {{Romania personality rights}} Personality rights restriction-personality
{{2257}} Child Protection and Obscenity Enforcement Act warning (United States) restriction-2257
{{Costume}} Costuming restriction-costume
{{Fan art}} Fan art restriction-fan-art
{{Currency}} Currency restriction-currency
{{IHL Symbol}} Symbols restricted by International Humanitarian Law restriction-ihl
{{Nazi symbol}} Nazi and fascist symbols restriction-nazi
{{Insignia}} Official insignia restriction-insignia

Specifikus sablonok által beállított géppel olvasható adatok

More machine-readable data are set. Here is a non-exhaustive list:

{{Personality rights}}
<span class="commons-template-name" style="display:none" id="commons-template-personality-rights">Personality rights</span>
{{Credit line}}
<td id="fileinfotpl_credit" class="fileinfo-paramfield fileinfotpl_credit" style=""></td>

Machine-readable data set by location templates

{{Location}} and similar templates add machine-readable geocodes in the following format: <span class="geo">12.34;24.68</span> (latitude and longitude as floating-point numbers, separated by a semicolon). The coordinates use the en:WGS84 system (same as the GPS and most online maps). See Commons:Geocoding for more details.

Usage

MediaWiki API

The MediaWiki API now serves a limited number of metadata. Consider the following query:

(Open in API Sandbox) that returns some useful parameters such as Credit, Artist, LicenseUrl and Copyrighted and is used by Media Viewer, for example.

Scripts using machine-readable data

External tools

See also

Defining new machine readable data

  • Do NOT use HTML id's, use classes. An ID can only be used once per page and most of these fields can occur multiple times per page. Consider for instance descriptions of derivative works, which can include information about the original and the derivative.
  • When possible, wrap the actual data, not some field header. This last method is historically used for all our Information templates, but much harder to support in the long run.
  • Wrap data, not the way the data is formatted.
  • Expect that formatting is lost when converting to data. Visual dress up is not part of the information.
  • Don't wrap multiple units of information inside one field. There is a difference between a publication date and a creation date. Both are dates, but both are different 'data fields'. Also CC BY-SA-4.0-3.0-2.5 is not a license name, those would be 3 licenses with the name CC BY-SA-##.
  • Make sure that the data value has one unit, or outputs one consistent unit.

Problems

There are a few things that are currently NOT or badly recognizable. These include:

  • Derivative works
  • Works included in works. See also Category:FoP_templates
  • licenses derivates or works included in works are a mess.
  • Author vs. Copyright holder
  • usernames vs 'real names'
  • Catalogue IDs etc
  • VRTS permissions
  • Publication date vs creation date
Category:Commons help/hu
Category:Commons help/hu