Extension:WikibaseMediaInfo

This page is a translated version of the page Extension:WikibaseMediaInfo and the translation is 100% complete.
मीडियाविकि एक्सटेंशन मैन्युअल
WikibaseMediaInfo
प्रकाशन की स्थिति: स्थिर
विवरण विकिबेस एक्सटेंशन जो मीडिया फ़ाइलों की संरचित मेटाडेटा को अनुरक्षित करता है
लेखक संरचित डेटा दल
नवीनतम संस्करण निरंतर अद्यतन
MediaWiki master
डेटाबेस बदलता है हाँ
Composer wikibase/media-info
लाइसेंस GNU साधारण सार्वजनिक लाइसेंस 2.0 या अधिक
डाउनलोड करें
readme
  • $wgMediaInfoMediaSearchProfiles
  • $wgMediaInfoSupportedDataTypes
  • $wgMediaInfoProperties
  • $wgMediaInfoExternalEntitySearchBaseUri
  • $wgMediaInfoCustomMatchFeature
  • $wgMediaInfoHelpUrls
  • $wgMediaInfoMediaSearchTitleMatchBaseUri
  • mediainfo-term
Quarterly downloads 4 (Ranked 136th)
WikibaseMediaInfo एक्सटेंशन को अनुवादित करें
मुद्दे अधूरे कार्य · बग की रिपोर्ट करें

WikibaseMediaInfo एक Wikibase के लिए एक्सटेंशन है जो मल्टीमीडिया फ़ाइलों के बारे में संरचित डेटा हैंडल करने के लिए MediaInfo सत्ते जोड़ता है।

एक्सटेंशन चित्र पृष्ठ से हुक हो जाता है। यह एक MediaInfo सत्ते में फ़ाइल के बारे में पूरक मेटाडेटा (कैप्शन्स और चित्रण बयान) रखता है। सदस्य यह डेटा देख, बना, सम्पादित कर, और हटा सकते हैं।


आवश्यकताएँ


स्थापना

  • Ensure CirrusSearch, Wikibase (client and repo) and WikibaseCirrusSearch are set up properly.
  • फ़ाइलों को डाउनलोड करें और अपने extensions/ फ़ोल्डर के WikibaseMediaInfo नामक डिरेक्ट्री में डालें।
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/WikibaseMediaInfo
  • सिर्फ गिट से डाउनलोड करते समय एक्सटेंशन डिरेक्ट्री से composer install --no-dev प्रकाशित करके PHP निर्भरताएँ स्थापित करने के लिए Composer चलाएँ। (संभावित जटिलताओं के लिए टास्क T173141 देखें।)
  • अपने LocalSettings.php फ़ाइल के अंत में निम्न कोड जोड़ें:
    wfLoadExtension( 'WikibaseMediaInfo' );
    
  • अपडेट स्क्रिप्ट चलाएँ जो स्वचालित रूप से आवश्यक डेटाबेस टेबल्स का निर्माण करेगा जिसकी इस एक्सटेंशन को आवश्यकता है।
  •   पूर्ण – अपने विकि पर Special:Version पर जाकर देखें कि एक्सटेंशन को सफलतापूर्वक स्थापित किया गया है कि नहीं।
  • Add configuration.

MediaInfo का UI

MediaInfo सत्ते उनके संबंधित फ़ाइल पृष्ठों पर तथा UploadWizard के ज़रिए फ़ाइलें अपलोड करते समय दिखाया जा सकता है, और उन्हें वहीं से सम्पादित भी किया जा सकता है।

There are separate sections in the UI for editing captions and statements.

An editing interface for is always shown for default properties (defaults are defined in config). On live commons depicts is the only default property - users are encouraged to say what is depicted by an image. Statements with other properties can be added by the user at will.

शब्दावली

MediaInfo सत्ता

एक विकिबेस सत्ता जिसमें मीडिया फ़ाइलों के बारे में संरचित डेटा होती है। It is stored in a slot on a File page and consists of

  • an ID in the form Mxxx, where xxx is the id of the associated wiki page
  • कैप्शन्स की कोई भी संख्या (हर भाषा के लिए एक)
  • बयानों की कोई भई संख्या

(Note: if there is no caption or statement data then the entity is not stored in the database - in this case it is known as a 'virtual entity')

कैप्शन

टेक्स्ट का एक छोटा हिस्सा जो मीडिया फ़ाइल को वर्णित करता है, और साथ में उसकी भाषा। Used to provide a short description of the file (the same as 'labels' in Wikibase).

Statement

A single fact about a media file consisting of a key-value pair such as Licence=CC-BY-SA or Depicts=Dog.

