Wikidata:डेटा की अनुमतियाँ

This page is a translated version of the page Wikidata:Data access and the translation is 53% complete.
Outdated translations are marked like this.

विकिडेटा पर इस समय 10 करोड़ से अधिक आयटम्स और 6.5 लाख से अधिक लेक्सिमे हैं, और इनकी संख्या बढ़ती ही जाएगी। इस डेटा का इस्तेमाल करने के कई तरीके हैं — इस दस्तावेज़ में तरीके दिए गए हैं और यह भी बताया गया है कि इनके उपयोग के उचित मामले क्या हैं।

एक ऐसा तरीका चुनना ज़रूरी है जिससे आपको डेटा सबसे जल्दी प्राप्त हो और विकिडेटा पर बेकार का भार न आए; इसी पृष्ठ पर आप ऐसा करना सीख सकते हैं।

शुरुआत करने से पहले

विकिडेटा के डेटा का इस्तेमाल करना

 
हमारा लोगो

विकिडेटा पर, इस दुनिया में मौजूद ज़्यादातर चीज़ों के बारे में साधारण डेटा है। उस सारी डेटा को सार्वजनिक डोमेन के लिए CC0, "नाधिकार सुरक्षित" के अंतर्गत लाइसेंस किया गया है।

API और विकिडेटा का इस्तेमाल करने के दूसरे तरीकों में बदलाव स्थिर इंटरफ़ेस नीति के अंतर्गत होंगे। यह आश्वासन नहीं दी जाती कि इस पृष्ठ पर दर्ज डेटा स्रोत स्थिर होंगे।

विकिमीडिया की परियोजनाएँ

इस दस्तावेज़ में विकिमीडिया की परियोजनाओं के बाहर से डेटा प्राप्त करने के बारे में जानकारी है। अगर आप किसी दूसरे विकिमीडिया परियोजना में विकिडेटा के डेटा का इस्तेमाल करना चाहते हैं, जहाँ आप पार्सर फंक्शन्स, लुआ और/या दूसरे आंतरिक तरीकों का इस्तेमाल कर सकते हैं, "विकिमीडिया की परियोजनाओं पर डेटा का इस्तेमाल कैसे करें" देखें।

डेटा की सर्वोत्तम प्रथाएँ

 
इन – और आप – जैसे स्वयंसेवकों ने विकिडेटा बनाया है

हम विकिडेटा पर मुक्त डेेटा प्रदान करते हैं और CC-0 के अंतर्गत हमें श्रेय देना भी आपको आवश्यक नहीं। मगर इन सबके बदले हमारा अनुरोध है कि आप अपने डेटा के स्रोत के रूप में विकिडेटा का एक बार उल्लेख करें। ऐसा करके आप निश्चित करेंगे कि विकिडेटा लंबे समय तक अद्यत और उच्च गुुणवत्ता की जानकारी प्रदान करता रहेगा। हम उन परियोजनाओं को बढ़ावा भी देते हैं जो विकिडेटा का इस्तेमाल करते हैं।

विकिडेटा को श्रेय देने के कुछ उदाहरण: "विकिडेटा द्वारा संचालित", "विकिडेटा के डेटा द्वारा संचालित", "विकिडेटा के जादू द्वारा संचालित", "विकिडेटा से डेटा उपयुक्त", "विकिडेटा के डेटा के ज़रिए", "विकिडेटा से डेटा", "स्रोत: विकिडेटा", "विकिडेटा का डेटा शामिल", और इसी तरह के श्रेय। आप हमारे कुछ मौजूदा फ़ाइलों का भी इस्तेमाल कर सकते हैं।

आप ऊपर दिए गए विकिडेटा के लोगो का इस्तेमाल कर सकते हैं, मगर आप विकिडेटा या विकिमीडिया संस्थान द्वारा किसी अनुमोदन को दर्शाने के लिए ऐसा नहीं कर सकते।

कृपया अपने सदस्यों को डेटा में समस्याओं को रिपोर्ट करने का एक तरीका दें, ताकि वे यह प्रतिक्रिया विकिडेटा के समुदाय को दे सकें, उदाहरणस्वरूप Mismatch Finder के ज़रिए। कृपया परियोजना चैट में वह जगह दें जहाँ पर आप इन समस्याओं को इकट्ठा करते हैं।

उपयोग की सर्वोत्तम प्रथाएँ