Keys are always a property. Values can be any wikibase datatype.

Strictly, a wikibase 'statement' means a key-value pair (a 'claim') plus a rank (preferred, normal, or deprecated) and zero or more documentary references. We don't typically have documentary references for descriptions of files, and all statements have a normal rank by default, so in MediaInfo we prefer to use the term 'statement' instead of 'claim'.

Property

A property is a property of a file that can have a value - for example 'depicts' (what an image is a picture of), 'resolution', 'created by', 'license'. Each property has a unique id in wikibase in the form Pxxx such as P123.

Item

An item is a concept, topic, or object with an id - for example on Wikidata the CC0 licence is Q6938433, physics is Q413 and the planet Earth is Q2. Each item has a unique id in wikibase in the form Qxxx such as Q123.

क्वालिफ़ायर

एक क्वालिफ़ायर एक अप्राथमिक वाक्य है जो प्राथमिक वाक्य को संशोधित करता है। उदाहरणस्वरूप, एक चित्र के सामने पेड़ हो सकता है और पीछे समुद्र, जिस मामले में इसमें इससे संबंधित दो 'चित्रण' दावे जोड़े जाएँगे - 'depicts=tree(applies to part=foreground)' and 'depicts=sea(applies to part=background)'।

खोजना

कैप्शन से खोजें

सदस्य फ़ाइलों को उनके MediaInfo कैप्शन्स की मदद से उसी तरह ढूँढ़ सकते हैं जैसा वे किसी और चीज़ को ढूँढ़ते होंगे। उदाहरणस्वरूप, अगर कोई एफिल टॉवर का चित्र अपलोड करता है और बहुभाषी फ़ाइल कैप्शन्स के रूप में 'Tour Eiffel' (फ़्रांसीसी) और 'Eiffel Tower' (अंग्रेज़ी) जोड़ता है, चित्र को 'Eiffel Tower' और 'Tour Eiffel', दोनों में से किसी भी एक भाषा से खोजकर पाया जा सकेगा।

दावे/बयान खोजें

WikibaseCirrusSearch कीवर्ड्स की मदद से दावे/बयान खोजना। विस्तार के लिए देखें: Help:WikibaseCirrusSearch

खोजने का कार्यान्वयन

जब फ़ाइल को सहेजा जाता है, Elasticsearch इनडेक्स पर निम्न MediaInfo डेटा लिख दी जाती है (सभी उदाहरणों पर विकिडेटा के गुणधर्म और आयटम ID-ओं का इस्तेमाल किया गया है):

  • हर भाषा में कैप्शन डेटा को opening_text फ़ील्ड में रखा जाता है
  • दावों को propertyID=value प्रारूप में statement_keywords फ़ील्ड में ऐरे तत्वों के रूप में विकिबेस गुणधर्म ID (और आयटम ID, अगर वैल्यू आयटम है) की मदद से रखा जाता है - उदाहरणस्वरूप, 'depicts house cat' को P180=Q146 के रूप में रखा जाता है
  • क्वालिफ़ायर वाले दावों को statement_keywords फ़ील्ड में उनके क्वालिफ़ायर्स के साथ propertyID=value[qualifierPropertyID=qualifierValue] प्रारूप में रखा जाता है। उदाहरणस्वरूप, मॉना लिसा के चित्र (विकिडेटा आयटम Q12418) की पृष्ठभूमि में एक आसमान (Q13217555) दिखाया गया है (विकिडेटा गुणधर्म P518)। अगर हम इस डेटा को एक विकिबेस दावे के रूप में सजाएँ, यह होगा: 'depicts sky, applies to part background' जिसे P180=Q12418[P518=Q13217555] के रूप में रखा जाएगा।
  • ध्यान रखें कि क्वालिफ़ायर वाले दावों को खोजने में आसान बनाने के लिए क्वालिफ़ायर के बिना भी रखा जाता है। उदाहरणस्वरूप, अगर कोई ऊपर का दावा-और-क्वालिफ़ायर दर्ज करता है, दावा P180=Q12418 भी रखा जाता ह, ताकि कोई सिर्फ 'depicts sky', और 'depicts sky, applies to part background' खोजकर भी फ़ाइल को ढूँढ़ सके।
  • क्लालिफ़ायर वाले दावों की डेटा को statement_quantity फ़ील्ड में propertyID=value|quantity प्रारूप में रखा जाता है, जैसे 'depicts human, quantity 1' को P180=Q5|1 के रूप में रखा जाता है।