विकिडेटा के डेटा का इस्तेमाल करते समय इन सर्वोत्तम प्रथाओं का पालन करें:

  • सदस्य-एजेंट नीति का पालन करें -- सदस्य-एजेंट का एक अच्छा हैडर भेजें।
  • रोबोट नीति का पालन करें: Accept-Encoding: gzip,deflate भेजें और एक साथ ज़्यादा अनुरोध न भेजें।
  • अगर आपको '429 Too Many Requests' जवाब आता है, कुछ समय के लिए और अनुरोध न भेजें ('Retry-After' जवाब हैडर देखें)
  • जब उपलब्ध हो (जैसे विकिडेटा क्वेरी सेवा के ज़रिए), अपने डेटा के लिए उचित न्यूनतम टाइमआउट रखें।
  • मीडियाविकि प्रतिक्रिया API का इस्तेमाल करते समय maxlag पैरामीटर का इस्तेमाल करें और API:शिष्टाचार पर दिशानिर्देशों का पालन करें।

खोज

यह क्या है?

विकिडेटा के डेटा को खोजने के लिए एक Elasticsearch इनडेक्स प्रदान किया जाता है: Special:Search

इसका इस्तेमाल कब करें?

खोज का इस्तेमाल तब करें जब आपको कोई टेक्स्ट स्ट्रिंग ढूँढ़ना हो, या फिर अगर आपको सत्तों के नाम पता हों मगर सटीक सत्ते नहीं। यह तब भी काम आता है जब आप कुछ बिलकुल ही साधारण संबंधों वाली डेटा ढूँढ़ना चाहते हों।

अगर आपको लगता है कि आपके खोज में संबंध कठिन हैं, खोज का इस्तेमाल न करें।

जानकारी

आप सिर्फ विकिडेटा पर उपलब्ध अतिरिक्त कीवर्ड्स की मदद से अपने खोज को और भी शक्तिशाली बना सकते हैं: haswbstatement, inlabel, wbstatementquantity, hasdescription, haslabel। इस खोज कार्यक्षमता को CirrusSearch के एक्सटेंशन पृष्ठ पर प्रलेखित किया गया है। इसके पास अपनी एक API क्रिया है।

जुड़े हुए डेटा का इंटरफ़ेस (URI)

यह क्या है?

जुड़े हुए डेटा के इंटरफ़ेस की मदद से आप URI के ज़रिए सत्तों को पढ़ सकते हैं: http://www.wikidata.org/entity/Q???

इसका इस्तेमाल कब करें?

जुड़े हुए डेटा के इंटरफ़ेस का इस्तेमाल तब करें जब आपको ज्ञात, पूर्ण सत्ते प्राप्त करने हों।

इसका इस्तेमाल तब न करें जब आपको पता न हो कि आपको कौन-से सत्ते पहले चाहिए — पहले खोजें या क्वेरी करके देखें। इसका इस्तेमाल अधिक मात्रा में डेटा का अनुरोध करते हुए भी न करें।

जानकारी

 
Q42 से मिलें

हर आयटम या गुणधर्म पर एक स्थायी URI होता है जिसमें विकिडेटा पर परिकल्पना का नामस्थान और आयटम या गुणधर्म ID शामिल होते हैं (जैसे Q42, P31), और साथ में कुछ स्थायी डेटा जिस तक आयटम या गुणधर्म के डेटा URL की मदद से पहुँचा जा सकता है।

विकिडेटा पर सत्तों के बारे में डेटा के लिए नामस्थान है https://wikidata.org/wiki/Special:EntityData

इस उपसर्ग के आखिर में सत्ते की ID जोड़ने पर (आप छोटे रूप में /entity/ का इस्तेमाल कर सकते हैं) सत्ते के डेटा URL का एक स्थिर (प्रारूप-असंवेदनशील) रूप बनेगा। Special:EntityData नामस्थान में किसी संसाधन का इस्तेमाल करते समय विशेष पृष्ठ सामग्री समझौता की मदद से आउटपुट का प्रारूप तय करता है। अगर आपने संसाधन किसी ब्राउज़र में खोला हुआ है, आपको डेटा के साथ एक HTML पृष्ठ दिखेगा, क्योंकि वेब ब्राउज़रों को HTML पसंद है। मगर कोई जुड़े हुए डेटा का क्लाइंट सत्ते के डेटा को JSON या RDF जैसे किसी प्रारूप में प्राप्त करेगा — जो भी क्लाइंट अपने HTTP Accept: हैडर में निर्दिष्ट करे।