ध्यान रखें कि सभी दावों को नहीं रखा जाता है। दावे को ElasticSearch में सिर्फ तभी इनडेक्स किया जाएगा जब निम्न में से सभी मानदंड पूरे होते हों:

  • दावे में एक असली वैल्यू है (यानी इसका वैल्यू 'कोई वैल्यू नहीं' या 'अज्ञात वैल्यू' नहीं है) और
  • हमें पता है कि इसके वैल्यू को इनडेक्सिंग के लिए कैसे प्रोसेस करना है। भविष्य में शायद और भी वैल्यू प्रोसेसर्स जोड़े जाएँगे, मगर इस समय हमारी आवश्यकता यह है कि वैल्यू को या तो एक Q आयटम ID, एक स्ट्रिंग (अक्षरांकीय), या फिर एक मात्रा (आंकिक) होना होगा और
  • दावे की विकिडेटा गुणधर्म ID अनदेखा की गई ID-ओं की कॉन्फ़िगर करने योग्य सूची ($wgWBRepoSettings[ 'searchIndexPropertiesExclude' ]) में मौजूद नहीं है और या तो इसकी गुणधर्म ID इनडेक्स करने के लिए गुणधर्म ID-ओं की एक कॉन्फ़िगर करने योग्य सूची ($wgWBRepoSettings[ 'searchIndexProperties' ]) में मौजूद है या इसका गुणधर्म प्रकार इनडेक्स करने के लिए गुणधर्म प्रकारों की एक कॉन्फ़िगर करने योग्य सूची ($wgWBRepoSettings[ 'searchIndexTypes' ]) में मौजूद है

ध्यान रखें कि दावे की मात्रा को रखने के लिए दावे को ऊपर के सभी मानदंडों को पूरा करना होगा और मात्रा के पहचानकर्ता की गुणधर्म ID को गुणधर्म ID-ओं की एक कॉन्फ़िगर करने योग्य सूची ($wgWBRepoSettings[ 'searchIndexQualifierPropertiesForQuantity' ]) में मौजूद होना होगा।

MediaSearch खोज प्रोफ़ाइल

संरचित डेटा (कैप्शन्स और बयानों) को एब (सिर्फ) NS_FILE नामस्थान में खोजते समय डिफ़ॉल्ट खोज प्रोफ़ाइल में भी शामिल किया जाता है। "dog" जैसे खोज शब्दों में वे फ़ाइलें भी शामिल होंगी जिनके कैप्शन में (सदस्य की भाषा में) "dog" मौजूद है या फिर एक P180=Q144 बयान मौजूद है (depicts=dog)।

For a more elaborate (technical) writeup up the MediaSearch search profile, see the Extension:WikibaseMediaInfo/MediaSearch subpage.

कॉन्फ़िगरेशन

एक्सटेंशन के कॉन्फ़िगरेशन वेरिएबल्स कुँजी-वैल्यू जोड़ियों में पाए जाते हैं। They are documented in more detail in WikibaseMediaInfo/extension.json. All config variables are added toLocalSettings.php.

इस एक्सटेंशन के लिए निम्नलिखित कॉन्फ़िगरेशन विकल्प उपलब्ध हैं:

Config (in LocalSettings.php)

  • $wgMediaInfoProperties Default wikibase properties that will always be shown, allowing users to add/edit/delete values for them, on the File page/UploadWizard, regardless or not they already have a value. On live Commons this is the depicts (P180) property, as we want to encourage users to fill in values for this in particular. Value is an array of key-value pairs connecting a label name to an existing wikibase database id.
   ['depicts' => 'P180']
  • $wgMediaInfoHelpUrls URLs for pages where a user can learn more about particular wikibase properties - if there is a help URL for a particular property then there will be a "learn more" link for that property that leads to the URL from the config.
   ['P180' => 'https://www.wikidata.org/wiki/Property:P180']

Other Config

  • $wgUploadWizardConfig['wikibase']['enabled'] Enables MediaInfo data on UploadWizard when set to true.

विकास

परीक्षण

PHPUnit tests are located in tests/phpunit. You can run tests not requiring the MediaWiki framework (located in tests/phpunit/composer) by running composer test. यह कमांड PHPCS की मदद से कोड स्टाइल जाँच भी चलाता है।

मीडियाविकि फ़्रेमवर्क (tests/phpunit/mediawiki में स्थित) पर निर्भर परीक्षणों को मीडियाविकि के मूल composer phpunit:entrypoint एंडपॉइंट की मदद से चलाना होता है।

जावास्क्रिप्ट परीक्षण tests/node-qunit पर स्थित हैं। आप npm run test:unit की मदद से टर्मिनल से भी परीक्षण चला सकते हैं। Node के संस्करण 6.x का इस्तेमाल किया जाना चाहिए।

ये भी देखें