उदाहरणस्वरूप, डग्लस अडम्स का यह 'परिकल्पना URI' लें — यह एक वास्तविक व्यक्ति का सन्दर्भ है, विकिडेटा के स्थायी विवरण का नहीं:
http://www.wikidata.org/entity/Q42
आँखों और ब्राउज़र वाला एक इंसान होने के नाते आप ज़रूर URL के रूप में परिकल्पना URI के ज़रिए डग्लस अडम्स के बारे में डेटा प्राप्त करना चाहेंगे। ऐसा करने पर एक HTTP अनुप्रेषण ट्रिगर होगा जो क्लाइंट को डेटा के URL पर भेज देता है, जिसमें डग्लस अडम्स के बारे में विकिडेटा की डेटा मौजूद होती है: https://www.wikidata.org/wiki/Special:EntityData/Q42।

जब आपको सामग्री समझौता बाइपास करना हो, जैसे वेब ब्राउज़र में कोई गैर-HTML सामग्री देखने के लिए, आप डेटा URL पर उचित एक्सटेंशन को निर्दिष्ट करके सत्ते के डेटा का प्रारूप निर्दिष्ट कर सकते हैं; कुछ उदाहरण हैं .json, .rdf, .ttl, .nt या .jsonld। उदाहरणस्वरूप, https://www.wikidata.org/wiki/Special:EntityData/Q42.json से आपको आयटम Q42 JSON प्रारूप में मिलेगा।

छोटा RDF आउटपुट

By default, the RDF data that the Linked Data interface returns is meant to be complete in itself, so it includes descriptions of other entities it refers to. If you want to exclude that information, you can append the query parameter ?flavor=dump to the URL(s) you request.

By appending &flavor to the URL, you can control exactly what kind of data gets returned.

  • ?flavor=dump: Excludes descriptions of entities referred to in the data.
  • ?flavor=simple: Provides only truthy statements (best-ranked statements without qualifiers or references), along with sitelinks and version information.
  • ?flavor=full (default): An argument of "full" returns all data. (You don't need to specify this because it's the default.)

If you want a deeper insight into exactly what each option entails, you can take a peek into the source code.

अवतरण और कैशिंग

You can request specific revisions of an entity with the revision query parameter: https://www.wikidata.org/wiki/Special:EntityData/Q42.json?revision=112.

The following URL formats are used by the user interface and by the query service updater, respectively, so if you use one of the same URL formats there’s a good chance you’ll get faster (cached) responses:

विकिडेटा क्वेरी सेवा

यह क्या है?

The Wikidata Query Service (WDQS) is Wikidata's own SPARQL endpoint. It returns the results of queries made in the SPARQL query language: https://query.wikidata.org

इसका इस्तेमाल कब करें?

Use WDQS when you know only the characteristics of your desired data.

Don't use WDQS for performing text or fuzzy search – FILTER(REGEX(...)) is an antipattern. (Use search in such cases.)

WDQS is also not suitable when your desired data is likely to be large, a substantial percentage of all Wikidata's data. (Consider using a dump in such cases.)

जानकारी

You can query the data in Wikidata through our SPARQL endpoint, the Wikidata Query Service. The service can be used both as an interactive web interface, or programmatically by submitting GET or POST requests to https://query.wikidata.org/sparql.

The query service is best used when your intended result set is scoped narrowly, i.e., when you have a query you're pretty sure already specifies your resulting data set accurately. If your idea of the result set is less well defined, then the kind of work you'll be doing against the query service will more resemble a search; frequently you'll first need to do this kind of search-related work to sharpen up your query. See the Search section.

Linked Data Fragments endpoint

यह क्या है?

The Linked Data Fragments (LDF) endpoint is a more experimental method of accessing Wikidata's data by specifying patterns in triples: https://query.wikidata.org/bigdata/ldf. Computation occurs primarily on the client side.

इसका इस्तेमाल कब करें?

Use the LDF endpoint when you can define the data you're looking for using triple patterns, and when your result set is likely to be fairly large. The endpoint is good to use when you have significant computational power at your disposal.

Since it's experimental, don't use the LDF endpoint if you need an absolutely stable endpoint or a rigorously complete result set. And as mentioned before, only use it if you have sufficient computational power, as the LDF endpoint offloads computation to the client side.

जानकारी

If you have partial information about what you're looking for, such as when you have two out of three components of your triple(s), you may find what you're looking for by using the Linked Data Fragments interface at https://query.wikidata.org/bigdata/ldf. See the user manual and community pages for more information.

Wikibase REST API

What is it?

The Wikibase REST API is an OpenAPI-based interface that allows users to interact with, retrieve and edit items and statements on Wikibase instances – including of course Wikidata: Wikidata REST API

When to use it?

The Wikibase REST API is still under development, but for Wikidata it's intended to functionally replace the Action API as it's a dedicated interface made just for Wikibase/Wikidata.

The use cases for the Action API apply to the Wikibase REST API as well. Use it when your work involves:

  • Editing Wikidata
  • Getting direct data about entities themselves

Don't use the Wikibase REST API when your result set is likely to be large. (Consider using a dump in such cases.)

It's better not to use the Wikibase REST API when you'll need to further narrow the result of your API request. In such cases it's better to frame your work as a search (for Elasticsearch) or a query (for WDQS).

Details

The Wikibase REST API has OpenAPI documentation using Swagger. You can also review the developer documentation.

मीडियाविकि प्रतिक्रिया API

यह क्या है?

The Wikidata API is MediaWiki's own Action API, extended to include some Wikibase-specific actions: https://wikidata.org/w/api.php

इसका इस्तेमाल कब करें?

Use the API when your work involves:

  • Editing Wikidata
  • Getting data about entities themselves such as their revision history
  • Getting all of the data of an entity in JSON format, in small groups of entities (up to 50 entities per request).

Don't use the API when your result set is likely to be large. (Consider using a dump in such cases.)

The API is also poorly suited to situations in which you want to request the current state of entities in JSON. (For such cases consider using the Linked Data Interface, which is likelier to provide faster responses.)

Finally, it's probably a bad idea to use the API when you'll need to further narrow the result of your API request. In such cases it's better to frame your work as a search (for Elasticsearch) or a query (for WDQS).

जानकारी

The MediaWiki Action API used for Wikidata is meticulously documented on Wikidata's API page. You can explore and experiment with it using the API Sandbox.

बॉट्स

 
We welcome well-behaved bots

You can also access the API by using a bot. For more on bots, see Wikidata:Bots.

हाल में हुए बदलावों का स्ट्रीम

यह क्या है?

The Recent Changes stream provides a continuous stream of changes of all Wikimedia wikis, including Wikidata: https://stream.wikimedia.org

इसका इस्तेमाल कब करें?

Use the Recent Changes stream when your project requires you to react to changes in real time or when you need all the latest changes coming from Wikidata – for example, when running your own query service.

जानकारी

The Recent Changes stream contains all updates from all wikis using the server-sent events protocol. You'll need to filter Wikidata's updates out on the client side.

You can find the web interface at stream.wikimedia.org and read all about it on the EventStreams page.

डम्प्स

ये क्या हैं?

Wikidata dumps are complete exports of all the Entities in Wikidata: https://dumps.wikimedia.org

इनका इस्तेमाल कब करें?

Use a dump when your result set is likely to be very large. You'll also find a dump important when setting up your own query service.

Don't use a dump if you need current data: the dumps take a very long time to export and even longer to sync to your own query service. Dumps are also unsuitable when you have significant limits on your available bandwidth, storage space and/or computing power.

जानकारी

If the records you need to traverse are many, or if your result set is likely to be very large, it's time to consider working with a database dump: (link to the latest complete dump).

You'll find detailed documentation about all Wikimedia dumps on the "Data dumps" page on Meta and about Wikidata dumps in particular on the database download page. See also Flavored dumps above.

उपकरण

  • JsonDumpReader is a PHP library for reading dumps.
  • At [१] you'll find a Go library for processing Wikipedia and Wikidata dumps.
  • You can use wdumper to get partial custom RDF dumps.

लोकल क्वेरी सेवा

It's no small task to procure a Wikidata dump and implement the above tools for working with it, but you can take a further step. If you have the capacity and resources to do so, you can host your own instance of the Wikidata Query Service and query it as much as you like, out of contention with any others.

To set up your own query service, follow these instructions from the query service team, which include procuring your own local copy of the data. You may also find useful information in Adam Shorland's blog post on the topic.