ويكاموس arwiktionary https://ar.wiktionary.org/wiki/%D9%88%D9%8A%D9%83%D8%A7%D9%85%D9%88%D8%B3:%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A9_%D8%A7%D9%84%D8%B1%D8%A6%D9%8A%D8%B3%D9%8A%D8%A9 MediaWiki 1.46.0-wmf.26 case-sensitive ميديا خاص نقاش مستخدم نقاش المستخدم ويكاموس نقاش ويكاموس ملف نقاش الملف ميدياويكي نقاش ميدياويكي قالب نقاش القالب مساعدة نقاش المساعدة تصنيف نقاش التصنيف ملحق نقاش الملحق مكنز نقاش المكنز TimedText TimedText talk وحدة نقاش الوحدة فعالية نقاش فعالية ويكاموس:الميدان 4 623 1089698 1089663 2026-04-28T15:44:20Z حبيشان 31560 /* تجربة إضافة الاستشهاد الآلي بويكي بيانات، مع طلب جعلها افتراضية */ قسم جديد 1089698 wikitext text/x-wiki {{/مقدمة}}__فهرس__ == تشكيل عنوان المقالة في ويكاموس العربي والنسخ اللغوية الأخرى == يعتمد ويكاموس العربي تشكيل اسم الصفحة باعتبار أنه مع اختلاف التشكيل فإننا المفردة مختلفة عن أختها، لكن أغلب النسخ اللغوية الأخرى ومن أهمها الإنجليزي تعتمد اسم الصفحة بدون تشكيل وتجمع جميع المفردات التي تشترك في نفس رسم الكلمة بدون تشكيل في صفحة واحدة. ;تأثير هذا الاختلاف: يؤثر هذه الاختلاف بين النسخ اللغوية في الربط بين النسخ اللغوية المختلفة لأن الربط يكون باسم الصفحة وإذا وجدت صفحة مشكلة وصفحة غير مشكلة فإنهما صفحتان مختلفتان لذا فإنها لا تربط لا حظ مثلا صفحة [[قَتَلَ]] تجد أنها مربوطة مع النسخة الفرنسية فقط ولكن افتح صفحة [[:en:قتل]] تجد أنها مربوطة ب 25 نسخة لغوية، وهذا يؤثر على الاستفادة من المحتوى العربي في ويكاموس العربي بشدة. لذا فأرجو إعادة النظر في منهجية تشكيل اسم الصفحةة في ويكاموس، وهذا نقاش مفتوح وكل يذكر ما يراه صوابا مع الأسباب، وقد فتحت نقاشا في مجموعة التلجرام فتبين أن ويكاموس الفرنسي والإيطالي يلتزمان بالتشكيل في عنوان الصفحة. وهذا الأمر يستوجب وجود سياسة عالمية لأنها تحدد الربط بين المشاريع. [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 08:54، 17 نوفمبر 2025 (ت ع م) :[[ويكاموس:الميدان/أرشيف/2017#مفردات ويكاموس|نقاش سابق]]، إشارة إلى المشاركين فيه @[[مستخدم:أحمد ناجي|أحمد ناجي]] @[[مستخدم:Avicenno|Avicenno]] @[[مستخدم:أبو هشام|أبو هشام]] @[[مستخدم:أسامة الجزري|أسامة الجزري]] @[[مستخدم:ميسرة|ميسرة]] @[[مستخدم:أبو آسر|أبو آسر]] @[[مستخدم:يوسف عاشق الجبل|يوسف عاشق الجبل]]. [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 12:03، 17 نوفمبر 2025 (ت ع م) ::@[[مستخدم:حبيشان|حبيشان]] أنا مؤيد لإزالة التشكيل من العناوين وإضافة المفردات المشكلة المرجوة لذات الصفحة لتسهيل الوصول إلى المفردة والمفردات ذات الصلة وهذا المعمول به في المواد غير العربية ومخالفة المواد العربية يعسر البحث. مثلا عندنا [[أَكْل]] و[[أَكَلَ]] لكن في المفردات غير العربية عندنا مادة واحدة لاسم ولفعل ولصفة مثل [[present]]، فأقترح إزالة التشكيل في العناوين وكتابة المفردات المرجوة في الصفحة ومنها اشتقاقات الجذر ولتزل صفحات التوضيح. [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 22:24، 17 نوفمبر 2025 (ت ع م) ::هذا النقاش يثار كلما جاء وفد من ويكيبيديا وقارن ويكاموس العربي بالنسخ اللغوية الأخرى. ويكاموس العربي يعتمد على صفحات التوضيح منذ زمن بعيد، وهي كفيلة بربط هذه النسخة مع باقي النسخ الأخرى، مثلا صفحة [[قتل]] مربوطة ب25 نسخة، وصفحة [[كتب]] ب24 نسخة، وكذا صفحة [[نظر]] مرتبطة ب19 نسخة. فإذا كنت تدعم العناوين بدون تشكيل فهو أمر معمول به أصلا (صفحات التوضيح) وإذا كنت تريد أن نزيل الوصلات ونجمع المحتويات كلها في صفحة واحدة فهذا لن يزيد من الربط، بل سيبقى الربط كما هو. أصلا لا توجد مشكلة في الربط، بل المشكلة في النقص العددي لصفحات ويكاموس، حتى أن صفحة [[ربط]] غير موجودة لحظة كتابتي لهذا التعليق. أقول أنه ليس على ويكاموس العربي أن يتبع ويكاموس الإنجليزي أو الفرنسي، إذا فكرنا من وجهة نظر موضوعية، فإن الأصل هو وجود صفحة واحدة لكل كلمة، [[قَتَلَ]] ليست هي نفسها [[قَتَّلَ]] أو [[قَتْل]]، لذا وجود صفحات مستقلة هو أمر طبيعي وجيد ويُتيح إمكانية التفصيل في شرح مختلف المعاني. ثم مع هذا توجد صفحة التوضيح [[قتل]] (بدون تشكيل) التي تكون مرتبطة مع مختلف النسخ اللغوية. '''هذا ليس عيب، بل ميزة معمول بها منذ زمن طويل'''. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 23:11، 17 نوفمبر 2025 (ت ع م) :::@[[مستخدم:Najem Ajem|Najem Ajem]] لا أرى ميزة إضافية لفصل المفردات حسب شكلها إلا زيادة عدد الصفحات، بينما نخسر مميزات إضافية ذكرتها أدنا. [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 21:21، 22 نوفمبر 2025 (ت ع م) ::أتفق مع الزميل @[[مستخدم:Najem Ajem|الناجم العاجم]] في الحفاظ على أسماء الصفحات بالتشكيل، مع وجود صفحات التوضيح. أُضيف إلى ما قيل: في المستقبل نُريد ربط صفحات ويكاموس مع الوحدات المُعجمية في ويكي بيانات، وهذا سيكون أسهل إذا كانت الصفحات مُستقلة. [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 09:23، 20 نوفمبر 2025 (ت ع م) :::@[[مستخدم:ForzaGreen|ForzaGreen]] الصفحة في ويكاموس تقبل جميع اللغات التي تستعمل نفس رسم الكلمة، بينما المعجمية في ويكي بيانات مقيدة بلغة معينة، فالربط لا يمكن أن يتم آليا، فما دام يدويًا فلا ميزة إضافية لفصل الكلمات حسب شكلها في صفحات مستقلة. [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 21:18، 22 نوفمبر 2025 (ت ع م) :: {{ضد}} التشكيل ضرورة حتمية في المعاجم، ووجود نفس الرسم في معاجم أخرى يُعدّ جهدًا ضائعًا (إذ تصبح صفحة الكلمة مكررة بعدّة لغات، ولا أعلم ما الفائدة!). الأصل أن تُربط المفردة بما يقابلها بالترجمة، لا بالرسم. الأمر نفسه ينطبق على الكلمات غير العربية (أو على الأقل غير المنطوقة بلهجات عربية) في ويكاموس العربي؛ فوجودها مكررة في عدّة معاجم بلغات أخرى لا فائدة منه. منذ مدة وأنا أفكر في طريقة لربط الكلمات بين المعاجم اللغوية، ووجدت — حتى الآن — أن قسم الترجمة يمكنه القيام بذلك، لكنه بدوره يحتاج إلى ربط آلي. تحياتي --[[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> ::: {{ر|Nehaoua}} لن نفقد التشكيل عندما نجمع المفردات المتفقة في الرسم في صفحة واحدة، فستكون المفردات في عناوين فرعية وهي المسماة في ويكاموس الإنجليزي headwords، وكل نسخ ويكاموس متعددة لغات المفردات، فالمفردات العربية موجودة (أو لها أن تكون موجودة) في كافة النسخ اللغوية الأخرى، وللأسف المفردات العربية في ويكاموس الإنجليزي أكثر من العربي.--[[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 21:26، 22 نوفمبر 2025 (ت ع م) :::مرحبًا @[[مستخدم:حبيشان|حبيشان]] رسمُ الكلمةِ العربية لا يكون مكتملًا إلا بالتشكيل، وكلُّ صيغةٍ مشكلة تُعدّ مفردة مستقلة، حتى ولو اشتركت في الرسم، لأن اختلاف التشكيل يؤدي إلى اختلافٍ في المعنى والمغزى. ولا يمكن القياس على الإنجليزية، فهي تعتمد على [[w:صائت|الصوائت]] التي تُميّز بين الكلمات (والمقابل لها في اللغة العربية الحركات الثلاثة -الفتح والكسر والضم-)، مثل: :::*[https://en.wiktionary.org/wiki/pin pin] (دبوس) :::*[https://en.wiktionary.org/wiki/pun pun] (تورية) :::*[https://en.wiktionary.org/wiki/pan pan] (مِقلاة) :::ولا تُعدّها الإنجليزية مفردة واحدة. :::أمّا ما ذُكر من أن {{مض|المفردات العربية في ويكاموس الإنجليزي أكثر من العربي}}} فهذا – في الواقع – مثال واضح على الجهد الضائع، إذ تُكرَّر الصفحات في معاجم أخرى بدل تطوير النسخة العربية ذاتها. تحياتي [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 18:55، 23 نوفمبر 2025 (ت ع م) ::::@[[مستخدم:Nehaoua|Nehaoua]] لابد من تشكيل المفردة عند ذكرها والشرح، وليس هذا محل خلاف، ولا خلاف أن الاختلاف في التشكيل غالبا يعني مفردة مختلفة، لكن النقاش عن جمع المفردات في صفحة واحدة وفقا لرسمها المجرد من التشكيل، فويكاموس العربي لم يتبع نهج المعاجم العربية في جمع المفردات تحت جذر واحد وكذلك لم يتبع نهج أغلب نسخ ويكاموس في جمع المفردات التي تتففق في الحروف في مدخل واحد، وهذا الطريقة المتفردة تفقد ويكاموس العربي بعض المميزات التقنية، بعض الميزات الأخرى التي ذكرتها. [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 07:36، 24 نوفمبر 2025 (ت ع م) :::::@[[مستخدم:Nehaoua|Nehaoua]] عفوًا pin وpun وpan من جدوز مختلفة لا علاقة لها ببعض. كل واحدة free base morpheme لا صلة لها بالأخرى. أما عن الحركات العربية فهي تعود لجذر واحد فلا تصح المقارنة. [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 08:29، 24 نوفمبر 2025 (ت ع م) :::@[[مستخدم:Nehaoua|Nehaoua]] أيضا لا يمكن حصر التشكيل مقابلًا للصوائت لأن منها short vowel sounds ومنها long vowel sounds التي هي أقرب إلى حروف العلة. [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 19:26، 24 نوفمبر 2025 (ت ع م) ::::::مرحبًا @[[مستخدم:كريم رائد|كريم رائد]] لا يوجد مفهوم الجذر في الإنجليزية، وأنا متفق أنه {{مض|لا تصح المقارنة}} لأن الطلب اصلا مبني على المقارنة! تحياتي [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 18:39، 24 نوفمبر 2025 (ت ع م) :::::::@[[مستخدم:Nehaoua|Nehaoua]] بل يوجد؛ طالع إن شئت Root (linguistics) ومقارنتك تشكيل العناوين بتلك المفردات في غير محلها لأن كل من هذه المفردات له معنى مختلف وجذره مختلف. [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 19:09، 24 نوفمبر 2025 (ت ع م) ::::::::@[[مستخدم:كريم رائد|كريم رائد]] تمتاز اللغات السامية بأنها جذرية واشتقاقية؛ إذ يمكن اشتقاق مئات الكلمات من الجذر الواحد بتغييرات بسيطة ومنها التشكيل، في حين أن الـ '''Root '''في اللغات الأخرى يتغيّر عادةً بإضافة السوابق واللواحق (أمور معروفة لا تحتاج لإطالة). ::::::::{{مض|ومقارنتك تشكيل العناوين بتلك المفردات في غير محلّها}}، لأن المقصود هو أن التشكيل في العربية يوافق الصوائت؛ فالفتحة تقابلها "A"، والضمة "O"، والكسرة "I"، وهذا تحديدًا ما أردتُ مقارنته (وأعتذر عن إعادة ما سبق أن قلتُه). ::::::::وأكتفي هنا حتى لا يتحول النقاش إلى جدال. وفي النهاية، ما الفائدة من جمع تعريفات جميع معاني الرسم «عبر» في صفحة واحدة، من جمع [[عِبْرَة|لعِبرة]] إلى الفعل [[عَبَرَ|عَبَرَ]] وغيرها؟ ::::::::أكتفي بهذا القدر وقد بيّنتُ وجهة نظري. تحياتي. [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 19:24، 24 نوفمبر 2025 (ت ع م) :::::مرحبًا @[[مستخدم:حبيشان|حبيشان]]، :::::* {{مض|ولا خلاف أن الاختلاف في التشكيل غالبًا يعني مفردة مختلفة}} فكلُّ اختلافٍ في التشكيل يُنتج مفردةً مختلفة، وبالتالي مدخلة مختلفة. :::::* {{مض|النقاش عن جمع المفردات في صفحة واحدة وفقًا لرسمها المجرَّد من التشكيل}} وصفحات التوضيح تكفي في هذا الباب. :::::* {{مض|فويكاموس العربي لم يتبع نهج المعاجم العربية في جمع المفردات تحت جذر واحد وكذلك لم يتبع نهج أغلب نسخ ويكاموس في جمع المفردات التي تتفق في الحروف في مدخل واحد}} لا تتبع جميع المعاجم هذا النهج، فالمعجم الوسيط مثلًا لم يجمع كل المفردات ذات الرسم الواحد؛ انظر مثلًا مدخل: [https://shamela.ws/book/7028/640#p1 «عين»]، حيث تكرّرت عدة مرات، وبينها تعريفات لكلمات مختلفة الرسم. وكذلك نحن نعمل في مشروع لا يقتضي النسخ الحرفي للمطبوع. :::::* {{مض|وهذه الطريقة المتفردة تفقد ويكاموس العربي بعض المزايا التقنية}} إن اختلاف الرسم والمفردات في العربية أمرٌ أصيل، ووجود صعوبات تقنية حالية لا يبرّر تقليل شأن اللغة أو التخفيف من خصائصها؛ فقد كانت كتابة العربية يومًا ما مستحيلة تقنيًا، ولو اتبعنا المنطق نفسه لكتبناها اليوم بالأحرف اللاتينية. :::::تحياتي [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 19:09، 24 نوفمبر 2025 (ت ع م) === مميزات جمع المفردات في صفحة واحدة إذا اتفقت في رسهما الخالي من التشكيل === # أولا بالنظر إلى معاجمنا العربية الأصيلة فيهم تجمع المفردات لأكثر من ذلك فكل المفردات تحت جذر واحد تجمع في مدخل واحد في المعجم العربي بل بعض المعاجم تضم إليها التقاليب (جبذ، جذب، بجذ...)، فالجمع المقترح أقرب إلى العمل المعمول به في معاجمنا من الطريقة الحالية. # كثير من الكلمات العربية يكون فيها أكثر من وجه في الضبط لدينا مثلا كلمة «إِصبَع» فيها تسع لغات حيث يجوز في أولها وثالثها الحركات الثلاث، فعلى هذا سيكون للأصبع 9 صفحات وهي مفردة واحدة ولكن فيها عدة أوجه أو لغات، وكثير من مفردات اللغة يجوز في حرف من حروفها أكثر من حركة ( ومنها باب المثلث في اللغة)، لذا فجمعها في صفحة أيسر في الوقوف على الفائدة، وأبعد من إيهام التغاير. # أن القارئ ربما يريد أن يستفيد ما هو الضبط الصحيح لكلمة معينة، وجود أكثر من عنوان مشكولة يؤخره في البحث عن الكلمة. # أن القارئ لا يستطيع أن يصل بسهولة من صفحة مفردة إلى ما يقابلها في اللغات الأخرى فيحتاج أن ينتقل غلى صفحة توضيح أو أن يبحث عنها. # نفس الشيء بالنسبة للقارئ في النسخ الأخرى الذي يرغب أن يطلع على النسخة العربية. --[[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 21:15، 22 نوفمبر 2025 (ت ع م) :{{ر|حبيشان}} :# نحن في قاموس إلكتروني، حيث تتوفر الوصلات وصناديق البحث، لماذا سنتبع طريقة الكتب القديمة. :# عندما يكون للكلمة الواحدة أكثر من تهجئة واحدة، فحينئذ نضع صفحة تحتوي على المعنى، وصفحات أخرى تحوّل أو توصل إليها، مع ذكر هذه الملاحظة في صفحة المعنى. وهذا طبيعي جدا حتى أن النسخ الأخرى تقوم بالأمر نفسه، مثلا في ويكاموس الإنجليزي صفحة [[:en:colour|colour]] لا تحتوي على المعاني، ذكروا فقط أنها تهجئة مختلفة للكلمة [[:en:color|color]]. :# النقطة 2 تفيد أيضا في حال وجود تهجئات خاطئة وشائعة. :# من المفترض أن تحتوي الصفحات على قالب {{قا|أيضا}} في الأعلى، ويشير إلى صفحة التوضيح (التي تتضمن الكلمات التي لها الرسم نفسه) كما هو معمول به في النسخ الأخرى. :# القارئ من النسخ الأخرى سيجد صفحة التوضيح من خلال وصلات الأنترويكي. بالمناسبة العناوين بالتشكيل موجودة في نسخ أخرى غير العربية. :[[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 23:11، 22 نوفمبر 2025 (ت ع م) * في الوضع الحالي وبعد ترتيب المفردات في التصانيف، فلا بأس عندي ببقاء عناوين المشكلة، مع الآتي: ** تنقيح تعليمات [[ويكاموس:صيغة الكتابة/الحركات والتشكيل|تشكيل العناوين]] ووسمها سياسةً لكي تكون ملزمة. ** جعل إنشاء صفحات التوضيح (بدون شكل) آليا عبر بوت، وكذلك الوصلة إليها من صفحات المفردات المشكلة.--[[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 18:08، الأربعاء 2 شعبان 1447هـ (+3) 15:08، 21 يناير 2026 (ت ع م) :{{ر|حبيشان}} راجعتُ صفحة [[وق:تشكيل|تشكيل العناوين]]، وجعلت القواعد أكثر وضوحا، يرجى إلقاء نظرة عليها. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 14:09، 22 يناير 2026 (ت ع م) ::مرحبًا @[[مستخدم:Najem Ajem|Najem Ajem]] شكرًا لتوضيحك [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 11:49، 28 يناير 2026 (ت ع م) === نقاش حول [[ويكاموس:صيغة الكتابة/الحركات والتشكيل]] (مقترح سياسة) === * {{ر|Najem Ajem}} اعتذر عن تأخري بالرد بسبب انشغالي بالخارج، المقترح فيه بعض القصور، وايضا هناك [[خاص:فرق/1076134|تغيير محوري]] أضيف بعد الخلاصة لم يناقش بالمرة، لذا أرجو حذف الخلاصة والعودة إلى النقاش، وهذه الملاحظات على الصيغة الحالية: ** تغير كلمة (حركات) إلى (شكلات)، لأن الشدة ليست حركة وكذلك السكون عند البعض. ** توضح أحرف المد بـ (وهي الألف (ا) مطلقا، والواو (و) الساكنة المضموم ما قبلها، والياء (ي) الساكنة <s>المضموم</s> المكسور ما قبلها). ** اقترح تعديل النقطة الثانية إلى: ::: {{مض|يترك محل الإعراب (آخر الكلمة المفردة) في الكلمات المعربة بالحركات بدون حركة أو سكون -وتبقى الشدة إذا كان مشددًأ-؛ لأن حركته تتغير حسب موقع الكلمة في الجملة}} وعليه فإن «مُعَلِّمُونَ» تشكل النون وإن كانت آخر الكلمة لأن معلمون تعرب بالحروف. ::: بتعديل هذه النقطة نسنغني عن النقاط بعدها إلا إذا قصد بها التوضيح. ** في نقطة الأفعال يفهم منها أنه يجب شكل آخر المضارع ولكنه معرب والأولى أن يشمله ما يشمل الأسماء لذلك أقترحت هنا أن تكون النقطة عامة للأسماء والأفعال واستخدمت مصطلح (الكلمات). ** لو ينص على وجوب نقط الياء المتطرفة تمييزا لها عن الألف المطوية. ** ماذا عن همزة الوصل هل تشكل أم لا، لو تنص القاعدة على ذلك صراحة وهل تستعمل ألف مجردة عن الهمزة أم (ٱ) ألف عليها ص. ** لا أتفق مع تجريد العنوان المدخلة من الشكل عندما تحتمل الكلمة قراءة واحدة فقط، لأسباب: *** أن ذلك إذا غلب على ظن من أدخلها قد يكون مخطئًا فنضطر للنقل بعد ذلك. *** أن هذه القاعدة ربما تؤخر من يريد إضافة مفردة فيلتزم بالبحث هل يشاركها في الرسم مفردة أخرى أم لا. *** المشروع لا يميمز صفحات توضيح المفردات إلا بالتجريد من التشكيل فعندما يرى المستخدم عنوانا غير مشكل يظن أنها صفحة توضيح. --[[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 21:10، الثلاثاء 7 رمضان 1447هـ (+3) 18:10، 24 فبراير 2026 (ت ع م) :إشارة @[[مستخدم:Nehaoua|Nehaoua]] @[[مستخدم:أبو هشام|أبو هشام]] @[[مستخدم:كريم أحمد|كريم أحمد]] @[[مستخدم:القلموني|القلموني]]. [[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 21:18، الثلاثاء 7 رمضان 1447هـ (+3) 18:18، 24 فبراير 2026 (ت ع م) * {{ر|حبيشان}} فيما يلي تعليقاتي على ملاحظاتك: ** <s>أوافق على استخدام (شكلات)، مع الإبقاء على (حركات) كمرادف أو لتفادي التكرار.</s> تعديل: بعد البحث وجدت أن "شكلات" غير فصيحة، بينما المستخدم هو فعلا "حركات" أو "حركات التشكيل". ** {{مض|فإننا دائما نستثني حروف المد (و، ا، ي)}} هنا عبارة "حروف المد" تفيد التوضيح بنفسها، فهي تشير إلى استثناء الحروف الثلاثة عندما -فقط- تفيد المد، بدل عبارة "الحروف" أو "حروف العلة" التي تشير إلى استثناء مطلق. لكن أوافق على إضافة التعريف الذي كتبتَه كملاحظة في الأسفل. ** صحيح أن بعض الكلمات لا يعرب بالشكلات وإنما بالحروف، فجمع المذكر السالم مثلا يضم بالواو والنون بينما ينصب ويجر بالياء والنون، لكن هذا لا يتعارض مع النقطة الثانية. لمزيد من الاتضاح سأشرح السياسة المقترحة، وهي بالمناسبة توثيق أكثر من كونها "اقتراحا جديدا": '''الأصل البسيط''' هو أن توضع الشكلات فوق الحروف كلها باستثناء حروف المد، سنجد أن تطبيق هذا الأصل على الأفعال وتصريفاتها (كيفما كانت أزمنتها) وعلى الأسماء المبنية سيكون تطبيقا خاليا من أية إشكالية، لماذا؟ لأن الحرف الأخير من هذه الكلمات يقبل حركة واحدة غير متغيرة، إلا بعض الاستثناءات عندما تكون الكلمة وخصوصا الفعل في جملة، وهذا لا يعنينا فنحن نتحدث عن عناوين يعني كلمات مستقلة. من هنا فتطبيق قاعدة "الأصل" لن يجد أي إشكال ماعدا في الأسماء المعربة، لماذا؟ لأن حرفها الأخير قد يقبل أي شكلة حتا إذا كانت الكلمة مجرد عنوان، مثلا هَاتِفٌ هَاتِفُ هَاتِفًا هَاتِفَ هَاتِفٍ هَاتِفِ، هذا يجعلنا حائرين بخصوص تشكيل آخر حرف من الكلمة المعربة، من هنا عدلنا قاعدة "الأصل" لنستثني تشكيل آخر حرف من الكلمة المعربة (كيفما كانت). ما شرحته إلى حدود الآن هو ما يشكل النقط الخمسة المدونة في السياسة حاليا. وبهذا تكون السياسة سهلة تسمح لأي محرر بتطبيقها ولو لم يكن بارعا بالإعراب وتفاصيله، كل ما يلزمه هو التفريق بين الكلمة المبنية والكلمة المعربة فقط. وعليه فأنا لا أتفق مع تغيير النقطة الثانية (الأسماء المعربة) والثالثة (الأفعال) إذ لا حاجة -وليس من المفترض أصلا- لإضافة استثناءات أخرى تتعلق بالإعراب. فالمبدأ هو أن لا نضيف استثناء إلا لتفادي إشكال حاصل. ** أوافق على إضافة ملاحظة الياء المتطرفة. وبخصوص همزة الوصل فلتكن همزة قطع (مجردة من الهمزة) وتأخذ كسرة في حال تشكيلها. ** تعليقاتي أعلاه تخص الإجابة عن سؤال "فوق أية أحرف نضع الشكلات؟" أما السؤال الثاني الذي تجيب عنه السياسة هو "متى أصلا نضع شكلات في العنوان؟" والإجابة عن هذا السؤال تحتمل خيارين: 1. نضع شكلات في جميع العناوين بدون استثناء 2. نضع شكلات فقط للتمييز بين الكلمات التي لها الرسم نفسه. والسياسة حاليا تختار الجواب (2) لأنها تنطلق من الفكرة التالية: جعل ويكاموس العربي مرتبطا بمختلف النسخ الأخرى قدر الإمكان، وإذ أن أغلب النسخ خاصة الكبرى تضع مدخلات عربية دون شكلات، اتخذنا كأصل عدم وضع شكلات مطلقا، هكذا كان الأصل ثم صنعنا استثناء لغرض تجاوز إشكال واحد، والإشكال هو وجود كلمات متعددة لها الرسم نفسه (طَالِب، طَالَبَ) ثم جعلنا صفحات توضيح لنبقي على العنوان المجرد من الشكلات، هذه الطريقة أفضل بكثير من جمع الكلمات في صفحة واحدة، فذلك لا يناسب الغنى الذي تتمتع به اللغة العربية. بالنظر إلى السياسة هكذا نجد الأصل الأول الذي يعطي أولوية للعناوين المجردة من الشكلات، ثم عناوين بشكلات تكون فرعية لصفحات توضيح، هكذا يبقى القاموس مرتبطا بوصلات أنترويكي تلقائية. أما بالنسبة للمحررين فالفكرة أن يضعوا دائما عنوانا خاليا من الشكلات، لا داعي للتردد إلا إذا علموا يقينا بوجود كلمات أخرى بالرسم نفسه، أما وقوع خطإ فليس مشكلا، يكتشف محرر آخر في وقت آخر وجود كلمة أخرى فيقوم بالنقل ووضع صفحة توضيح. هذا نمو طبيعي للقاموس. من هنا، نرى مثلا أن إنشاء صفحات توضيح أمر مفيد مثله مثل إنشاء صفحة تعريف. هكذا الأمر وضحتُه لترى السياسة من وجهة نظر عامة تنطلق من أصل عناوين بدون شكلات لتعزيز وصلات إنترويكي ثم يكون الاستثناء للتمييز بين الكلمات التي لها الرسم نفسه ثم فوق هذا يكون استثناء الحرف الأخير من الكلمات المعربة. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 10:35، 26 فبراير 2026 (ت ع م) :شكرا للإشارة، بصراحة منذ أيام وأنا أريد أن أكتب تعليقا ولكن كلما راجعت المقترح واستعرضت أمثلة من المفردات أتردد وأحير ماذا أكتب، أنا أميل إلى تشكيل جميع المفردات (باستثناء حروف فالمد) عدا صفحات التوضيح التي يُفترض أنها تحتوي على مجموعة كلمات متشابهة بالرسم ومختلفة بالمعنى حسب الحركات أو الشكلات فيها فعناوينها تكون مجردة، وأما الكلمات التي لا مشابه لها مثل '''[[استعمار]]''' و'''[[استعمال]]''' و'''[[منجنيق]]''' فأرى الواجب تشكيلها لضمان عدم التكرار والخلط أو الخطأ مثل ('''[[اِستعمال]]''' و'''[[اِسْتِعْمَال]]''' مفردتان لكلمة واحدة) أو ('''[[اِسْتَعْمَلَ]]''' و'''[[استعمل]]''' مفردتان لكلمة واحدة)، وضعت تعديلات على المقترح في ([[ويكاموس:صيغة الكتابة/الحركات والتشكيل/مسودة]]) وأظن أن المقترح بحاجة لنقاش أوسع وأتمنى مشاركة الزملاء لاكتشاف الأخطاء المحتملة، تحياتي لكم. [[مستخدم:أبو هشام|أبو هشام]] <sup>[[نقاش المستخدم:أبو هشام|«نقاش»]]</sup> 20:19، 27 فبراير 2026 (ت ع م) :مرحبًا بالجميع، أنا مع {{مض|'''الأصل البسيط'''}} هو أن توضع الشكلات فوق الحروف كلها باستثناء حروف المد}} مادام يوجد هناك حل التحويل والتوضيح تحياتي [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 21:04، 27 فبراير 2026 (ت ع م) ::{{ر|أبو هشام}} اعتماد المقترح -بعد النقاش- كسياسة رسمية هو السبيل الضامن لتفادي التكرار والخلط، فالخطأ ليس ناجما عن مقترح دون الآخر وإنما عن غياب سياسة رسمية ملزِمة. في مسودتك ألاحظ تقريبا توافقا تاما بخصوص كيفية وضع الشكلات. النقطة التي فيها خلاف هي بخصوص الكلمات المنفردة برسمها أنضع شكلات في عناوينها أم نتركها بدون شكلات. إذا اعتمدنا الصورة الحالية التي شرحتُها سيكون ويكاموس العربي مرتبطا بوصلات أنترويكي تلقائية مع باقي القواميس، بحيث كل وصلة إلى ويكاموس تكون إما صفحة توضيح (بدون حركات) أو صفحة تعريف (بدون حركات)، نظرا لكون الويكاموسات الكبرى تعتمد عناوين عربية بدون حركات مع جمع المتشابهة في صفحة واحدة -أنا أقول أن جمع متشابهات الرسم في صفحة واحدة غير متناسب مع الغنى اللغوي الذي تتمتع به العربية كما أنه سيعيق الاسترسال في التعريفات فضلا عن تقزيمه لعدد الصفحات العربية بالقاموس-. أما اقتراحك واقتراح {{ر|حبيشان}} القاضي بوضع شكلات حتى في عناوين الكلمات المنفردة برسمها فسيجعل ويكاموس معزولا نسبيا عن باقي القواميس، سيتصفح القارئ كلمات عربية في ويكاموس الإنجليزي أو الفرنسي ولن يجد وصلة أنترويكي إلى ويكاموس العربي، نأخذ على سبيل المثال كلمة استعمال وهي منفردة برسمها، لو كانت بدون شكلات "[[خاص:فرق/792168|استعمال]]" ستكون لها 14 وصلة أنترويكي مع مختلف الويكاموسات، بينما لو كانت بشكلات "[[خاص:فرق/1076577|اِسْتِعْمَال]]" فلن تكون مرتبطة بأي وصلة أنترويكي. بالمناسبة [[خاص:فرق/1071100|اِستعمال]] ينبغي دمجها. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 18:52، 1 مارس 2026 (ت ع م) :::أنا أميل إلى تشكيل كلّ العناوين، لأنّ استثناءَ بعض الكلمات فيه تضاربٌ في السياسة ويؤدّي إلى ارتباك القرّاء، والمنفعةُ منه محدودة. في رأيي، مسألةُ الربط والوصلات تحتاج إلى تفكيرٍ أعمق لاقتراح حلٍّ تقني يناسب الويكاموسات التي تستعمل الحركات. [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 13:03، 10 مارس 2026 (ت ع م) {{خلاصة}} أجريتُ '''تعديلات طفيفة''' في نص السياسة مع الإبقاء على جوهرها كما كان، يرجى مطالعة النسخة المحيّنة، أرى أن نعتمدها '''سياسة رسمية'''. النقاش يبقى دائما مفتوحا في حال وجود ملاحظات مستقبلية. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 08:11، 6 مارس 2026 (ت ع م) == قوالب جديدة + إنشاء صفحات الأفعال == في إطار إثراء ويكاموس، أنشأنا في الفترة الأخيرة وحدات وقوالب جديدة، من أهمها [[قالب:تصريف]]، الذي صار واسع الاستعمال بفضل تدريبات ومسابقة [[ويكاموس:مشروع إحياء ويكاموس العربي 2025|مشروع إحياء ويكاموس العربي 2025]] (الشكر مرة أخرى للزملاء القائمين على المشروع). ثم عملنا على الربط بين ويكي بيانات وويكاموس. سبقني الزميل {{مس|Mr. Ibrahem}}، مشكورا، بإنشاء آلاف الجذور والأفعال والأسماء في ويكي بيانات. ثم أضفت جذورا وأفعالا أخرى، مع أوزانها الصرفية وخاصية اللزوم والتعدية. يُمَكِّن [[قالب:صندوق معلومات فعل]] من استيراد خاصيات الأفعال من ويكي بيانات، ثم إظهارها مع معلومات أخرى (المصدر، اسم الفاعل، اسم المفعول) في صندوق معلومات داخل صفحات ويكاموس. كذلك أنشأنا [[قالب:معجمية]] الذي يستورد معاني الكلمات، مع مراجعها وأمثلة استخدامها، من ويكي بيانات إلى ويكاموس. عددتُ في صفحة [[ويكاموس:ويكي بيانات]] امتيازات الاعتماد على ويكي بيانات، وطبيعة الربط بين المشروعين، وطرق المُساهمة. المراحل القادمة: * إنشاء صفحات الأفعال غير الموجودة في ويكاموس، بالصيغة التالية: ** <syntaxhighlight lang="wikitext" dir="rtl"> == {{اللغة|عربية}} == {{صندوق معلومات فعل|L12345}} <!-- جديد --> === المعاني === '''فَعَلَ''' {{نصر}}. {{معجمية|L12345|معاني}} <!-- جديد --> === النطق === * {{أصد-عر|فَعَلَ}} === التصريفات === {{تصريف|جذر=فعل|وزن=فعَل يفعُل}} === المراجع === {{مراجع}} </syntaxhighlight> ** مثال لصفحات تستورد المعاني في ويكي بيانات: [[أَدْرَجَ]]، [[أَبْحَرَ]]. ** مثال لصفحات تستعمل [[قالب:معجمية]]، لكن ليس لها معاني في ويكي بيانات (في تاريخ كتابة هذه السطور): [[اِسْتَبْحَرَ]]، [[تَأَبَّتَ]]. وهكذا سيكون حال أغلب الصفحات التي ستُنشأ. * في مرحلة ثانية، إضافة المعاني إلى ويكي بيانات، وهي عملية ستستغرق وقتا طويلا، إذ تتطلّب تفكيرا معمّقا في المنهجية، وتحضير أدوات للبحث في المعاجم، إضافة إلى مراجعة يدوية للمعاني قبل إدخالها. وقد بدأنا بالفعل التفكير في آلية العمل، بالتعاون مع زملاء آخرين. هل من ملاحظات أو اقتراحات أو اعتراضات أو أفكار ؟ [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 22:30، 17 يناير 2026 (ت ع م) :إشارة إلى الناشطين في المشروع @[[مستخدم:حبيشان|حبيشان]] @[[مستخدم:Najem Ajem|Najem Ajem]] @[[مستخدم:Nehaoua|Nehaoua]] @[[مستخدم:Avicenno|Avicenno]] @[[مستخدم:أبو هشام|أبو هشام]] @[[مستخدم:القلموني|القلموني]] @[[مستخدم:RASHEEDYE|RASHEEDYE]] @[[مستخدم:كريم أحمد|كريم أحمد]] [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 11:44، 20 يناير 2026 (ت ع م) :أشكرك @[[مستخدم:ForzaGreen|ForzaGreen]] على هذه المساهمات الرائعة، أرجو عدم حذف المحتوى الحالي وإحلال قوالب ويكي بيانات مكانه، التعديل المباشر في ويكاموس أسهل لأكثر مستخدمين من ويكي بيانات، والمشاركات في المشروع ضعيفة لذا نريد التشجيع للمساهمة من أي طريق سواء عبر ويكاموس مباشرة أو عبر ويكي بيانات كلا بما يحسنه. :هناك ملاحظات تقنية سيكون مكانها نقاش الوحدة. [[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 13:00، الأربعاء 2 شعبان 1447هـ (+3) 10:00، 21 يناير 2026 (ت ع م) ::شكرا @[[مستخدم:حبيشان|حبيشان]] على الملاحظة. طبعا لن يُحذف المحتوى الحالي. سيُستعمل [[قالب:معجمية]] فقط في الصفحات الجديدة. غيرت صفحة [[أَدْرَجَ]] فقط كمثال. في الصفحات الموجودة سيُضاف [[قالب:صندوق معلومات فعل]] وسيُعتمد [[قالب:تصريف]] بدل القالب القديم، أما المعاني فستبقى كما هي. [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 13:49، 21 يناير 2026 (ت ع م) :شكرا لك {{ر|ForzaGreen|س=وائل}} ولباقي الزملاء على الاهتمام بربط ويكاموس مع ويكي بيانات. هذا عمل رائع، وأنا متوافق مع خطة عملكم. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 14:12، 22 يناير 2026 (ت ع م) ::شكرا للإشارة، {{أتفق}} فالفكرة رائعة وستثري المشروع، ولدي سؤال هل يمكن الربط بين المشروعين من ويكي بيانات؟ شكرا. [[مستخدم:أبو هشام|أبو هشام]] <sup>[[نقاش المستخدم:أبو هشام|«نقاش»]]</sup> 09:16، 2 فبراير 2026 (ت ع م) :::شكرا @[[مستخدم:أبو هشام|أبو هشام]] على أسئلتك في [https://ar.wiktionary.org/wiki/%D9%88%D9%8A%D9%83%D8%A7%D9%85%D9%88%D8%B3:%D8%B7%D9%84%D8%A8_%D8%B5%D9%84%D8%A7%D8%AD%D9%8A%D8%A9_%D8%A8%D9%88%D8%AA#c-%D8%A3%D8%A8%D9%88_%D9%87%D8%B4%D8%A7%D9%85-20260202102100-ForzaGreen-20260201235800 صفحة طلب صلاحية البوت]. :::- عن سؤالك: ''هل يمكن الربط بين المشروعين من ويكي بيانات وليس من ويكاموس؟'' -> لا يمكن. ميزة ويكي بيانات أنها قاعدة بيانات، نستغلها لتخزين بيانات مُهيكَلة ومُرتبة. وبالتالي يسهل استيراد هذه البيانات برمجيا في ويكاموس. :::- عن اقتراحك ''فصل التعريف بالمفردة عن المعاني وإضافة مصدر للتعريف إن أمكن''. -> لم أفهم. على كل حال، استعمال قالب {{قا|معجمية}} يبقى مسألة اختيارية لمن أراد أن يسحب المعلومات من معجميات ويكي بيانات. :::- ''هل ستُزال جملة (هذه الكلمة لا تحتوي على معانٍ....إلخ) تلقائيا عند تطوير المفردة وإضافة المعاني في ويكاموس؟'' -> نعم، الجملة تُزال تلقائيا عند إضافة المعاني في ويكي بيانات، وليس في ويكاموس. وهذه أهم ميزات القالب. خذ مثلا مثال صفحة [[حَارَبَ]] (ليس لها معاني في حين كتابة هذه السطور). أضف لها معاني في ويكي بيانات، فستظهر لك في ويكاموس. انظر فقرة [[ويكاموس:ويكي بيانات#استيراد المعاني|ويكاموس:ويكي بيانات#استيراد المعاني]] لكيفية إضافة المعاني في ويكي بيانات. :::- ''* من أين جاءت هذه الجملة (جريمة قتل على ويكيبيديا) في هذه المفردة ([[أَدْرَجَ]])؟'' -> جاءت من ويكي بيانات، من خاصية ([[wikidata:P:P9970|مُسند إلى]]). تُستعمل الخاصية لربط المعنى مع عنصر (وليس وحدة معجمية) في ويكي بيانات. إن كان للعنصر مقالة في ويكيبيديا، فستظهر في ويكاموس. شرحت هذا كذلك في صفحة [[ويكاموس:ويكي بيانات]]. [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 21:57، 2 فبراير 2026 (ت ع م) هذا مثال لما أقصده، قد تحتاج إلى إنشاء قالب للتعريف بالمفردة وإزالة التعريف من قالب معجمية أو إنشاء قالب للمعاني وظيفته استيراد المعاني: * <syntaxhighlight lang="wikitext" dir="rtl"> == {{اللغة|عربية}} == {{صندوق معلومات فعل}} === التعريف === هنا يكون التعريف بالمفردة باستخدام قالب للتعريف فقط.(مرجع) === المعاني === هنا تذكر المعاني باستخدام قالب وظيفته استيراد المعاني فقط أو يضيفها المحررون. === النطق === * {{أصد-عر|فَعَلَ}} === التصريفات === {{تصريف|جذر=فعل|وزن=فعَل يفعُل}} === المراجع === {{مراجع}} </syntaxhighlight> :هذا مجرد اقتراح، ويمكن الاستغناء عن قسم التعريف (=== التعريف ===) وذكره بعد صندوق المعلومات مباشرة. * <syntaxhighlight lang="wikitext" dir="rtl"> == {{اللغة|عربية}} == {{صندوق معلومات فعل}} هنا يكون التعريف بالمفردة باستخدام قالب للتعريف فقط.(مرجع) === المعاني === هنا تذكر المعاني باستخدام قالب وظيفته استيراد المعاني فقط أو يضيفها المحررون. === النطق === * {{أصد-عر|فَعَلَ}} === التصريفات === {{تصريف|جذر=فعل|وزن=فعَل يفعُل}} === المراجع === {{مراجع}} </syntaxhighlight> :اقتراحي الآخر هو إنشاء صفحات للمفردات التي لها معان في ويكي بيانات فقط لأن الصفحات التي تقتصر على القوالب فقط ستكون فارغة أو شبه فارغة، شكرا لجهودكم. [[مستخدم:أبو هشام|أبو هشام]] <sup>[[نقاش المستخدم:أبو هشام|«نقاش»]]</sup> 13:00، 3 فبراير 2026 (ت ع م) ::{{ر|ForzaGreen}} أرى أن التنسيق الذي اقترحتَه جيد، إذ يضاف صندوق المعلومات وقالب {{قا|معجمية}} بدون الحاجة لإضافة أي قسم جديد. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 12:48، 5 فبراير 2026 (ت ع م) ::{{ر|أبو هشام}} صفحات الأفعال المضافة ستتضمن معلومات منظمة عن النطق والصرف والنحو، <s>أما قسم المعاني الذي سيكون شبه فارغ فهو سيدفع المحررين إلى شيء من الحماس ويجعلهم يفكرون بإضافة المعاني سواء في المحرر أو في ويكي بيانات، إذ لا بأس بهذا.</s> والعديد من الويكاموسات الأجنبية فيها صفحات "شبه فارغة" كثيرة. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 12:48، 5 فبراير 2026 (ت ع م) :::فعلا الصفحات المُقترحة تتضمن عدة معلومات (الجذر، الأوزان الصرفية، التعدية، المصادر، اسما الفاعل والمفعول، التصريف، النطق..)، لكن أتَفَهَّم كذلك رأي الزملاء بأن المعاني هي الركن الأساسي في المعجم. حاليا لن أُنشئ صفحات الأفعال الأساسية. قد أُعدِّل صفحات الأفعال الموجودة لإضافة {{قا|صندوق معلومات فعل}} و{{قا|تصريف}}. كذلك قد أُنشئ الصفحات الثانوية، من قبيل [[أَكْتُبُ]]، [[نَكْتُبُ]]، [[اُكْتُبْ]]... [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 08:56، 6 فبراير 2026 (ت ع م) == أداة مراجعة معاني الأفعال == في إطار العمل على إحياء ويكاموس والربط مع ويكي بيانات (تتمة لنقاش [[ويكاموس:الميدان#قوالب جديدة + إنشاء صفحات الأفعال]])، أنشأنا أداة لمراجعة معاني الأفعال العربية ونشرها: {{وسط|https://ar-senses.toolforge.org}} يمكن الاطلاع على توثيق الأداة على [[ويكاموس:ويكي بيانات#أداة مراجعة المعاني (تجريبي)]]. تحتوى الأداة على معاني مستخلصة آليا بالبحث في 16 معجما عربيا (لسان العرب، تاج العروس، المعجم الوسيط، القاموس المحيط، وغيرها) وبالاعتماد على نموذج لغوي ضخم لتجميع المعاني وترتيبها. الهدف من الأداة هو تمكين المحررين من مراجعة المعلومات ثم نشرها في ويكي بيانات وويكاموس. بدأنا بعدد محدود من الأفعال. أرجو من الزملاء تجربتها وإبداء ملاحظاتهم، سواء على المعاني المُستخلصة أو على واجهة الأداة أو تجربة المستخدم، [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 00:58، 23 مارس 2026 (ت ع م) :إشارة إلى الزملاء النشطين في المشروع @[[مستخدم:حبيشان|حبيشان]] @[[مستخدم:Avicenno|Avicenno]] @[[مستخدم:Najem Ajem|Najem Ajem]] @[[مستخدم:أبو هشام|أبو هشام]] @[[مستخدم:Nehaoua|Nehaoua]] @[[مستخدم:كريم أحمد|كريم أحمد]] @[[مستخدم:RASHEEDYE|RASHEEDYE]] @[[مستخدم:أويس2003|أويس2003]] @[[مستخدم:ماهر الماهر|ماهر الماهر]]. شكرا. [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 19:25، 27 مارس 2026 (ت ع م) ::مرحبًا @[[مستخدم:ForzaGreen|ForzaGreen]] أداة رائعة، جربت عدة أمور، فقط لدي بعض الملاحظات: ::* عدم ذكر معجم الغني مصدرًا ::* عدم إمكانية انشاء وصلات داخلية في المعاني ::* عدم إمكانية إعادة إنشاء صفحة ويكاموس (الموجودة قد لا تُلبي نفس المقاييس، أو ناقصة) كما لا يمكن استخراج النموذج لديل صفحة موجودة ::تحياتي [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 21:17، 27 مارس 2026 (ت ع م) :::شكرا @[[مستخدم:Nehaoua|Nehaoua]] على التجريب وعلى الملاحظات القَيّمة. :::* مع الأسف ليس عندي معجم الغني بصيغة رقمية. :::* ملاحظة مهمة في موضوع الوصلات الداخلية. سأبحث عن حل تقني في ويكي بيانات وفي قالب {{قا|معجمية}}. :::* بالنسبة لإعادة إنشاء صفحات ويكاموس، كان أحد الاقتراحات في [https://ar.wiktionary.org/wiki/%D9%88%D9%8A%D9%83%D8%A7%D9%85%D9%88%D8%B3:%D8%A7%D9%84%D9%85%D9%8A%D8%AF%D8%A7%D9%86#c-%D8%AD%D8%A8%D9%8A%D8%B4%D8%A7%D9%86-20260121100000-ForzaGreen-20260117223000 النقاش السابق] هو عدم حذف المحتوى الحالي في ويكاموس. لذلك كان التركيز في تطوير الأداة على إنشاء معاني جديدة فقط، في ويكي بيانات، ثم إنشاء صفحات ويكاموس إن لم تكن موجودة. :::[[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 09:30، 28 مارس 2026 (ت ع م) ::::مرحبًا @[[مستخدم:ForzaGreen|ForzaGreen]] شكرا لردك، بالنسبة لإعادة إنشاء صفحات ويكاموس، حبذا لو تُنشئ أو تفعل أداة نسخ محتوى انشاء صفحة ويكاموس وكأننا ستُنشئها من جديد، حتى يتسنى النقل اليدوي إلى الصفحة الموجودة والتعديل بما يوافق الحالة. تحياتي [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 11:25، 28 مارس 2026 (ت ع م) :::::@[[مستخدم:Nehaoua|Nehaoua]] {{تم}}. الآن في صفحات مراجعة الأفعال الموجودة سلفا في ويكاموس، والتي أُنشئت خارج الأداة، مثلا صفحة [https://ar-senses.toolforge.org/review/L1489133 أَدَّبَ L1489133]، يظهر سطر جديد: "''لمعاينة ما كانت الأداة ستنشئه لو لم تكن الصفحة موجودة في ويكاموس: (زر معاينة)''". :::::هل هذا ما قصدت ؟ [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 18:36، 28 مارس 2026 (ت ع م) ::::::مرحبًا @[[مستخدم:ForzaGreen|وائل]] بوركت، هذا ما تمنيت وقد حققته، شكرًا مرة أخرى [[مستخدم:Nehaoua|<span style="color:#000000; font-size:18px; font-family:traditional arabic;">'''نحاوة'''</span>]] <sup>([[نقاش المستخدم:Nehaoua|<span style="color:blue; font-size:small; font-family:traditional arabic;">'''راسلني'''</span>]])</sup> 19:01، 28 مارس 2026 (ت ع م) ::@[[مستخدم:ForzaGreen|ForzaGreen]] عمل جبار تشكر عليه، سأجربها، وافضل أن تستعمل رابط إلى موقع تراث بدلا من موقع الشاملة، لأنه يعرض نسخة الpdf بسهولة والنسخة النصية لم تنقل جميع الاصطلاحات من النسخة المطبوعة. [[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 02:11، السبت 9 شوال 1447هـ (+3) 23:11، 27 مارس 2026 (ت ع م) :::{{تم}}. الآن تظهر روابط موقع تراث بدل الشاملة. :::وفي موضوع ذو صلة، عدلتُ سابقا [[وحدة:Cite Q]] المستعملة في {{قا|استشهاد بويكي بيانات}} وعناصر المعاجم في ويكي بيانات، بحيث يؤدي رابط المرجع مباشرة إلى الجزء ورقم الصفحة في موقع archive.org (إن كانت طبعة المعجم متوفرة في الموقع). [[مستخدم:ForzaGreen|وائل]] ([[نقاش المستخدم:ForzaGreen|نقاش]]) 10:31، 28 مارس 2026 (ت ع م) == Action Required: Update templates/modules for electoral maps (Migrating from P1846 to P14226) == <div lang="en" dir="ltr" class="mw-content-ltr"> Hello everyone, This is a notice regarding an ongoing data migration on Wikidata that may affect your election-related templates and Lua modules (such as <code>Module:Itemgroup/list</code>). '''The Change:'''<br /> Currently, many templates pull electoral maps from Wikidata using the property [[:d:Property:P1846|P1846]], combined with the qualifier [[:d:Property:P180|P180]]: [[:d:Q19571328|Q19571328]]. We are migrating this data (across roughly 4,000 items) to a newly created, dedicated property: '''[[:d:Property:P14226|P14226]]'''. '''What You Need To Do:'''<br /> To ensure your templates and infoboxes do not break or lose their maps, please update your local code to fetch data from [[:d:Property:P14226|P14226]] instead of the old [[:d:Property:P1846|P1846]] + [[:d:Property:P180|P180]] structure. A [[m:Wikidata/Property Migration: P1846 to P14226/List|list of pages]] was generated using Wikimedia Global Search. '''Deadline:'''<br /> We are temporarily retaining the old data on [[:d:Property:P1846|P1846]] to allow for a smooth transition. However, to complete the data cleanup on Wikidata, the old [[:d:Property:P1846|P1846]] statements will be removed after '''May 1, 2026'''. Please update your modules and templates before this date to prevent any disruption to your wiki's election articles. Let us know if you have any questions or need assistance with the query logic. Thank you for your help! [[User:ZI Jony|ZI Jony]] using [[مستخدم:MediaWiki message delivery|MediaWiki message delivery]] ([[نقاش المستخدم:MediaWiki message delivery|نقاش]]) 17:12، 3 أبريل 2026 (ت ع م) </div><!-- الرسالة التي أرسلها User:ZI Jony@metawiki باستخدام القائمة في https://meta.wikimedia.org/w/index.php?title=Distribution_list/Non-Technical_Village_Pumps_distribution_list&oldid=29941252 --> == Request for comment (global AI policy) == <div lang="en" dir="ltr" class="mw-content-ltr"> Apologies for writing in English. {{int:Please-translate}}<br /> A [[:m:Requests for comment/Artificial intelligence policy|request for comment]] is currently being held to decide on a global AI policy. {{int:Feedback-thanks-title}} [[مستخدم:MediaWiki message delivery|MediaWiki message delivery]] ([[نقاش المستخدم:MediaWiki message delivery|نقاش]]) 00:58، 26 أبريل 2026 (ت ع م) </div><!-- الرسالة التي أرسلها User:Codename Noreste@metawiki باستخدام القائمة في https://meta.wikimedia.org/w/index.php?title=Distribution_list/Global_message_delivery&oldid=30424282 --> == تجربة إضافة الاستشهاد الآلي بويكي بيانات، مع طلب جعلها افتراضية == بفضل الله طورت إضافة الاستشهاد الآلي بالشاملة لتشمل المواقع والمعرفات التالية: * موقع أرشيف Archive - مع الجزء والصفحة * موقع تراث app.turath.io - مع الجزء والصفحة * معرف ردمك isbn * معرف دوي DOI * arXiv * bibcode * biorxiv * zbMATH * jstor * Academia * mandumah * eMarefa * mathscinet * oclc * openlibrary * osti * PMC * PubMed * rfc * ssrn * s2pid * Google Books - مع الجزء * ResearchGate * أي موقع آخر إذا وضع في خاصية {{P|953}} معرفات ردمك ودوي وعزو برنامج وموقع الشاملة وتراث يمكن وضعه بدون مباشرة، لكن بقية المعرفات الأخرى لا بد أن يكون هناك رابط من موقع المعرف. يشترط أن يكون المرجع موجودًا في ويكي بيانات أنه معرف بذلك المعرف. يمكن الإضافة على هذه المعرفات إذا كان لها استخدام واسع. لتجربة الإضافة اضغط على هذا الرابط: {{تفعيل إضافة|auto-cite-wikidata-loader|block=1}} مع التأكد من إلغاء تفعيل إضافة (الاستشهاد الآلي بالشاملة) ويكن ذلك عبر الرابط التالي: {{تفعيل إضافة|auto-cite-shamela-loader|block=1|تعطيل=1}} بعد تجربة الإضافة ستستبدل بإضافة الاستشهاد بالشاملة، وكذلك أطلب جعلها إضافة افتراضية لتسهيل الاستشهاد على المبتدئين. [[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 18:44، الثلاثاء 11 ذو القعدة 1447هـ (+3) 15:44، 28 أبريل 2026 (ت ع م) 4bcrc14fjsgdvkjcodpe76v6jdh90a1 abdominal 0 9965 1089721 997389 2026-04-29T06:02:45Z ~2026-25981-29 38678 1089721 wikitext text/x-wiki 1zqjcp'"(){}<x>:/1zqjcp;9 38e96ki4djhdpi03nl255vztp9n7g2d 1089722 1089721 2026-04-29T06:05:02Z NDG 37587 Reverted edits by [[Special:Contribs/~2026-25981-29|~2026-25981-29]] ([[User talk:~2026-25981-29|talk]]) to last version by Najem Ajem: reverting vandalism 997389 wikitext text/x-wiki == {{اللغة|إنجليزية}} == * بطني lhmtxxf6ikhm9tl4pqguzauggf8pcxr ميدياويكي:Gadgets-definition 8 145139 1089684 1089656 2026-04-28T14:57:19Z حبيشان 31560 تعريف الإضافة 1089684 wikitext text/x-wiki == مخفي == * Site [ResourceLoader |default |hidden |type=styles] |Site.css * VE-wditem-input[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|VE-wditem-input.js * auto-cite-shamela[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|auto-cite-shamela.js * auto-cite-wikidata[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|auto-cite-wikidata.js * countdown-timer[ResourceLoader|default|hidden|dependencies=mediawiki.language|categories=Gadget-Countdown]|countdown-timer.js * SettingsManager [ResourceLoader |dependencies=mediawiki.user, user.options, mediawiki.api, mediawiki.util |hidden] |SettingsManager.js == تحرير == * AjaxEdit[ResourceLoader|dependencies=mediawiki.util,mediawiki.Uri,mediawiki.user,mediawiki.api]|AjaxEdit.js * autocomplete[ResourceLoader|dependencies=mediawiki.util]|autocomplete.js * BiDiEditing[ResourceLoader]|BiDiEditing.js * Cat-a-lot[ResourceLoader|rights=patrol|dependencies=mediawiki.util]|Cat-a-lot.js|Cat-a-lot.css * HotCat[ResourceLoader]|HotCat.js * newsectionbottom[ResourceLoader|skins=vector]|newsectionbottom.js * searchlang[ResourceLoader|rights=minoredit|skins=vector|dependencies=mediawiki.util]|searchlang.js * speed-deletion[ResourceLoader|dependencies=mediawiki.util|rights=rollback]|speed-deletion.js * wikEd[ResourceLoader]|wikEd.js * VE-wditem-input-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|VE-wditem-input-loader.js * auto-cite-shamela-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|auto-cite-shamela-loader.js == تصفح == * GreenRedirect[ResourceLoader|default|rights=minoredit]|GreenRedirect.css * HideExLinkIcon[default|rights=minoredit]|HideExLinkIcon.css * JSL[ResourceLoader]|JSL.js * Linkscount[ResourceLoader]|Linkscount.js * MobileCategories[ResourceLoader|dependencies=mediawiki.api,mediawiki.util|skins=minerva]|MobileCategories.js * ShortLink[ResourceLoader]|ShortLink.js * userinfo-without-deletedcontribs[ResourceLoader|dependencies=mediawiki.util]|userinfo-without-deletedcontribs.js * UTCLiveClock[ResourceLoader|dependencies=mediawiki.util]|UTCLiveClock.js * mobile-sidebar[ResourceLoader|skins=vector, vector-2022]|mobile-sidebar.js|mobile-sidebar.css * PagePreviews[ResourceLoader|default|dependencies=mediawiki.api,mediawiki.util,mediawiki.Title|skins=vector,vector-2022,monobook,timeless,modern,cologneblue]|PagePreviews.js * XTools-ArticleInfo [ResourceLoader |skins=vector, vector-2022, monobook, timeless] |XTools-ArticleInfo.js * Numeral_converter [ResourceLoader |dependencies=mediawiki.cookie, mediawiki.util, mediawiki.user] |Numeral_converter.js * Numeral-converter-toggle [ResourceLoader] |Numeral-converter-toggle.js |Numeral-converter-toggle.css == تحت-الاختبار== * auto-cite-wikidata-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|auto-cite-wikidata-loader.js nfh9oa51k5qu7tdpltguntds4ia8q2f 1089700 1089684 2026-04-28T16:00:07Z حبيشان 31560 تعرف إضافة تحميل جافاسكربت من سطر العنوان 1089700 wikitext text/x-wiki == مخفي == * Site [ResourceLoader |default |hidden |type=styles] |Site.css * VE-wditem-input[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|VE-wditem-input.js * auto-cite-shamela[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|auto-cite-shamela.js * auto-cite-wikidata[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|auto-cite-wikidata.js * countdown-timer[ResourceLoader|default|hidden|dependencies=mediawiki.language|categories=Gadget-Countdown]|countdown-timer.js * SettingsManager [ResourceLoader |dependencies=mediawiki.user, user.options, mediawiki.api, mediawiki.util |hidden] |SettingsManager.js * LoadJS [ResourceLoader |default |hidden |dependencies=mediawiki.util] |LoadJS.js == تحرير == * AjaxEdit[ResourceLoader|dependencies=mediawiki.util,mediawiki.Uri,mediawiki.user,mediawiki.api]|AjaxEdit.js * autocomplete[ResourceLoader|dependencies=mediawiki.util]|autocomplete.js * BiDiEditing[ResourceLoader]|BiDiEditing.js * Cat-a-lot[ResourceLoader|rights=patrol|dependencies=mediawiki.util]|Cat-a-lot.js|Cat-a-lot.css * HotCat[ResourceLoader]|HotCat.js * newsectionbottom[ResourceLoader|skins=vector]|newsectionbottom.js * searchlang[ResourceLoader|rights=minoredit|skins=vector|dependencies=mediawiki.util]|searchlang.js * speed-deletion[ResourceLoader|dependencies=mediawiki.util|rights=rollback]|speed-deletion.js * wikEd[ResourceLoader]|wikEd.js * VE-wditem-input-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|VE-wditem-input-loader.js * auto-cite-shamela-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|auto-cite-shamela-loader.js == تصفح == * GreenRedirect[ResourceLoader|default|rights=minoredit]|GreenRedirect.css * HideExLinkIcon[default|rights=minoredit]|HideExLinkIcon.css * JSL[ResourceLoader]|JSL.js * Linkscount[ResourceLoader]|Linkscount.js * MobileCategories[ResourceLoader|dependencies=mediawiki.api,mediawiki.util|skins=minerva]|MobileCategories.js * ShortLink[ResourceLoader]|ShortLink.js * userinfo-without-deletedcontribs[ResourceLoader|dependencies=mediawiki.util]|userinfo-without-deletedcontribs.js * UTCLiveClock[ResourceLoader|dependencies=mediawiki.util]|UTCLiveClock.js * mobile-sidebar[ResourceLoader|skins=vector, vector-2022]|mobile-sidebar.js|mobile-sidebar.css * PagePreviews[ResourceLoader|default|dependencies=mediawiki.api,mediawiki.util,mediawiki.Title|skins=vector,vector-2022,monobook,timeless,modern,cologneblue]|PagePreviews.js * XTools-ArticleInfo [ResourceLoader |skins=vector, vector-2022, monobook, timeless] |XTools-ArticleInfo.js * Numeral_converter [ResourceLoader |dependencies=mediawiki.cookie, mediawiki.util, mediawiki.user] |Numeral_converter.js * Numeral-converter-toggle [ResourceLoader] |Numeral-converter-toggle.js |Numeral-converter-toggle.css == تحت-الاختبار== * auto-cite-wikidata-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|auto-cite-wikidata-loader.js 6xtfyr83s5y05km30ib38xsn6lavm5b 1089704 1089700 2026-04-28T16:31:47Z حبيشان 31560 إضافة تحتاجها بعض الإضافات 1089704 wikitext text/x-wiki == مخفي == * Site [ResourceLoader |default |hidden |type=styles] |Site.css * VE-wditem-input[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|VE-wditem-input.js * auto-cite-shamela[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|auto-cite-shamela.js * auto-cite-wikidata[ResourceLoader|hidden|dependencies=ext.visualEditor.core]|auto-cite-wikidata.js * countdown-timer[ResourceLoader|default|hidden|dependencies=mediawiki.language|categories=Gadget-Countdown]|countdown-timer.js * SettingsManager [ResourceLoader |dependencies=mediawiki.user, user.options, mediawiki.api, mediawiki.util |hidden] |SettingsManager.js * libJQuery [ResourceLoader |hidden] |libJQuery.js |libJQuery.css * LoadJS [ResourceLoader |default |hidden |dependencies=mediawiki.util] |LoadJS.js == تحرير == * AjaxEdit[ResourceLoader|dependencies=mediawiki.util,mediawiki.Uri,mediawiki.user,mediawiki.api]|AjaxEdit.js * autocomplete[ResourceLoader|dependencies=mediawiki.util]|autocomplete.js * BiDiEditing[ResourceLoader]|BiDiEditing.js * Cat-a-lot[ResourceLoader|rights=patrol|dependencies=mediawiki.util]|Cat-a-lot.js|Cat-a-lot.css * HotCat[ResourceLoader]|HotCat.js * newsectionbottom[ResourceLoader|skins=vector]|newsectionbottom.js * searchlang[ResourceLoader|rights=minoredit|skins=vector|dependencies=mediawiki.util]|searchlang.js * speed-deletion[ResourceLoader|dependencies=mediawiki.util|rights=rollback]|speed-deletion.js * wikEd[ResourceLoader]|wikEd.js * VE-wditem-input-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|VE-wditem-input-loader.js * auto-cite-shamela-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|auto-cite-shamela-loader.js == تصفح == * GreenRedirect[ResourceLoader|default|rights=minoredit]|GreenRedirect.css * HideExLinkIcon[default|rights=minoredit]|HideExLinkIcon.css * JSL[ResourceLoader]|JSL.js * Linkscount[ResourceLoader]|Linkscount.js * MobileCategories[ResourceLoader|dependencies=mediawiki.api,mediawiki.util|skins=minerva]|MobileCategories.js * ShortLink[ResourceLoader]|ShortLink.js * userinfo-without-deletedcontribs[ResourceLoader|dependencies=mediawiki.util]|userinfo-without-deletedcontribs.js * UTCLiveClock[ResourceLoader|dependencies=mediawiki.util]|UTCLiveClock.js * mobile-sidebar[ResourceLoader|skins=vector, vector-2022]|mobile-sidebar.js|mobile-sidebar.css * PagePreviews[ResourceLoader|default|dependencies=mediawiki.api,mediawiki.util,mediawiki.Title|skins=vector,vector-2022,monobook,timeless,modern,cologneblue]|PagePreviews.js * XTools-ArticleInfo [ResourceLoader |skins=vector, vector-2022, monobook, timeless] |XTools-ArticleInfo.js * Numeral_converter [ResourceLoader |dependencies=mediawiki.cookie, mediawiki.util, mediawiki.user] |Numeral_converter.js * Numeral-converter-toggle [ResourceLoader] |Numeral-converter-toggle.js |Numeral-converter-toggle.css == تحت-الاختبار== * auto-cite-wikidata-loader[ResourceLoader|dependencies=ext.visualEditor.targetLoader]|auto-cite-wikidata-loader.js 7d434lheviehcx55lg3e6k3m3y914qf نقاش المستخدم:Najem Ajem 3 187890 1089714 1089341 2026-04-28T18:30:03Z MediaWiki message delivery 11353 /* You may be an eligible candidate for the U4C election */ قسم جديد 1089714 wikitext text/x-wiki [[ملف:Basmala.svg|بسم الله الرحمن الرحيم|يمين]] <br><small> {{يسار|[[نقاش المستخدم:Najem Ajem/2023-2024|'''أرشيف 23-24 ''']]}} {{يسار|[[نقاش المستخدم:Najem Ajem/2021-2022|'''أرشيف 21-22 ''']]}} {{يسار|[[نقاش المستخدم:Najem Ajem/2019-2020|'''أرشيف 19-20 ''']]}} {{يسار|[[نقاش المستخدم:Najem Ajem/2017-2018|'''أرشيف 17-18 ''']]}} </small><br> == طلب حذف صفحة == مرحبا أخي؛ أحتاج منك للقيام بحذف الصفحة [[مستخدم:عبد الإله صديقي/vector.js]] لأنها تظهر ك[[خاص:تحويلات مزدوجة|تحويلة مزدوجة]]؛ لا يمكن للبوت الخاص بي تعديل الصفحة لأنها محمية من تعديلات البوت لأنها صفحة سكريبت مستخدم؛ شكرا لك مقدما. [[مستخدم:Meno25|Meno25]] ([[نقاش المستخدم:Meno25|نقاش]]) 20:39، 27 يناير 2025 (ت ع م) :{{ر|Meno25}} لقد عالجت التحويلة المكسورة، شكرا لك. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 21:32، 27 يناير 2025 (ت ع م) == طلب == أرجو منك مراجعة صفحات طلبات الصلاحيات. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 13:25، 2 فبراير 2025 (ت ع م) :{{تم}} [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 20:47، 10 فبراير 2025 (ت ع م) ::أخ ما قصة هذه الكلمات الإنجليزية المبالغ فيها في [[خاص:عرض صلاحيات المجموعات#autopatrolled|هذه]] الصفحة، هل هي ضرورية لأنني أفكر في فتح نقاش بخصوصها فهي غير منطقية فهذا مشروع عربي، هل توافقني في الرأي؟ [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 14:23، 11 فبراير 2025 (ت ع م) :::{{ر|جودت}} الصفحة مترجمة إلى العربية ولا إشكال فيها، تتضمن شروحات عربية مفهومة للصلاحيات، مع كلمات تقنية أو وصوفات للصلاحيات بالإنجليزية، وهي وصوفات ضرورية للمعايرة والتوحيد وتطوير برامج ويكيميديا. يرجى أيضا أن تلاحظ أن نفس الصفحة موجودة في المشاريع الأخرى، والوصوفات الإنجليزية لا تترجم لخصوصيتها سواء في المشاريع العربية أو غيرها. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 19:30، 11 فبراير 2025 (ت ع م) ::::@[[مستخدم:Najem Ajem|Najem Ajem]] هل [[مستخدم:Zina1|هذا]] المستخدم يستحق صلاحية حقا؟ هل يمكنك مراجعة مساهماته، فأنا أجد بعضا من مقالاته تخالف سياسات القاموس مثل [[slave of the glorious|هذه]] الصفحة التي انشئها في 2018 وهو يملك صلاحية منذ 2016 لذلك يجب مراجعة مقالاته وتعديلاته وسحب الصلاحية إن تبين وجود مخالفات. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 13:28، 16 فبراير 2025 (ت ع م) :::::{{ر|جودت}} ذلك المستخدِم لم يعد نشطا في الموقع وآخر تعديل له كان في 2017. لقد حذفتُ الصفحة التي أشرتَ إليها. شكرا لك. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 22:06، 16 فبراير 2025 (ت ع م) == طلب منع == مرحبا، أرجو منك منع [[مستخدم:156.202.57.199]] فهو آي بي للدعاية فقط. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 04:10، 24 أبريل 2025 (ت ع م) :{{تم}} {{ر|جودت}}، شكرا على الإبلاغ [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 14:02، 24 أبريل 2025 (ت ع م) == مستخدم:Dr.H.Seif/ملعب == من فضلك احذفها ثم احميها؛ لا فائدة من منع الآي بي. [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 15:27، 24 أبريل 2025 (ت ع م) :{{ر|كريم رائد}}، شكرا لقد حميت إنشاء الصفحة. وأرى أن المنع مفيد لأن المستخدم قام بتخريب صفحات أخرى. المنع المطبق مؤقت. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 16:56، 24 أبريل 2025 (ت ع م) ::شكر جزيلا! [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 16:59، 24 أبريل 2025 (ت ع م) :::@[[مستخدم:Najem Ajem|Najem Ajem]] أرجو إخفاء [https://ar.m.wiktionary.org/w/index.php?title=%D8%AE%D8%A7%D8%B5:%D8%B3%D8%AC%D9%84&logid=246871 ملخص الإنشاء هذا] لأن فيه بيانات شخصية حساسة. [[مستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:black;">كريم {{أخضر|رائد}}</span> ]] [[نقاش المستخدم:كريم رائد|<span style="font-size:medium;font-family:Script MT Bold;color:red;">نقاش</span>]] 10:53، 25 أبريل 2025 (ت ع م) :::{{ر|كريم رائد}} {{تم}}. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 12:23، 25 أبريل 2025 (ت ع م) ==إضافة أداة== مرحبا أرجو منك إضافة أداة تبديل الأرقام [https://ar.wikipedia.org/wiki/%D9%85%D9%8A%D8%AF%D9%8A%D8%A7%D9%88%D9%8A%D9%83%D9%8A:Gadget-Numeral-converter-toggle.js Gadget-Numeral-converter-toggle.js] الموجودة في ويكيبيديا إلى تفضيلات المستخدم في قسم الإضافات.[[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 18:40، 4 مايو 2025 (ت ع م) :{{ر|جودت}} {{تم}} شكرا على الاقتراح. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 18:15، 6 مايو 2025 (ت ع م) ::@[[مستخدم:Najem Ajem|Najem Ajem]] زر تبديل الأرقام لا يظهر عند تفعيل الإضافة، الميزة الأساسية لهذه الإضافة هو أنه عند تفعيلها يظهر زر في الخيارات يتيح للمستخدم تبديل الأرقام بضغطة زر واحدة إلى مشرقية أو العكس. تحياتي [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 12:39، 7 مايو 2025 (ت ع م) :::{{ر|جودت}} توجد الآن إضافتين جديدتين، واحدة تبدل الأرقام المغربية إلى مشرقية فقط بدون أن تختار، والأخرى (أسفل منها مباشرة) هي التي تعطيك خيارات علوية في القائمة المنسدلة للمستخدم، وتسمح لك بالتبديل بين الأرقام المغربية والأرقام المشرقية. جربتُهما البارحة واليوم، كلتا الإضافتين يشتغلان عندي، فقط اعلم أن الإضافة الأخيرة هي التي تعطيك الخيارات في القائمة العلوية كما قلت. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 15:05، 7 مايو 2025 (ت ع م) :::{{ر|جودت}} هل الأمور تمام بخصوص الإضافة ؟ أي مظهر تستخدم ؟ [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 11:26، 8 مايو 2025 (ت ع م) ::::@[[مستخدم:Najem Ajem|Najem Ajem]] الأمور تمام لكن حبذ لو جعلت تفعيل زر تبديل الأرقام والزر الذي يحول الأرقام لمشرقية يعملان معا بمجرد تفعيل أحدهما مع إمكانية إغلاق أحد الزرين بعد حفظ التفضيلات، كما في ويكيبيديا. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 13:02، 8 مايو 2025 (ت ع م) :::::نقلت الأدوات كما هي من ويكيبيديا. ما رأيك يا أخي {{ر|حبيشان}}، هل فاتني شيء ما؟ [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 12:16، 9 مايو 2025 (ت ع م) ::::::@[[مستخدم:Najem Ajem|Najem Ajem]] أشكرك على تفعيل الإضافة، @[[مستخدم:جودت|جودت]] أشكرك على الاقتراح، والإضافة تعمل كما في ويكيبيديا العربية [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 13:24، 9 مايو 2025 (ت ع م) == علم سوريا == مرحبا أرجو منك التوقف عن إضافة تلك الخريطة، لقد اصبح علم سوريا الجديد رسميا في منظمات عالمية مثل الأمم المتحدة. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 16:10، 8 مايو 2025 (ت ع م) :وأيضا الصورة التي وضعتها لا تحوي علم فلسطين على الرغم من أن فلسطين دولة معترف بها دوليا وتعتبر الضفة الغربية المحتلة وقطاع غزة أراض فلسطينية. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 16:12، 8 مايو 2025 (ت ع م) ::لذا ساعدني برفع الملف المناسب إن كنت ترى الملف الذي رفعته مؤخرا غير صالح. تحياتي [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 16:14، 8 مايو 2025 (ت ع م) :::{{ر|جودت}} عذرا، لم ألحظ هذه التفاصيل. لكن، ما لم يعجبني هو أن خارطة المغرب مبتورة. فإما أن تكون كاملة، أو ببساطة نضع صورة جغرافية لا تحمل أي علم. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 12:16، 9 مايو 2025 (ت ع م) == الخريطة == في [[قالب:دول عربية]] قطاع غزة غير موجود، أرجو منك تغيير الخريطة، وأيضا حمايتك للصفحة فيها استعجال. تحياتي [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 04:17، 13 مايو 2025 (ت ع م) :{{ر|جودت}}، :أولا: إذا أمعَنتَ النظر قد ترى قطاع غزة في الخريطة. :ثانيا: أنا لا أصنع الخرائط، الصورة (ونظيراتها) موجودة في كومنز ومستخدمة في مشاريع أخرى بما في ذلك المشاريع العربية. :ثالثا: هذا ليس مكانا لمناقشة الجيوبوليتيك أو السياسات العالمية أو تضخيم الأمور، شخص عادي يجد صورة معبرة عن الدول العربية (ومستخدمة في ويكيبيديا الشقيقة)، صورة محايدة، يضعها في القالب، ويحميه لتفادي حروب تحرير مرتبطة بالأعلام أو ما شابه. :[[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 04:47، 13 مايو 2025 (ت ع م) ::@[[مستخدم:Najem Ajem|Najem Ajem]] أرجو إضافة هذا الملف: [[:ملف:Arab nationalism Map.svg]] موجود في ويكيبيديا الشقيقة. فلسطين في الخريطة الحالية معلمة بالرمادي مع أن فلسطين جزء من ثقافة الوطن العربي، والصورة الحالية ذات طابع سياسي ومثيرة للرأي العام العربي. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 13:02، 13 مايو 2025 (ت ع م) ::@[[مستخدم:Najem Ajem|Najem Ajem]] هل من تعقيب؟ ما رأيك بالملف المقترح؟ [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 04:34، 14 مايو 2025 (ت ع م) :::{{ر|جودت}} هذا النقاش لا طائل ولا مغزى منه. الصورة الموجودة في القالب تعبر أصلا عن الدول العربية ولا حاجة لتغييرها إذ لا شائب فيها. وأرجو أن نستوعب أن ويكاموس مشروع قاموسي، نحن لا نصنع الخراط هنا ولا نناقش التفاصيل السياسية ولا نؤجج الصراعات، بل نعرّف الكلمات والمصطلحات ونوضح سياقات استخدامها، إذا لاحظتَ فالقالب هدفه البسيط هو جمع وصلات إلى صفحات محتوى، الصورة المرفوقة (التي بطريقة استثنائية عجيبة وغير مفهومة تثير حفيظتك) موجودة للتوضيح أو على الأقل للتزيين، وخرائط مطابقة لها موجودة في كل مكان، في ويكيبيديا العربية أيضا (بطبيعة الحال). فأرجو أن نتوقف عن التكلم بخصوص هذا الموضوع. وكمعلومة، الخريطة التي اقترحتَها أنت تضم مناطق من إيران، فهي لا تعبر عن الدول العربية، بل عن مكان انتشار العرب. تحياتي، [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 07:48، 14 مايو 2025 (ت ع م) == لديك بريد == مرحبا، لقد ارسلت رسالة لك بالبريد. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 12:39، 23 يونيو 2025 (ت ع م) :مرحبا {{ر|جودت}} لقد أرسلت لك ردا عبر الإيميل قبل يومين، فقط تأكد من "الرسائل غير المرغوبة" إن لزم الأمر. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 21:23، 24 يونيو 2025 (ت ع م) ::عفوا، يتعذر علي الوصول لحسابي. اكتب ردك هنا لو سمحت. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 12:46، 25 يونيو 2025 (ت ع م) :::'''سؤالك كان''': <blockquote>''مرحبا، أود ترشيح نفسي بعد أشهر لصلاحية الإداري، ما النصائح؟ وهل الترشيح لا يزال مبكرا؟''</blockquote> :::'''جوابي كان''': <blockquote> السلام عليك يا جودت، أهم ما يُنتظر من الإداري هو: * تقبّل آراء الآخرين والتعامل بتفهّم. * تجنّب الصدامات والمشاحنات مع الإداريين الآخرين. * صيانة الموقع دون اللجوء إلى إغراقه بتعديلات غير ضرورية. * التشاور مع المجتمع وبقية الإداريين في الأمور الجوهرية. مساهماتك الحالية جيدة، ولكن لم يمضِ على تسجيلك بعد سوى أقل من خمسة أشهر. دعنا نمنح الأمر بعض الوقت، ثم أرشحك للصلاحية بعد أشهر، بإذن الله. </blockquote> :::[[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 20:46، 26 يونيو 2025 (ت ع م) == سؤال == لمَ تراجعت عن ترشيح الشطب؟ إن كان البرنامج معروفا فهذا لا يعني أن له مكانا هنا. ما رأيك بإنشاء صفحة لمايكروسوفت كليب تشامب (Clipchamp)! إنه مجرد برنامج من تطوير شركة. وليس مفردة ولا علاقة له بالمحتوى القاموسي. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 17:45، 6 يوليو 2025 (ت ع م) :وبخصوص [[جوجل]] و [[Google]] فهي مواقع شعبية ومعروفة في جميع أنحاء العالم لكن [[أوتوكاد]] برنامج من تطوير شركة. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 09:45، 7 يوليو 2025 (ت ع م) ::«هدفنا من ويكاموس هو إنشاء قاموس يعتمد عليه، لا بل أن ننشئ أكبر قاموس في التاريخ سواء في العرض أو العمق.» ولن يتحقق ذلك بجعل القاموس يغرق بالصفحات العشوائية غير القاموسية. تحياتي [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 09:52، 7 يوليو 2025 (ت ع م) :::{{ر|جودت}} ويكاموس قاموس عام لا يضم فقط المدخلات اللغوية بل يضم أيضا المصطلحات التقنية والعلمية والاقتصادية وغيرها. هذا ينطبق على جميع النسخ ليس فقط النسخة العربية. وأوتوكاد ليس مجرد "منتج" بل برنامج مشهور وأُلِفّت له كتب تعليمية وتقنية عديدة لذا هذا المصطلح ليس صفحة عشوائية. وبالمناسبة ويكاموس الإنجليزي يضم صفحات لبرامج حاسوبية أقل شهرة بكثير من أوتوكاد مثل [[:en:CXF|CXF]]. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] 21:39، 7 يوليو 2025 (ت ع م) ::::@[[مستخدم:Najem Ajem|Najem Ajem]] شكرا على التوضيح. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 08:56، 8 يوليو 2025 (ت ع م) == إضافة تبديل الأرقام == مرحبا @[[مستخدم:Najem Ajem|Najem Ajem]] بسبب حساسية المشروع يرجى التعديل على إضافة [[ميدياويكي:Gadget-Numeral-converter-toggle.js]] بحيث لا تؤثر على الصفحات ضمن النطاق العام، لقد أنشأت مؤخرا المدخلة [[180s]] وبسبب قيامي بتفعيل الإضافة تغيرت الأرقام للمشرقية. [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 14:02، 18 يوليو 2025 (ت ع م) :@[[مستخدم:Najem Ajem|Najem Ajem]] لعل الإشارة لم تصل [[مستخدم:جودت|<span style="font-size:medium;font-family:Script MT Bold;color:green;"> <span style="color:#008000">جودت</span></span> ]] [[نقاش المستخدم:جودت|<span style="font-size:small;font-family:Script MT Bold;color:#FF0000;"><span style="color:#cc0000">★</span></span>ناقشني]] 08:57، 21 يوليو 2025 (ت ع م) == وضع رابط للصفحات الخاصة == أرجو إضافة رابط للصفحات الخاصة كما في ويكي مصدر [[s:خاص:فرق/530005]]. [[مستخدم:حبيشان|حبيشان]] ([[نقاش المستخدم:حبيشان|نقاش]]) 21:20، 19 سبتمبر 2025 (ت ع م) :{{تم}}. [[مستخدم:Najem Ajem|'''<span style="color:#00008B">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#00008B">''❄''</span>''']] == [[وحدة:auto cat]] == Hi there. Can you delete this module because obsoleted and not used anypages. [[مستخدم:Hiyuune|Hiyuune]] ([[نقاش المستخدم:Hiyuune|نقاش]]) 01:14، 20 مارس 2026 (ت ع م) :{{ر|Hiyuune}} {{نفذ}} [[مستخدم:Najem Ajem|'''<span style="color:#3B82F6">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#3B82F6">''❄''</span>''']] 02:57، 20 مارس 2026 (ت ع م) == حذف صفحات ميدياويكي == أرجو حذف الصفحات التالية: # [[ميدياويكي:Chick.css]] # [[ميدياويكي:Chick.js]] # [[ميدياويكي:Simple.css]] # [[ميدياويكي:Simple.js]] # [[ميدياويكي:Standard.js]] # [[ميدياويكي:Standard.css]] # [[ميدياويكي:Geshi.css]] # [[ميدياويكي:Handheld.css]] الصفحات متعلقة بمظاهر محذوفة حاليا، وميزات محذوفة حاليا. [[مستخدم:حبيشان|حبيشان]]<sup>('''[[نقاش المستخدم:حبيشان|ن]]''')</sup> 00:41، الجمعة 22 شوال 1447هـ (+3) :{{ر|حبيشان}} {{تم}} شكرا على الملاحظة. [[مستخدم:Najem Ajem|'''<span style="color:#3B82F6">--الناجم العاجم</span>''']] [[نقاش المستخدم:Najem Ajem|'''<span style="color:#3B82F6">''❄''</span>''']] 13:22، 10 أبريل 2026 (ت ع م) == You may be an eligible candidate for the U4C election == <div lang="en" dir="ltr" class="mw-content-ltr"> Greetings, The [[m:Special:MyLanguage/Universal_Code_of_Conduct/Coordinating_Committee|Universal Code of Conduct Coordinating Committee (U4C)]] seeks candidates for the 2026 election. The U4C is the global committee responsible for overseeing enforcement of the [[foundation:Special:MyLanguage/Policy:Universal Code of Conduct|Universal Code of Conduct]]. Elections are held annually, if elected a committee member serves for two years. This year the U4C requires candidates to hold administrator rights on at least one wiki, which is why you are being contacted as you appear to hold this right. There are other requirements, such as candidates must be at least 18 years old and may not be employed by the Wikimedia Foundation or other related chapters and affiliates. You can find more information in the [[m:Special:MyLanguage/Universal_Code_of_Conduct/Coordinating_Committee/Election/2026#Call_for_Candidates|call for candidates on Meta-wiki]]. Additionally, the committee's working language is English; some ability to communicate in English is required. The election opens on 18 May, if you are eligible and interested you have until 10 May to submit your candidacy. There will week between for candidates to answer questions from the community. Voting takes place privately in [[m:Special:MyLanguage/SecurePoll|SecurePoll]], successful candidates must receive at least 60% support. More information is available on [[m:Special:MyLanguage/Universal_Code_of_Conduct/Coordinating_Committee/Election/2026|the 2026 Elections page]], including timelines and other candidacy information. If you read over the material and consider yourself qualified, please consider submitting your name to run for the committee. If you think someone else in your community might be interested and qualified, please encourage them to run. In partnership with the U4C -- [[m:User:Keegan (WMF)|Keegan (WMF)]] ([[m:User_talk:Keegan (WMF)|talk]]) 18:30، 28 أبريل 2026 (ت ع م) </div> <!-- الرسالة التي أرسلها User:Keegan (WMF)@metawiki باستخدام القائمة في https://meta.wikimedia.org/w/index.php?title=User:Keegan_(WMF)/test&oldid=30471712 --> h67se9k327k2agm0yps1kx1i97sy0o1 ميدياويكي:Gadget-Cat-a-lot.css 8 206355 1089717 973656 2026-04-28T23:26:24Z Neriah 30524 Standardisation of thumbnail sizes 1089717 css text/css #cat_a_lot { bottom: 0; display: block; position: fixed; left: 0; z-index: 100; padding: 5px; box-shadow: 0px 2px 4px rgba(0,0,0,0.5); -moz-box-shadow: 0px 2px 4px rgba(0,0,0,0.5); -webkit-box-shadow: 0px 2px 4px rgba(0,0,0,0.5); background-color: #FBFCC7; background: -moz-linear-gradient(top, rgba(251, 252, 209, 0.9), #FBFCC7); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(251, 252, 209, 0.9)), to(#FBFCC7)); } #cat_a_lot_data, #cat_a_lot_mark_counter { display: none; } #cat_a_lot_data ul { list-style-image: none; list-style-type: none; margin: 0px 0px 0px 5px; } #cat_a_lot_category_list { max-height: 450px; overflow: auto; } #cat_a_lot_selections, #cat_a_lot_mark_counter { background: url(/w/skins/Vector/images/portal-break.png) no-repeat; padding: 5px; } a { cursor:pointer; } .cat_a_lot_action { float:left; } .cat_a_lot_move { float:left; margin-right: 5px; } .cat_a_lot_feedback { border: 1px #A9DE16 solid !important; background: #EAF2CB url(/w/resources/src/mediawiki.legacy/images/ajax-loader.gif) no-repeat 8px 14px !important; padding-right: 2.85em !important; padding-top: 10px !important; font-size: 1.1em !important; } .cat_a_lot_done { background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Dialog-apply.svg/60px-Dialog-apply.svg.png)!important; background-position: 8px 50% !important; padding-top: 0px !important; } #cat_a_lot_searchcatname { font-size: 112%; margin: -5px 0px 5px -5px; width: 102%; } .skin-vector #cat_a_lot { font-size: .75em; } .cat_a_lot_markAsDone { background-color: #BABABA; } .cat_a_lot_selected { background-color: #DF6; } #cat_a_lot_no_found { font-weight:bold; } shivtihum8db4qs5n7k3w65f2205ssj مستخدم:حبيشان/common.js 2 230726 1089720 1089650 2026-04-29T02:46:48Z حبيشان 31560 1089720 javascript text/javascript // mw.loader.load('https://ar.wiktionary.org/w/index.php?title=%D9%85%D8%B3%D8%AA%D8%AE%D8%AF%D9%85:%D8%AD%D8%A8%D9%8A%D8%B4%D8%A7%D9%86/wiktionary2025.js&action=raw&ctype=text/javascript'); // mw.loader.load('https://ar.wiktionary.org/w/index.php?title=%D9%85%D8%B3%D8%AA%D8%AE%D8%AF%D9%85:%D8%AD%D8%A8%D9%8A%D8%B4%D8%A7%D9%86/auto-cite-shamela.js&action=raw&ctype=text/javascript'); mw.loader.getState('ext.gadget.summaryButtons') ? mw.loader.load('ext.gadget.summaryButtons') : mw.loader.load('https://ar.wikipedia.org/w/load.php?debug=false&modules=ext.gadget.summaryButtons'); // mw.loader.using( 'ext.visualEditor.targetLoader', () => { // // Register plugins to VE. Will be loaded once the user opens VE // mw.libs.ve.targetLoader.addPlugin( 'ext.gadget.auto-cite-wikidata' ); // } ); // إضافة أزرار ملخصات التعديل mw.hook('summaryButtons').add(function () { addSummaryButton('تهذيب', 'تهذيب'); addSummaryButton('قوالب صيانة', 'قوالب صيانة'); addSummaryButton('توثيق', 'توثيق'); addSummaryButton('داكن', 'توافق مع الوضع الداكن'); addSummaryButton('إصلاح', 'إصلاح قوالب'); addSummaryButton('تحديث', 'تحديث قوالب'); }); blzet3iwf553wl4bhwmoovxz96ev9li ميدياويكي:Gadget-auto-cite-shamela.js 8 231299 1089719 1089620 2026-04-29T02:17:58Z حبيشان 31560 تحميل مرة واحدة فقط 1089719 javascript text/javascript /** * Auto Cite Shamela * * الاستشهاد الآلي بالشاملة * version 1.3.1 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { if (window.AutoCiteShamelaLoaded) { return; } window.AutoCiteShamelaLoaded = true; ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteShamela/1.3.1'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 const realsearch = inspector.lookupInput.getValue(); const search = ve.safeDecodeURIComponent( realsearch ); // preliminary check if (!(search.indexOf("shamela.ws") > -1 || search.indexOf("app.turath.io") > -1 || search.indexOf("archive.org/details") > -1 || /^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search))) { return inspector._performLookup(); } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(rData) { try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); return JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } return rData; } // Get QID from wikidata async function getQID(Pid, book_id) { let data = await (new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent })).get({ action: 'query', list: 'search', srsearch: `haswbstatement:${Pid}=${book_id}`, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); return getQID("P724", identifier).then(async Qids => { if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || page.startsWith('n')) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); let volcount; const resp = await wdapi.get({ action: 'wbgetentities', ids: qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims['P953'] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return [qvol, qpageoffest]; } return null; }).filter(v => v !== null);; let wdvol = wdvols && wdvols[0] && wdvols[0][0] ? wdvols[0][0] : null; wdpageoffset = wdvols && wdvols[0] && wdvols[0][1] ? wdvols[0][1] : 0; console.log("Selected Wikidata volume:", wdvol, "with page offset:", wdpageoffset," vol count:",volcount); if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; if (search.indexOf("archive.org/details") > -1) { citoidRequest = fetch_archive(search); citoidXhr = citoidRequest; } else { citoidRequest = fetch_shamela(search); citoidXhr = citoidRequest.then(function (data) { let rData = JSON.parse("[" + data.expandtemplates.wikitext + "]"); if (rData[0].error && rData[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { return refetch_shamela(rData); } return rData; }); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteShamela: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteShamela: Error - " + rData[0].error); mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), // source: ['Wikidata'], transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); dgjrolisvd9sfhkhvqdi2eyl81mgi20 مساعدة:إضافة الاستشهاد بالمكتبة الشاملة آليا 12 231305 1089712 1088867 2026-04-28T18:16:47Z حبيشان 31560 إضافة موقع أرشيف 1089712 wikitext text/x-wiki [[ملف:إضافات ويكيبيديا.svg|يسار|لا إطار]] [[ملف:الاستشهاد الآلي في ويكاموس.webm|يسار|تصغير|توضيح للاستشهاد من موقع تراث]] إضافةٌ في المحرر المرئي، والاستشهادِ الآلي فيه، تحوّل الاستشهاد إلى استشهاد بويكي بيانات برابط الاستشهاد من [https://shamela.ws موقع المكتبة الشاملة] أو [https://app.turath.io موقع تراث]، أو [https://archive.org موقع أرشيف] أو نصٍّ منسوخٍ بخِدمة العزو في برنامج المكتبة الشاملة للوِندوز. == تفعيل الإضافة == {{كيفية تفعيل|auto-cite-shamela-loader}} == طريقة عمل الإضافة == * '''أولًا:''' فعل الإضافة كما في القسم السابق. * انسخ رابط الاستشهاد: ** '''للاستشهاد من [https://shamela.ws موقع الشاملة]:''' اضغط أيقونة النسخ يسارَ الفِقْرة، في نافذة «نسخ الفِقْرة ورابط لها»: اختر نسخ النص مع الرابط، أو نسخ الرابط لمعلومات الكتاب دون بيانات الصفحة. ** '''للاستشهاد من برنامج الشاملة:''' ظلل نصًّا، ثم اضغط زر النسخ مع العزو في مقدمة مجموعة الأزرار أعلى يسار الصفحة، أو بالاختصار: {{ضغط زر|Ctrl|shift|C}} ** '''للاستشهاد من [https://app.turath.io موقع التراث]:''' اضغط {{ضغط زر|^}} أسفل الصفحة لفتح القائمة، ثم أمر «مشاركة رابط أو نصوص» ثم زر {{ضغط زر|مشاركة رابط الصفحة}}. ** للاستشهاد من [https://archive.org موقع أرشيف]: انسخ رابط العنوان. * في المقالة وفي المحرر المرئي: اضغط زر «استشهاد» وأنتَ في قسم «آلي»: فألصِقِ النص بـ {{ضغط زر|ctrl|V}}، ويُستحسن حذفُ الاقتباس من أوَّل النص المنسوخ في الموقع إلى ما قبلَ (--------)، وآخِرِ النص المنسوخ في البرنامج (عند استعمال الإعدادات الافتراضية) بين علامتي تنصيص «». * اضغط زر توليد ثم إدراج. ولا تغير هذه الإضافةُ سلوكَ الاستشهاد الآلي، إلا إذا كان النصُّ رابطًا من موقع الشاملة (shamela.ws)، أو من موقع تراث (app.turath.io) أو على نَسَق العزو من الشاملة (أيْ: «اسم الكتاب» (ص10)) أو من موقع أرشيف. == ملاحظات == هذه الميزة تعتمد على بيانات الكتب المدخلة في ويكي بيانات، فما أكثرتَ العزوَ إليه من كتب الشاملة تُستحسن إضافته إلى ويكي بيانات، ثُمَّ إلى صفحة [[وحدة:Cite Shamela/data.json]]. وبالنسبة لموقع أرشيف يجب إدخال {{خاصية|P724}} في بيانات الكتاب في ويكي بيانات . [[تصنيف:سكريبتات ويكاموس]] 8yk291hhpwtsg19axl71mj1u4kfimij 1089713 1089712 2026-04-28T18:18:29Z حبيشان 31560 1089713 wikitext text/x-wiki [[ملف:الاستشهاد الآلي في ويكاموس.webm|يسار|تصغير|توضيح للاستشهاد من موقع تراث]] إضافةٌ في المحرر المرئي، والاستشهادِ الآلي فيه، تحوّل الاستشهاد إلى استشهاد بويكي بيانات برابط الاستشهاد من [https://shamela.ws موقع المكتبة الشاملة] أو [https://app.turath.io موقع تراث]، أو [https://archive.org موقع أرشيف] أو نصٍّ منسوخٍ بخِدمة العزو في برنامج المكتبة الشاملة للوِندوز. == تفعيل الإضافة == {{كيفية تفعيل|auto-cite-shamela-loader}} == طريقة عمل الإضافة == * '''أولًا:''' فعل الإضافة كما في القسم السابق. * انسخ رابط الاستشهاد: ** '''للاستشهاد من [https://shamela.ws موقع الشاملة]:''' اضغط أيقونة النسخ يسارَ الفِقْرة، في نافذة «نسخ الفِقْرة ورابط لها»: اختر نسخ النص مع الرابط، أو نسخ الرابط لمعلومات الكتاب دون بيانات الصفحة. ** '''للاستشهاد من برنامج الشاملة:''' ظلل نصًّا، ثم اضغط زر النسخ مع العزو في مقدمة مجموعة الأزرار أعلى يسار الصفحة، أو بالاختصار: {{ضغط زر|Ctrl|shift|C}} ** '''للاستشهاد من [https://app.turath.io موقع التراث]:''' اضغط {{ضغط زر|^}} أسفل الصفحة لفتح القائمة، ثم أمر «مشاركة رابط أو نصوص» ثم زر {{ضغط زر|مشاركة رابط الصفحة}}. ** للاستشهاد من [https://archive.org موقع أرشيف]: انسخ رابط العنوان. * في المقالة وفي المحرر المرئي: اضغط زر «استشهاد» وأنتَ في قسم «آلي»: فألصِقِ النص بـ {{ضغط زر|ctrl|V}}، ويُستحسن حذفُ الاقتباس من أوَّل النص المنسوخ في الموقع إلى ما قبلَ (--------)، وآخِرِ النص المنسوخ في البرنامج (عند استعمال الإعدادات الافتراضية) بين علامتي تنصيص «». * اضغط زر توليد ثم إدراج. ولا تغير هذه الإضافةُ سلوكَ الاستشهاد الآلي، إلا إذا كان النصُّ رابطًا من موقع الشاملة (shamela.ws)، أو من موقع تراث (app.turath.io) أو على نَسَق العزو من الشاملة (أيْ: «اسم الكتاب» (ص10)) أو من موقع أرشيف. == ملاحظات == هذه الميزة تعتمد على بيانات الكتب المدخلة في ويكي بيانات، فما أكثرتَ العزوَ إليه من كتب الشاملة تُستحسن إضافته إلى ويكي بيانات، ثُمَّ إلى صفحة [[وحدة:Cite Shamela/data.json]]. وبالنسبة لموقع أرشيف يجب إدخال {{خاصية|P724}} في بيانات الكتاب في ويكي بيانات . [[تصنيف:سكريبتات ويكاموس]] r7ffnsxbaxt1lec5bgomix8k8js2eg3 نقاش المستخدم:عبدالرحمن 3 237009 1089715 1088736 2026-04-28T19:07:10Z Dr-Taher 12861 نقل Dr-Taher صفحة [[نقاش المستخدم:Aelrhman2007]] إلى [[نقاش المستخدم:عبدالرحمن]]: نُقِلت الصفحة آليا عند إعادة تسمية المستخدم «[[Special:CentralAuth/Aelrhman2007|Aelrhman2007]]» إلى «[[Special:CentralAuth/عبدالرحمن|عبدالرحمن]]». 1088736 wikitext text/x-wiki <div style="width:auto" style="margin-bottom:1.25em;border:1px solid #{{#switch:bleu|bleu=8898BF|vert=97BF87|jaune=AAAA66|or=777777|orange=AA8833|violet=7755AA|saumon=AA8866|sable=AA9955|vertmoyen=88BB55|bleufoncé=1144AA|rouge=AA8866|écarlate=AAAAAA|#default=AAAAAA}}; background:white;padding:0"> <div style="height:8px;margin:0;border:0;border-bottom:1px solid #{{#switch:bleu|bleu=8898BF|vert=97BF87|jaune=AAAA66|or=777777|orange=AA8833|violet=7755AA|saumon=AA8866|sable=AA9955|vertmoyen=88BB55|bleufoncé=1144AA|rouge=AA8866|écarlate=AAAAAA|#default=AAAAAA}};background: #{{#switch:bleu|bleu=C8D8FF|vert=D7FFC7|jaune=FFFFB9|or=FFE040|orange=FFDD88|violet=C9AEF1|saumon=FBDFBE|sable=F1E2AE|vertmoyen=99CC66|bleufoncé=003399|rouge=FFDAB9|écarlate=FF3333|#default=E0E0E0}};font-size:1px"></div> <div style="padding:5px;font-size:small"><div class="center"><span style="word-spacing:1ex"><small>[[ويكاموس:سفارة|Welcome!]] [[ويكاموس:سفارة|Bienvenue!]] [[ويكاموس:سفارة|Willkommen!]] [[ويكاموس:سفارة|Benvenuti]] [[ويكاموس:سفارة|¡Bienvenido!]] [[ويكاموس:سفارة|ようこそ]] [[ويكاموس:سفارة|Dobrodošli]] [[ويكاموس:سفارة|환영합니다]] [[ويكاموس:سفارة|Добро пожаловать]] [[ويكاموس:سفارة|Bem-vindo!]] [[ويكاموس:سفارة|欢迎]] [[ويكاموس:سفارة|Bonvenon]] [[ويكاموس:سفارة|Welkom]]</small></span></div></div> <div class="center"><big>'''[[ويكاموس:ترحيب بالقادمين الجدد|مرحبا بك]] في [[ويكاموس]]، Aelrhman2007 !'''</big></div> {| |[[ملف:WiktionaryAr.svg|يمين|40بك]] | [[ويكاموس]] هو <u>مشروع تحرير جماعي لـ'''قاموس علمي وثقافي''' '''بمختلف اللغات'''</u>. لطلب المساعدة في أي وقت تجد وصلة ([[مساعدة:محتويات|'''مساعدة''']]) في هامش كل صفحة على اليمين. لا تتردد في قراءة '''الوصايا الأولى''': * [[ويكاموس:دليل سريع|دليل سريع لتعلم التنسيق]] * [[مساعدة:إنشاء صفحة جديدة|كيف تنشئ صفحة جديدة]] * [[ويكاموس:دروس (التحرير)|دروس مفصلة لتعلم التنسيق]] * [[ويكاموس:صيغة الكتابة|الصيغة الموحدة للكتابة]] * [[ويكاموس:ويكاموس ليس|مبادئ ويكاموس]] لا تتردد في زيارة '''[[مستخدم:Aelrhman2007/ملعبي|ملعبك الخاص]]''' لاحتواء تجاربك وخطواتك الأولى في التحرير والتعديل. |-- |[[ملف:Presa de decissions.png|يمين|40بك]] | يمكنك الاستفسار و[[ويكاموس:أسئلة|طرح الأسئلة]] المتعلقة بطبيعة العمل في ويكاموس. يمكنك أيضا [{{fullurl:مستخدم:Aelrhman2007|action=edit}} التعريف] بنفسك في [[مستخدم:Aelrhman2007|'''صفحتك الشخصية''']]، بكتابة معلومات عنك: [[ويكاموس:بابل|اللغات التي تتكلمها]]، [[ويكاموس:صناديق المستخدم|من أي بلد أنت، ما هي محاور اهتمامك]]... |--- |[[ملف:Crystal Clear app ktip.png|يمين|40بك]] | لا تنس [[ويكاموس:توقيع|'''التوقيع''']] في [[مساعدة:صفحة النقاش|'''صفحات النقاش''']] بكتابة أربع مدّات، هكذا (<nowiki>~~~~</nowiki>). ولكن يجب <u>'''عدم التوقيع في صفحات المقالات القاموسية'''</u>، لأنها تصبح ملكًا للجميع لحظة إنشائها. نرجو منك ألاّ تنسى [[ويكاموس:حقوق التأليف والنشر|<u>'''عدم النسخ من الشابكة'''</u>]] لأسباب [[ويكاموس:حقوق التأليف والنشر|<u>'''حقوق التأليف والنشر'''</u>]]. |-- |[[ملف:Crystal Clear app amor.png|يمين|40بك]] | أخيرا، وهو أهم شيء، نتمى لك أن [[ويكاموس:كن جريئا|'''تتمتع''']] بالمساهمة [[ويكاموس:بوابة المجتمع|'''معنا''']] في هذا المشروع! إذا كانت لديك أي استفسارات أو أسئلة أخرى، يمكنك طرحها في [[ويكاموس:أسئلة|هذه الصفحة]] أو في صفحة نقاشي. |}</div></div> --[[مستخدم:Meno25|Meno25]] ([[نقاش المستخدم:Meno25|نقاش]] • [[خاص:مساهمات/Meno25|مساهمات]]) 02:40، 7 مارس 2026 (ت ع م) ahc0i6onooljpnovkc1ezllh6bwmciz ميدياويكي:Gadget-auto-cite-wikidata.js 8 237533 1089672 1089651 2026-04-28T12:41:31Z حبيشان 31560 تحديث 1089672 javascript text/javascript /** * Auto Cite WikiData * * الاستشهاد الآلي بالويكي بيانات * version 2.0.0 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteWikiData/2.0.0'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 const realsearch = inspector.lookupInput.getValue(); const isURI = /^(https?):/.test(realsearch); const search = ve.safeDecodeURIComponent( realsearch ); const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); let isShamelaTxt, KID, isCommonsFile,isArchive, isShamela, searchUrl; if (!isURI) { if (/^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search)) { isShamelaTxt = true; } else { KID = detectIdentifier(realsearch); // preliminary check if (!KID) { return inspector._performLookup(); } } } else { KID = detectIDFromURL(search); if (!KID) { const wikimediaRegex = /^(.*\.)?(wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikinews|wikiversity|wikidata|wikivoyage|wikimedia|wikimediafoundation)\.org/i; searchUrl = new URL(search); if (wikimediaRegex.test(searchUrl.hostname.toLowerCase())) { return inspector._performLookup(); } else if (/shamela\.ws|app\.turath\.io/.test(searchUrl.hostname.toLowerCase())) { isShamela = true; } else if (/archive\.org\/details/.test(search)) { isArchive = true; } } } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); function detectIdentifier(input) { if (!input) return null; let str = input.trim(); str = str.replace(/\.pdf$/i, ''); const clean = str.replace(/[\s-]/g, ''); const doiRegex = /^10\.\d{4,9}\/\S+$/i; const arxivRegex = /^(\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?$/i; const isbnRegex = /^97[89]\d{10}$/; const isbn10Regex = /^\d{9}[\dXx]$/; if (doiRegex.test(str)) { return { P: 'P356', type: 'DOI', id: [str] }; } if (arxivRegex.test(str) ) { return { P:'P818', type: 'arXiv', id: [str] }; } if (isbnRegex.test(clean)) { return { P:'P212', type: 'ISBN', id: [str] }; } if (isbn10Regex.test(clean)) { return { P:'P957', type: 'ISBN-10', id: [str] }; } return null; } function detectIDFromURL(url) { const ids = [ // { P: 'P356', type: 'DOI', }, { P: 'P818', type: 'arXiv', regex: /^https?:\/\/(?:([^.]+\.))?(?:arxiv\.org|xxx\.lanl\.gov)\/(?:pdf|abs)\/(?<id2>(?<id>(?:\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7}))(?:v\d+)?)(?:\.pdf)?/i }, { P: 'P819', type: 'bibcode', regex: /^https?:\/\/ui\.adsabs\.harvard\.edu\/abs\/(?<id>\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z])(?:\/abstract)?/i }, { P: 'P3951', type: 'biorxiv', regex: /^https?:\/\/(?:www\.)?biorxiv\.org\/(?:content\/)?(?<dio>10\.1101\/(?<id>(?:\d{4}\.\d{2}\.\d{2}\.)?\d{6}))(?:v\d+)?(?:\.full)?(?:\.pdf)?/i }, { P: 'P894', type: 'zbMATH', regex: /^https?:\/\/zbmath\.org\/(?:\?(?:format=complete&)?(?:q=an:))?(?<id>[\d\.]+)/i }, { P: 'P888', type: 'jstor', regex: /^https?:\/\/(?:www\.)?jstor\.org\/(?:stable\/)?(?<id>[a-z0-9.\-_/]+)/i, doipre: '10.2307/' }, { P: 'P7896', type: 'Academia', regex: /^https?:\/\/(?:www\.)?academia\.edu\/(?:\w+\/)?(?<id>\d+)/i }, { P: 'P12914', type: 'mandumah', regex: /^https?:\/\/(?:search\.)?mandumah\.com\/(?:Record\/|Download\?file=[^#\?&]+&id=)(?<id>\d+)/i }, { P: 'P14250', type: 'eMarefa', regex: /^https?:\/\/(?:search\-emarefa\-net\.wikipedialibrary\.idm\.oclc\.org|search\.emarefa\.net)\/(?:ar|en)\/(?:detail|viewer)\/BIM\-(?<id>\d+)/i }, { P: 'P889', type: 'mathscinet', regex: /^https?:\/\/mathscinet\.ams\.org\/mathscinet(?:-getitem|\/relay-station)\?mr=(?<id>[1-9]\d{1,6})/i }, { P: 'P243', type: 'oclc', regex: /^https?:\/\/search\.worldcat\.org\/title\/(?<id>\d+)/i }, { P: 'P648', type: 'openlibrary', regex: /^https?:\/\/openlibrary\.org\/works\/(?<id>[^\/]+)/i }, { P: 'P3894', type: 'osti', regex: /^https?:\/\/www\.osti\.gov\/biblio\/(?<id>\d+)/i }, { P: 'P932', type: 'PMC', regex: /^https?:\/\/pmc\.ncbi\.nlm\.nih\.gov\/articles\/PMC(?<id>\d+)/i }, { P: 'P698', type: 'PubMed', regex: /^https?:\/\/pubmed\.ncbi\.nlm\.nih\.gov\/(?<id>\d+)/i }, { P: 'P892', type: 'rfc', regex: /^https?:\/\/datatracker\.ietf\.org\/doc\/html\/rfc(?<id>\d+)/i }, { P: 'P893', type: 'ssrn', regex: /^https?:\/\/(?:(?:papers\.)?ssrn\.com\/(?:sol3\/papers\.cfm\?abstract_id|abstract)|download\.ssrn\.com\/[^\s]+&abstractId)=(?<id>\d+)$/i }, { P: 'P4011', type: 's2pid', regex: /^https?:\/\/(?:www\.)?semanticscholar\.org\/paper(?:\/[^\s\/]+)?\/(?<id>[a-f0-9]{40})$/i }, { P: 'P675', type: 'Google Books', regex: /^https?:\/\/(?:books\.google\.com\/books\?id=|www.google.com\/books\/edition\/[^\s\/]+\/)(?<id>[0-9A-Za-z_\-]{12})(?:\?hl=[a-z]+&gbpv=(?<vol>\d+))?/i }, { P: 'P5875', type: 'ResearchGate', regex: /^https?:\/\/(?:www\.)?researchgate\.net\/publication\/([1-9]\d*)(?:_[\w\-\_']+)?/i }, // { type: 'PMID' } ]; for (const idType of ids) { if (idType.regex) { const match = url.match(idType.regex); if (match) { let ret = { P: idType.P, type: idType.type , url: url}; for (const [name, value] of Object.entries(match.groups || {})) { if (value!==undefined) ret[name] = value; } if (idType.doipre && ret.id) { ret.doi = idType.doipre + ret.id; } return ret; } } } return null; } // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(rData) { try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); return JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } return rData; } // Get QID from wikidata async function getQID(Pid, val, doi) { const searchValue = Array.isArray(val) ? 'haswbstatement:' + val.map(v => `${Pid}=${v}`).join('|') : `haswbstatement:${Pid}=${val}`; if (doi) { searchValue += `|P356=${doi}`; } let data = await wdapi.get({ action: 'query', list: 'search', srsearch: searchValue, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // get volume data from wikidata async function getVolumeData(Qid, volurl, Pid = 'P953') { console.log("AutoCiteWikidata: Fetching volume data from Wikidata for QID:", Qid, "and volume URL:", volurl); const resp = await wdapi.get({ action: 'wbgetentities', ids: Qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[Qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims[Pid] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return { vol: qvol, pageoffset: qpageoffest, volcount: volcount }; } return null; }).filter(v => v !== null); return wdvols.length > 0 ? wdvols[0] : {}; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); const Qids = await getQID("P724", identifier); console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata for archive.org identifier:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || (page && page.startsWith('n'))) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); wdvoldata = await getVolumeData(qid, volurl); console.log("AutoCiteWikidata: Retrieved volume data from Wikidata:", wdvoldata); let wdvol = wdvoldata.vol !== undefined ? wdvoldata.vol : null; wdpageoffset = wdvoldata.pageoffset !== undefined ? wdvoldata.pageoffset : 0; const volcount = wdvoldata.volcount !== undefined ? wdvoldata.volcount : null; if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; } async function fetchByURL(realsearch) { return getQID('P953', realsearch).then(async Qids => { console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] , 'المسار': realsearch, }; wdvoldata = await getVolumeData(Qids[i], realsearch); if (wdvoldata.vol) { args['ج'] = wdvoldata.vol; } ret.push(createTemplate(args)); } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; try { citoidRequest = (async function() { let ret = []; if (KID) { let KIDids = KID.id2 ? [KID.id, KID.id2] : [KID.id]; const Qids = await getQID(KID.P, KIDids, KID.doi); if (Qids.length == 0) { ret = [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] }; if (KID.url !== undefined) args.url = KID.url; if (KID.vol !== undefined) args.vol = KID.vol; ret.push(createTemplate(args)); } } else if (isArchive) { ret = await fetch_archive(search); } else if (isShamela || isShamelaTxt) { let data = await fetch_shamela(search); ret = JSON.parse("[" + data.expandtemplates.wikitext + "]"); if (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { ret = await refetch_shamela(ret); } } if (isURI && (ret.length === 0 || (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات"))) { ret = await fetchByURL(realsearch); } return ret; })(); citoidXhr = citoidRequest; } catch (e) { console.error("AutoCiteWikidata: Error during lookup:", e); return inspector._performLookup(); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteWikidata: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteWikidata: Error - " + rData[0].error); mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), // source: ['Wikidata'], transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); rql4hynhi4jc7m16fq6bm5is6pkazvo 1089673 1089672 2026-04-28T14:00:28Z حبيشان 31560 تهذيب وإصلاح 1089673 javascript text/javascript /** * Auto Cite WikiData * * الاستشهاد الآلي بويكي بيانات * version 2.0.0 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteWikiData/2.0.0'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 console.log(gadgetAgent + ' loaded'); const realsearch = inspector.lookupInput.getValue(); const isURI = /^(https?):/.test(realsearch); const search = ve.safeDecodeURIComponent( realsearch ); const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); let isShamelaTxt, KID, isCommonsFile,isArchive, isShamela, searchUrl; if (!isURI) { if (/^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search) || /shamela\.ws|app\.turath\.io/.test(search)) { isShamelaTxt = true; } else { KID = detectIdentifier(realsearch); // preliminary check if (!KID) { return inspector._performLookup(); } } } else { KID = detectIDFromURL(search); if (!KID) { const wikimediaRegex = /^(.*\.)?(wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikinews|wikiversity|wikidata|wikivoyage|wikimedia|wikimediafoundation)\.org/i; searchUrl = new URL(search); if (wikimediaRegex.test(searchUrl.hostname.toLowerCase())) { return inspector._performLookup(); } else if (/shamela\.ws|app\.turath\.io/.test(searchUrl.hostname.toLowerCase())) { isShamela = true; } else if (/archive\.org\/details/.test(search)) { isArchive = true; } } } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); function detectIdentifier(input) { if (!input) return null; let str = input.trim(); str = str.replace(/\.pdf$/i, ''); const clean = str.replace(/[\s-]/g, ''); const doiRegex = /^10\.\d{4,9}\/\S+$/i; const arxivRegex = /^(\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?$/i; const isbnRegex = /^97[89]\d{10}$/; const isbn10Regex = /^\d{9}[\dXx]$/; if (doiRegex.test(str)) { return { P: 'P356', type: 'DOI', id: [str] }; } else if (arxivRegex.test(str) ) { return { P:'P818', type: 'arXiv', id: [str] }; } else if (isbnRegex.test(clean)) { return { P:'P212', type: 'ISBN', id: [str] }; } else if (isbn10Regex.test(clean)) { return { P:'P957', type: 'ISBN-10', id: [str] }; } return null; } function detectIDFromURL(url) { const ids = [ { P: 'P818', type: 'arXiv', regex: /^https?:\/\/(?:([^.]+\.))?(?:arxiv\.org|xxx\.lanl\.gov)\/(?:pdf|abs)\/(?<id2>(?<id>(?:\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7}))(?:v\d+)?)(?:\.pdf)?/i }, { P: 'P819', type: 'bibcode', regex: /^https?:\/\/ui\.adsabs\.harvard\.edu\/abs\/(?<id>\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z])(?:\/abstract)?/i }, { P: 'P3951', type: 'biorxiv', regex: /^https?:\/\/(?:www\.)?biorxiv\.org\/(?:content\/)?(?<dio>10\.1101\/(?<id>(?:\d{4}\.\d{2}\.\d{2}\.)?\d{6}))(?:v\d+)?(?:\.full)?(?:\.pdf)?/i }, { P: 'P894', type: 'zbMATH', regex: /^https?:\/\/zbmath\.org\/(?:\?(?:format=complete&)?(?:q=an:))?(?<id>[\d\.]+)/i }, { P: 'P888', type: 'jstor', regex: /^https?:\/\/(?:www\.)?jstor\.org\/(?:stable\/)?(?<id>[a-z0-9.\-_/]+)/i, doipre: '10.2307/' }, { P: 'P7896', type: 'Academia', regex: /^https?:\/\/(?:www\.)?academia\.edu\/(?:\w+\/)?(?<id>\d+)/i }, { P: 'P12914', type: 'mandumah', regex: /^https?:\/\/(?:search\.)?mandumah\.com\/(?:Record\/|Download\?file=[^#\?&]+&id=)(?<id>\d+)/i }, { P: 'P14250', type: 'eMarefa', regex: /^https?:\/\/(?:search\-emarefa\-net\.wikipedialibrary\.idm\.oclc\.org|search\.emarefa\.net)\/(?:ar|en)\/(?:detail|viewer)\/BIM\-(?<id>\d+)/i }, { P: 'P889', type: 'mathscinet', regex: /^https?:\/\/mathscinet\.ams\.org\/mathscinet(?:-getitem|\/relay-station)\?mr=(?<id>[1-9]\d{1,6})/i }, { P: 'P243', type: 'oclc', regex: /^https?:\/\/search\.worldcat\.org\/title\/(?<id>\d+)/i }, { P: 'P648', type: 'openlibrary', regex: /^https?:\/\/openlibrary\.org\/works\/(?<id>[^\/]+)/i }, { P: 'P3894', type: 'osti', regex: /^https?:\/\/www\.osti\.gov\/biblio\/(?<id>\d+)/i }, { P: 'P932', type: 'PMC', regex: /^https?:\/\/pmc\.ncbi\.nlm\.nih\.gov\/articles\/PMC(?<id>\d+)/i }, { P: 'P698', type: 'PubMed', regex: /^https?:\/\/pubmed\.ncbi\.nlm\.nih\.gov\/(?<id>\d+)/i }, { P: 'P892', type: 'rfc', regex: /^https?:\/\/datatracker\.ietf\.org\/doc\/html\/rfc(?<id>\d+)/i }, { P: 'P893', type: 'ssrn', regex: /^https?:\/\/(?:(?:papers\.)?ssrn\.com\/(?:sol3\/papers\.cfm\?abstract_id|abstract)|download\.ssrn\.com\/[^\s]+&abstractId)=(?<id>\d+)$/i }, { P: 'P4011', type: 's2pid', regex: /^https?:\/\/(?:www\.)?semanticscholar\.org\/paper(?:\/[^\s\/]+)?\/(?<id>[a-f0-9]{40})$/i }, { P: 'P675', type: 'Google Books', regex: /^https?:\/\/(?:books\.google\.com\/books\?id=|www.google.com\/books\/edition\/[^\s\/]+\/)(?<id>[0-9A-Za-z_\-]{12})(?:\?hl=[a-z]+&gbpv=(?<vol>\d+))?/i }, { P: 'P5875', type: 'ResearchGate', regex: /^https?:\/\/(?:www\.)?researchgate\.net\/publication\/(?<id>[1-9]\d*)(?:_[\w\-\_']+)?/i }, ]; for (const idType of ids) { if (idType.regex) { const match = url.match(idType.regex); if (match) { let ret = { P: idType.P, type: idType.type , url: url}; for (const [name, value] of Object.entries(match.groups || {})) { if (value!==undefined) ret[name] = value; } if (idType.doipre && ret.id) { ret.doi = idType.doipre + ret.id; } return ret; } } } return null; } // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(search) { let ret = await fetch_shamela(search); ret = JSON.parse("[" + ret.expandtemplates.wikitext + "]"); if (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { console.log("AutoCiteWikidata: Initial Shamela lookup failed, attempting enhanced lookup using QID"); try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); ret = JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } } return ret; } // Get QID from wikidata async function getQID(Pid, val, doi) { const searchValue = Array.isArray(val) ? 'haswbstatement:' + val.map(v => `${Pid}=${v}`).join('|') : `haswbstatement:${Pid}=${val}`; if (doi) { searchValue += `|P356=${doi}`; } let data = await wdapi.get({ action: 'query', list: 'search', srsearch: searchValue, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // get volume data from wikidata async function getVolumeData(Qid, volurl, Pid = 'P953') { console.log("AutoCiteWikidata: Fetching volume data from Wikidata for QID:", Qid, "and volume URL:", volurl); const resp = await wdapi.get({ action: 'wbgetentities', ids: Qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[Qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims[Pid] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return { vol: qvol, pageoffset: qpageoffest, volcount: volcount }; } return null; }).filter(v => v !== null); return wdvols.length > 0 ? wdvols[0] : {}; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); const Qids = await getQID("P724", identifier); console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata for archive.org identifier:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || (page && page.startsWith('n'))) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); wdvoldata = await getVolumeData(qid, volurl); console.log("AutoCiteWikidata: Retrieved volume data from Wikidata:", wdvoldata); let wdvol = wdvoldata.vol !== undefined ? wdvoldata.vol : null; wdpageoffset = wdvoldata.pageoffset !== undefined ? wdvoldata.pageoffset : 0; const volcount = wdvoldata.volcount !== undefined ? wdvoldata.volcount : null; if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; } async function fetchByURL(realsearch) { return getQID('P953', realsearch).then(async Qids => { console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] , 'المسار': realsearch, }; wdvoldata = await getVolumeData(Qids[i], realsearch); if (wdvoldata.vol) { args['ج'] = wdvoldata.vol; } ret.push(createTemplate(args)); } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; try { citoidRequest = (async function() { let ret = []; console.log("AutoCiteWikidata: Starting lookup for KID:", KID); if (KID) { let KIDids = KID.id2 ? [KID.id, KID.id2] : [KID.id]; const Qids = await getQID(KID.P, KIDids, KID.doi); if (Qids.length == 0) { ret = [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] }; if (KID.url !== undefined) args.url = KID.url; if (KID.vol !== undefined) args.vol = KID.vol; ret.push(createTemplate(args)); } } else if (isArchive) { ret = await fetch_archive(search); } else if (isShamela || isShamelaTxt) { ret = await refetch_shamela(search); } if (isURI && (ret.length === 0 || (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات"))) { ret = await fetchByURL(realsearch); } return ret; })(); citoidXhr = citoidRequest; } catch (e) { console.error("AutoCiteWikidata: Error during lookup:", e); return inspector._performLookup(); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteWikidata: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteWikidata: Error - " + rData[0].error); mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), // source: ['Wikidata'], transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); qcnjvturs5ag6bjmhqy3m53xhvg66xh 1089687 1089673 2026-04-28T15:34:38Z حبيشان 31560 تصحيح 1089687 javascript text/javascript /** * Auto Cite WikiData * * الاستشهاد الآلي بويكي بيانات * version 2.0.0 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteWikiData/2.0.0'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 console.log(gadgetAgent + ' loaded'); const realsearch = inspector.lookupInput.getValue(); const isURI = /^(https?):/.test(realsearch); const search = ve.safeDecodeURIComponent( realsearch ); const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); let isShamelaTxt, KID, isCommonsFile,isArchive, isShamela, searchUrl; if (!isURI) { if (/^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search) || /shamela\.ws|app\.turath\.io/.test(search)) { isShamelaTxt = true; } else { KID = detectIdentifier(realsearch); // preliminary check if (!KID) { return inspector._performLookup(); } } } else { KID = detectIDFromURL(search); if (!KID) { const wikimediaRegex = /^(.*\.)?(wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikinews|wikiversity|wikidata|wikivoyage|wikimedia|wikimediafoundation)\.org/i; searchUrl = new URL(search); if (wikimediaRegex.test(searchUrl.hostname.toLowerCase())) { return inspector._performLookup(); } else if (/shamela\.ws|app\.turath\.io/.test(searchUrl.hostname.toLowerCase())) { isShamela = true; } else if (/archive\.org\/details/.test(search)) { isArchive = true; } } } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); function detectIdentifier(input) { if (!input) return null; let str = input.trim(); str = str.replace(/\.pdf$/i, ''); const clean = str.replace(/[\s-]/g, ''); const doiRegex = /^10\.\d{4,9}\/\S+$/i; const arxivRegex = /^(\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?$/i; const isbnRegex = /^97[89]\d{10}$/; const isbn10Regex = /^\d{9}[\dXx]$/; if (doiRegex.test(str)) { return { P: 'P356', type: 'DOI', id: [str] }; } else if (arxivRegex.test(str) ) { return { P:'P818', type: 'arXiv', id: [str] }; } else if (isbnRegex.test(clean)) { return { P:'P212', type: 'ISBN', id: [str] }; } else if (isbn10Regex.test(clean)) { return { P:'P957', type: 'ISBN-10', id: [str] }; } return null; } function detectIDFromURL(url) { const ids = [ { P: 'P818', type: 'arXiv', regex: /^https?:\/\/(?:([^.]+\.))?(?:arxiv\.org|xxx\.lanl\.gov)\/(?:pdf|abs)\/(?<id2>(?<id>(?:\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7}))(?:v\d+)?)(?:\.pdf)?/i }, { P: 'P819', type: 'bibcode', regex: /^https?:\/\/ui\.adsabs\.harvard\.edu\/abs\/(?<id>\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z])(?:\/abstract)?/i }, { P: 'P3951', type: 'biorxiv', regex: /^https?:\/\/(?:www\.)?biorxiv\.org\/(?:content\/)?(?<dio>10\.1101\/(?<id>(?:\d{4}\.\d{2}\.\d{2}\.)?\d{6}))(?:v\d+)?(?:\.full)?(?:\.pdf)?/i }, { P: 'P894', type: 'zbMATH', regex: /^https?:\/\/zbmath\.org\/(?:\?(?:format=complete&)?(?:q=an:))?(?<id>[\d\.]+)/i }, { P: 'P888', type: 'jstor', regex: /^https?:\/\/(?:www\.)?jstor\.org\/(?:stable\/)?(?<id>[a-z0-9.\-_/]+)/i, doipre: '10.2307/' }, { P: 'P7896', type: 'Academia', regex: /^https?:\/\/(?:www\.)?academia\.edu\/(?:\w+\/)?(?<id>\d+)/i }, { P: 'P12914', type: 'mandumah', regex: /^https?:\/\/(?:search\.)?mandumah\.com\/(?:Record\/|Download\?file=[^#\?&]+&id=)(?<id>\d+)/i }, { P: 'P14250', type: 'eMarefa', regex: /^https?:\/\/(?:search\-emarefa\-net\.wikipedialibrary\.idm\.oclc\.org|search\.emarefa\.net)\/(?:ar|en)\/(?:detail|viewer)\/BIM\-(?<id>\d+)/i }, { P: 'P889', type: 'mathscinet', regex: /^https?:\/\/mathscinet\.ams\.org\/mathscinet(?:-getitem|\/relay-station)\?mr=(?<id>[1-9]\d{1,6})/i }, { P: 'P243', type: 'oclc', regex: /^https?:\/\/search\.worldcat\.org\/title\/(?<id>\d+)/i }, { P: 'P648', type: 'openlibrary', regex: /^https?:\/\/openlibrary\.org\/works\/(?<id>[^\/]+)/i }, { P: 'P3894', type: 'osti', regex: /^https?:\/\/www\.osti\.gov\/biblio\/(?<id>\d+)/i }, { P: 'P932', type: 'PMC', regex: /^https?:\/\/pmc\.ncbi\.nlm\.nih\.gov\/articles\/PMC(?<id>\d+)/i }, { P: 'P698', type: 'PubMed', regex: /^https?:\/\/pubmed\.ncbi\.nlm\.nih\.gov\/(?<id>\d+)/i }, { P: 'P892', type: 'rfc', regex: /^https?:\/\/datatracker\.ietf\.org\/doc\/html\/rfc(?<id>\d+)/i }, { P: 'P893', type: 'ssrn', regex: /^https?:\/\/(?:(?:papers\.)?ssrn\.com\/(?:sol3\/papers\.cfm\?abstract_id|abstract)|download\.ssrn\.com\/[^\s]+&abstractId)=(?<id>\d+)$/i }, { P: 'P4011', type: 's2pid', regex: /^https?:\/\/(?:www\.)?semanticscholar\.org\/paper(?:\/[^\s\/]+)?\/(?<id>[a-f0-9]{40})$/i }, { P: 'P675', type: 'Google Books', regex: /^https?:\/\/(?:books\.google\.com\/books\?id=|www.google.com\/books\/edition\/[^\s\/]+\/)(?<id>[0-9A-Za-z_\-]{12})(?:\?hl=[a-z]+&gbpv=(?<vol>\d+))?/i }, { P: 'P5875', type: 'ResearchGate', regex: /^https?:\/\/(?:www\.)?researchgate\.net\/publication\/(?<id>[1-9]\d*)(?:_[\w\-\_']+)?/i }, ]; for (const idType of ids) { if (idType.regex) { const match = url.match(idType.regex); if (match) { let ret = { P: idType.P, type: idType.type , url: url}; for (const [name, value] of Object.entries(match.groups || {})) { if (value!==undefined) ret[name] = value; } if (idType.doipre && ret.id) { ret.doi = idType.doipre + ret.id; } return ret; } } } return null; } // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(search) { let ret = await fetch_shamela(search); ret = JSON.parse("[" + ret.expandtemplates.wikitext + "]"); if (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { console.log("AutoCiteWikidata: Initial Shamela lookup failed, attempting enhanced lookup using QID"); try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); ret = JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } } return ret; } // Get QID from wikidata async function getQID(Pid, val, doi) { let searchValue = Array.isArray(val) ? 'haswbstatement:' + val.map(v => `${Pid}=${v}`).join('|') : `haswbstatement:${Pid}=${val}`; if (doi) { searchValue += `|P356=${doi}`; } let data = await wdapi.get({ action: 'query', list: 'search', srsearch: searchValue, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // get volume data from wikidata async function getVolumeData(Qid, volurl, Pid = 'P953') { console.log("AutoCiteWikidata: Fetching volume data from Wikidata for QID:", Qid, "and volume URL:", volurl); const resp = await wdapi.get({ action: 'wbgetentities', ids: Qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[Qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims[Pid] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return { vol: qvol, pageoffset: qpageoffest, volcount: volcount }; } return null; }).filter(v => v !== null); return wdvols.length > 0 ? wdvols[0] : {}; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); const Qids = await getQID("P724", identifier); console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata for archive.org identifier:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || (page && page.startsWith('n'))) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); wdvoldata = await getVolumeData(qid, volurl); console.log("AutoCiteWikidata: Retrieved volume data from Wikidata:", wdvoldata); let wdvol = wdvoldata.vol !== undefined ? wdvoldata.vol : null; wdpageoffset = wdvoldata.pageoffset !== undefined ? wdvoldata.pageoffset : 0; const volcount = wdvoldata.volcount !== undefined ? wdvoldata.volcount : null; if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; } async function fetchByURL(realsearch) { return getQID('P953', realsearch).then(async Qids => { console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] , 'المسار': realsearch, }; wdvoldata = await getVolumeData(Qids[i], realsearch); if (wdvoldata.vol) { args['ج'] = wdvoldata.vol; } ret.push(createTemplate(args)); } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; try { citoidRequest = (async function() { let ret = []; console.log("AutoCiteWikidata: Starting lookup for KID:", KID); if (KID) { let KIDids = KID.id2 ? [KID.id, KID.id2] : [KID.id]; const Qids = await getQID(KID.P, KIDids, KID.doi); if (Qids.length == 0) { ret = [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] }; if (KID.url !== undefined) args.url = KID.url; if (KID.vol !== undefined) args.vol = KID.vol; ret.push(createTemplate(args)); } } else if (isArchive) { ret = await fetch_archive(search); } else if (isShamela || isShamelaTxt) { ret = await refetch_shamela(search); } if (isURI && (ret.length === 0 || (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات"))) { ret = await fetchByURL(realsearch); } return ret; })(); citoidXhr = citoidRequest; } catch (e) { console.error("AutoCiteWikidata: Error during lookup:", e); return inspector._performLookup(); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteWikidata: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteWikidata: Error - " + rData[0].error); mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), // source: ['Wikidata'], transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); 98m56kovpnivokmdxr4vpy8s8ra1zyi 1089718 1089687 2026-04-29T02:16:26Z حبيشان 31560 تحميل مرة واحدة فقط 1089718 javascript text/javascript /** * Auto Cite WikiData * * الاستشهاد الآلي بويكي بيانات * version 2.0.0 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { if (window.AutoCiteWikiDataLoaded) { return; } window.AutoCiteWikiDataLoaded = true; ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteWikiData/2.0.0'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 console.log(gadgetAgent + ' loaded'); const realsearch = inspector.lookupInput.getValue(); const isURI = /^(https?):/.test(realsearch); const search = ve.safeDecodeURIComponent( realsearch ); const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); let isShamelaTxt, KID, isCommonsFile,isArchive, isShamela, searchUrl; if (!isURI) { if (/^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search) || /shamela\.ws|app\.turath\.io/.test(search)) { isShamelaTxt = true; } else { KID = detectIdentifier(realsearch); // preliminary check if (!KID) { return inspector._performLookup(); } } } else { KID = detectIDFromURL(search); if (!KID) { const wikimediaRegex = /^(.*\.)?(wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikinews|wikiversity|wikidata|wikivoyage|wikimedia|wikimediafoundation)\.org/i; searchUrl = new URL(search); if (wikimediaRegex.test(searchUrl.hostname.toLowerCase())) { return inspector._performLookup(); } else if (/shamela\.ws|app\.turath\.io/.test(searchUrl.hostname.toLowerCase())) { isShamela = true; } else if (/archive\.org\/details/.test(search)) { isArchive = true; } } } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); function detectIdentifier(input) { if (!input) return null; let str = input.trim(); str = str.replace(/\.pdf$/i, ''); const clean = str.replace(/[\s-]/g, ''); const doiRegex = /^10\.\d{4,9}\/\S+$/i; const arxivRegex = /^(\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?$/i; const isbnRegex = /^97[89]\d{10}$/; const isbn10Regex = /^\d{9}[\dXx]$/; if (doiRegex.test(str)) { return { P: 'P356', type: 'DOI', id: [str] }; } else if (arxivRegex.test(str) ) { return { P:'P818', type: 'arXiv', id: [str] }; } else if (isbnRegex.test(clean)) { return { P:'P212', type: 'ISBN', id: [str] }; } else if (isbn10Regex.test(clean)) { return { P:'P957', type: 'ISBN-10', id: [str] }; } return null; } function detectIDFromURL(url) { const ids = [ { P: 'P818', type: 'arXiv', regex: /^https?:\/\/(?:([^.]+\.))?(?:arxiv\.org|xxx\.lanl\.gov)\/(?:pdf|abs)\/(?<id2>(?<id>(?:\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7}))(?:v\d+)?)(?:\.pdf)?/i }, { P: 'P819', type: 'bibcode', regex: /^https?:\/\/ui\.adsabs\.harvard\.edu\/abs\/(?<id>\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z])(?:\/abstract)?/i }, { P: 'P3951', type: 'biorxiv', regex: /^https?:\/\/(?:www\.)?biorxiv\.org\/(?:content\/)?(?<dio>10\.1101\/(?<id>(?:\d{4}\.\d{2}\.\d{2}\.)?\d{6}))(?:v\d+)?(?:\.full)?(?:\.pdf)?/i }, { P: 'P894', type: 'zbMATH', regex: /^https?:\/\/zbmath\.org\/(?:\?(?:format=complete&)?(?:q=an:))?(?<id>[\d\.]+)/i }, { P: 'P888', type: 'jstor', regex: /^https?:\/\/(?:www\.)?jstor\.org\/(?:stable\/)?(?<id>[a-z0-9.\-_/]+)/i, doipre: '10.2307/' }, { P: 'P7896', type: 'Academia', regex: /^https?:\/\/(?:www\.)?academia\.edu\/(?:\w+\/)?(?<id>\d+)/i }, { P: 'P12914', type: 'mandumah', regex: /^https?:\/\/(?:search\.)?mandumah\.com\/(?:Record\/|Download\?file=[^#\?&]+&id=)(?<id>\d+)/i }, { P: 'P14250', type: 'eMarefa', regex: /^https?:\/\/(?:search\-emarefa\-net\.wikipedialibrary\.idm\.oclc\.org|search\.emarefa\.net)\/(?:ar|en)\/(?:detail|viewer)\/BIM\-(?<id>\d+)/i }, { P: 'P889', type: 'mathscinet', regex: /^https?:\/\/mathscinet\.ams\.org\/mathscinet(?:-getitem|\/relay-station)\?mr=(?<id>[1-9]\d{1,6})/i }, { P: 'P243', type: 'oclc', regex: /^https?:\/\/search\.worldcat\.org\/title\/(?<id>\d+)/i }, { P: 'P648', type: 'openlibrary', regex: /^https?:\/\/openlibrary\.org\/works\/(?<id>[^\/]+)/i }, { P: 'P3894', type: 'osti', regex: /^https?:\/\/www\.osti\.gov\/biblio\/(?<id>\d+)/i }, { P: 'P932', type: 'PMC', regex: /^https?:\/\/pmc\.ncbi\.nlm\.nih\.gov\/articles\/PMC(?<id>\d+)/i }, { P: 'P698', type: 'PubMed', regex: /^https?:\/\/pubmed\.ncbi\.nlm\.nih\.gov\/(?<id>\d+)/i }, { P: 'P892', type: 'rfc', regex: /^https?:\/\/datatracker\.ietf\.org\/doc\/html\/rfc(?<id>\d+)/i }, { P: 'P893', type: 'ssrn', regex: /^https?:\/\/(?:(?:papers\.)?ssrn\.com\/(?:sol3\/papers\.cfm\?abstract_id|abstract)|download\.ssrn\.com\/[^\s]+&abstractId)=(?<id>\d+)$/i }, { P: 'P4011', type: 's2pid', regex: /^https?:\/\/(?:www\.)?semanticscholar\.org\/paper(?:\/[^\s\/]+)?\/(?<id>[a-f0-9]{40})$/i }, { P: 'P675', type: 'Google Books', regex: /^https?:\/\/(?:books\.google\.com\/books\?id=|www.google.com\/books\/edition\/[^\s\/]+\/)(?<id>[0-9A-Za-z_\-]{12})(?:\?hl=[a-z]+&gbpv=(?<vol>\d+))?/i }, { P: 'P5875', type: 'ResearchGate', regex: /^https?:\/\/(?:www\.)?researchgate\.net\/publication\/(?<id>[1-9]\d*)(?:_[\w\-\_']+)?/i }, ]; for (const idType of ids) { if (idType.regex) { const match = url.match(idType.regex); if (match) { let ret = { P: idType.P, type: idType.type , url: url}; for (const [name, value] of Object.entries(match.groups || {})) { if (value!==undefined) ret[name] = value; } if (idType.doipre && ret.id) { ret.doi = idType.doipre + ret.id; } return ret; } } } return null; } // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(search) { let ret = await fetch_shamela(search); ret = JSON.parse("[" + ret.expandtemplates.wikitext + "]"); if (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { console.log("AutoCiteWikidata: Initial Shamela lookup failed, attempting enhanced lookup using QID"); try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); ret = JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } } return ret; } // Get QID from wikidata async function getQID(Pid, val, doi) { let searchValue = Array.isArray(val) ? 'haswbstatement:' + val.map(v => `${Pid}=${v}`).join('|') : `haswbstatement:${Pid}=${val}`; if (doi) { searchValue += `|P356=${doi}`; } let data = await wdapi.get({ action: 'query', list: 'search', srsearch: searchValue, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // get volume data from wikidata async function getVolumeData(Qid, volurl, Pid = 'P953') { console.log("AutoCiteWikidata: Fetching volume data from Wikidata for QID:", Qid, "and volume URL:", volurl); const resp = await wdapi.get({ action: 'wbgetentities', ids: Qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[Qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims[Pid] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return { vol: qvol, pageoffset: qpageoffest, volcount: volcount }; } return null; }).filter(v => v !== null); return wdvols.length > 0 ? wdvols[0] : {}; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); const Qids = await getQID("P724", identifier); console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata for archive.org identifier:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || (page && page.startsWith('n'))) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); wdvoldata = await getVolumeData(qid, volurl); console.log("AutoCiteWikidata: Retrieved volume data from Wikidata:", wdvoldata); let wdvol = wdvoldata.vol !== undefined ? wdvoldata.vol : null; wdpageoffset = wdvoldata.pageoffset !== undefined ? wdvoldata.pageoffset : 0; const volcount = wdvoldata.volcount !== undefined ? wdvoldata.volcount : null; if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; } async function fetchByURL(realsearch) { return getQID('P953', realsearch).then(async Qids => { console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] , 'المسار': realsearch, }; wdvoldata = await getVolumeData(Qids[i], realsearch); if (wdvoldata.vol) { args['ج'] = wdvoldata.vol; } ret.push(createTemplate(args)); } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; try { citoidRequest = (async function() { let ret = []; console.log("AutoCiteWikidata: Starting lookup for KID:", KID); if (KID) { let KIDids = KID.id2 ? [KID.id, KID.id2] : [KID.id]; const Qids = await getQID(KID.P, KIDids, KID.doi); if (Qids.length == 0) { ret = [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] }; if (KID.url !== undefined) args.url = KID.url; if (KID.vol !== undefined) args.vol = KID.vol; ret.push(createTemplate(args)); } } else if (isArchive) { ret = await fetch_archive(search); } else if (isShamela || isShamelaTxt) { ret = await refetch_shamela(search); } if (isURI && (ret.length === 0 || (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات"))) { ret = await fetchByURL(realsearch); } return ret; })(); citoidXhr = citoidRequest; } catch (e) { console.error("AutoCiteWikidata: Error during lookup:", e); return inspector._performLookup(); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteWikidata: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteWikidata: Error - " + rData[0].error); mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), // source: ['Wikidata'], transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); 27ea3r5fvctohi9w0wcglfp9cou7wyr 1089723 1089718 2026-04-29T08:22:07Z حبيشان 31560 حذف الرسالة 1089723 javascript text/javascript /** * Auto Cite WikiData * * الاستشهاد الآلي بويكي بيانات * version 2.0.0 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { if (window.AutoCiteWikiDataLoaded) { return; } window.AutoCiteWikiDataLoaded = true; ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteWikiData/2.0.0'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 console.log(gadgetAgent + ' loaded'); const realsearch = inspector.lookupInput.getValue(); const isURI = /^(https?):/.test(realsearch); const search = ve.safeDecodeURIComponent( realsearch ); const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); let isShamelaTxt, KID, isCommonsFile,isArchive, isShamela, searchUrl; if (!isURI) { if (/^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search) || /shamela\.ws|app\.turath\.io/.test(search)) { isShamelaTxt = true; } else { KID = detectIdentifier(realsearch); // preliminary check if (!KID) { return inspector._performLookup(); } } } else { KID = detectIDFromURL(search); if (!KID) { const wikimediaRegex = /^(.*\.)?(wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikinews|wikiversity|wikidata|wikivoyage|wikimedia|wikimediafoundation)\.org/i; searchUrl = new URL(search); if (wikimediaRegex.test(searchUrl.hostname.toLowerCase())) { return inspector._performLookup(); } else if (/shamela\.ws|app\.turath\.io/.test(searchUrl.hostname.toLowerCase())) { isShamela = true; } else if (/archive\.org\/details/.test(search)) { isArchive = true; } } } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); function detectIdentifier(input) { if (!input) return null; let str = input.trim(); str = str.replace(/\.pdf$/i, ''); const clean = str.replace(/[\s-]/g, ''); const doiRegex = /^10\.\d{4,9}\/\S+$/i; const arxivRegex = /^(\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?$/i; const isbnRegex = /^97[89]\d{10}$/; const isbn10Regex = /^\d{9}[\dXx]$/; if (doiRegex.test(str)) { return { P: 'P356', type: 'DOI', id: [str] }; } else if (arxivRegex.test(str) ) { return { P:'P818', type: 'arXiv', id: [str] }; } else if (isbnRegex.test(clean)) { return { P:'P212', type: 'ISBN', id: [str] }; } else if (isbn10Regex.test(clean)) { return { P:'P957', type: 'ISBN-10', id: [str] }; } return null; } function detectIDFromURL(url) { const ids = [ { P: 'P818', type: 'arXiv', regex: /^https?:\/\/(?:([^.]+\.))?(?:arxiv\.org|xxx\.lanl\.gov)\/(?:pdf|abs)\/(?<id2>(?<id>(?:\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7}))(?:v\d+)?)(?:\.pdf)?/i, doipre: '10.48550/arXiv.' }, { P: 'P819', type: 'bibcode', regex: /^https?:\/\/ui\.adsabs\.harvard\.edu\/abs\/(?<id>\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z])(?:\/abstract)?/i }, { P: 'P3951', type: 'biorxiv', regex: /^https?:\/\/(?:www\.)?biorxiv\.org\/(?:content\/)?(?<dio>10\.1101\/(?<id>(?:\d{4}\.\d{2}\.\d{2}\.)?\d{6}))(?:v\d+)?(?:\.full)?(?:\.pdf)?/i }, { P: 'P894', type: 'zbMATH', regex: /^https?:\/\/zbmath\.org\/(?:\?(?:format=complete&)?(?:q=an:))?(?<id>[\d\.]+)/i }, { P: 'P888', type: 'jstor', regex: /^https?:\/\/(?:www\.)?jstor\.org\/(?:stable\/)?(?<id>[a-z0-9.\-_/]+)/i, doipre: '10.2307/' }, { P: 'P7896', type: 'Academia', regex: /^https?:\/\/(?:www\.)?academia\.edu\/(?:\w+\/)?(?<id>\d+)/i }, { P: 'P12914', type: 'mandumah', regex: /^https?:\/\/(?:search\.)?mandumah\.com\/(?:Record\/|Download\?file=[^#\?&]+&id=)(?<id>\d+)/i }, { P: 'P14250', type: 'eMarefa', regex: /^https?:\/\/(?:search\-emarefa\-net\.wikipedialibrary\.idm\.oclc\.org|search\.emarefa\.net)\/(?:ar|en)\/(?:detail|viewer)\/BIM\-(?<id>\d+)/i }, { P: 'P889', type: 'mathscinet', regex: /^https?:\/\/mathscinet\.ams\.org\/mathscinet(?:-getitem|\/relay-station)\?mr=(?<id>[1-9]\d{1,6})/i }, { P: 'P243', type: 'oclc', regex: /^https?:\/\/search\.worldcat\.org\/title\/(?<id>\d+)/i }, { P: 'P648', type: 'openlibrary', regex: /^https?:\/\/openlibrary\.org\/works\/(?<id>[^\/]+)/i }, { P: 'P3894', type: 'osti', regex: /^https?:\/\/www\.osti\.gov\/biblio\/(?<id>\d+)/i }, { P: 'P932', type: 'PMC', regex: /^https?:\/\/pmc\.ncbi\.nlm\.nih\.gov\/articles\/PMC(?<id>\d+)/i }, { P: 'P698', type: 'PubMed', regex: /^https?:\/\/pubmed\.ncbi\.nlm\.nih\.gov\/(?<id>\d+)/i }, { P: 'P892', type: 'rfc', regex: /^https?:\/\/datatracker\.ietf\.org\/doc\/html\/rfc(?<id>\d+)/i }, { P: 'P893', type: 'ssrn', regex: /^https?:\/\/(?:(?:papers\.)?ssrn\.com\/(?:sol3\/papers\.cfm\?abstract_id|abstract)|download\.ssrn\.com\/[^\s]+&abstractId)=(?<id>\d+)$/i }, { P: 'P4011', type: 's2pid', regex: /^https?:\/\/(?:www\.)?semanticscholar\.org\/paper(?:\/[^\s\/]+)?\/(?<id>[a-f0-9]{40})$/i }, { P: 'P675', type: 'Google Books', regex: /^https?:\/\/(?:books\.google\.com\/books\?id=|www.google.com\/books\/edition\/[^\s\/]+\/)(?<id>[0-9A-Za-z_\-]{12})(?:\?hl=[a-z]+&gbpv=(?<vol>\d+))?/i }, { P: 'P5875', type: 'ResearchGate', regex: /^https?:\/\/(?:www\.)?researchgate\.net\/publication\/(?<id>[1-9]\d*)(?:_[\w\-\_']+)?/i }, ]; for (const idType of ids) { if (idType.regex) { const match = url.match(idType.regex); if (match) { let ret = { P: idType.P, type: idType.type , url: url}; for (const [name, value] of Object.entries(match.groups || {})) { if (value!==undefined) ret[name] = value; } if (idType.doipre && ret.id) { ret.doi = idType.doipre + ret.id; } return ret; } } } return null; } // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(search) { let ret = await fetch_shamela(search); ret = JSON.parse("[" + ret.expandtemplates.wikitext + "]"); if (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { console.log("AutoCiteWikidata: Initial Shamela lookup failed, attempting enhanced lookup using QID"); try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); ret = JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } } return ret; } // Get QID from wikidata async function getQID(Pid, val, doi) { let searchValue = Array.isArray(val) ? 'haswbstatement:' + val.map(v => `${Pid}=${v}`).join('|') : `haswbstatement:${Pid}=${val}`; if (doi) { searchValue += `|P356=${doi}`; } let data = await wdapi.get({ action: 'query', list: 'search', srsearch: searchValue, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // get volume data from wikidata async function getVolumeData(Qid, volurl, Pid = 'P953') { console.log("AutoCiteWikidata: Fetching volume data from Wikidata for QID:", Qid, "and volume URL:", volurl); const resp = await wdapi.get({ action: 'wbgetentities', ids: Qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[Qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims[Pid] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return { vol: qvol, pageoffset: qpageoffest, volcount: volcount }; } return null; }).filter(v => v !== null); return wdvols.length > 0 ? wdvols[0] : {}; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); const Qids = await getQID("P724", identifier); console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata for archive.org identifier:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || (page && page.startsWith('n'))) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); wdvoldata = await getVolumeData(qid, volurl); console.log("AutoCiteWikidata: Retrieved volume data from Wikidata:", wdvoldata); let wdvol = wdvoldata.vol !== undefined ? wdvoldata.vol : null; wdpageoffset = wdvoldata.pageoffset !== undefined ? wdvoldata.pageoffset : 0; const volcount = wdvoldata.volcount !== undefined ? wdvoldata.volcount : null; if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; } async function fetchByURL(realsearch) { return getQID('P953', realsearch).then(async Qids => { console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] , 'المسار': realsearch, }; wdvoldata = await getVolumeData(Qids[i], realsearch); if (wdvoldata.vol) { args['ج'] = wdvoldata.vol; } ret.push(createTemplate(args)); } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; try { citoidRequest = (async function() { let ret = []; console.log("AutoCiteWikidata: Starting lookup for KID:", KID); if (KID) { let KIDids = KID.id2 ? [KID.id, KID.id2] : [KID.id]; const Qids = await getQID(KID.P, KIDids, KID.doi); if (Qids.length == 0) { ret = [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] }; if (KID.url !== undefined) args.url = KID.url; if (KID.vol !== undefined) args.vol = KID.vol; ret.push(createTemplate(args)); } } else if (isArchive) { ret = await fetch_archive(search); } else if (isShamela || isShamelaTxt) { ret = await refetch_shamela(search); } if (isURI && (ret.length === 0 || (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات"))) { ret = await fetchByURL(realsearch); } return ret; })(); citoidXhr = citoidRequest; } catch (e) { console.error("AutoCiteWikidata: Error during lookup:", e); return inspector._performLookup(); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteWikidata: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteWikidata: Error - " + rData[0].error); // mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), // source: ['Wikidata'], transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); o25hxcmywwblymrzti5oaxk352td2g4 1089724 1089723 2026-04-29T09:58:32Z حبيشان 31560 مدعوم من wikidata 1089724 javascript text/javascript /** * Auto Cite WikiData * * الاستشهاد الآلي بويكي بيانات * version 2.0.0 * كتبها: حبيشان * by [[:ar:User:حبيشان]] * * تتطلب [[:ar:Module:Cite Shamela]] [[:ar:Module:Cite Shamela/data.json]] [[:ar:قالب:استشهاد بالشاملة]] * */ mw.hook('ve.activationComplete').add(function () { if (window.AutoCiteWikiDataLoaded) { return; } window.AutoCiteWikiDataLoaded = true; ve.ui.CitoidInspector.prototype._performLookup = ve.ui.CitoidInspector.prototype.performLookup; ve.ui.CitoidInspector.prototype.performLookup = function () { const inspector = this; const gadgetAgent = 'AutoCiteWikiData/2.0.0'; // Common case: pasting a URI into this field. Citoid expects // minimally encoded input, so do some speculative decoding here to // avoid 404 fetches. T146539 console.log(gadgetAgent + ' loaded'); const realsearch = inspector.lookupInput.getValue(); const isURI = /^(https?):/.test(realsearch); const search = ve.safeDecodeURIComponent( realsearch ); const wdapi = new mw.ForeignApi('https://www.wikidata.org/w/api.php', { userAgent: gadgetAgent }); let isShamelaTxt, KID, isCommonsFile,isArchive, isShamela, searchUrl; if (!isURI) { if (/^«[^»]+» \((ص)?[0-9 \/]+([^0-9]+)?\)/.test(search) || /shamela\.ws|app\.turath\.io/.test(search)) { isShamelaTxt = true; } else { KID = detectIdentifier(realsearch); // preliminary check if (!KID) { return inspector._performLookup(); } } } else { KID = detectIDFromURL(search); if (!KID) { const wikimediaRegex = /^(.*\.)?(wikipedia|wiktionary|wikiquote|wikibooks|wikisource|wikinews|wikiversity|wikidata|wikivoyage|wikimedia|wikimediafoundation)\.org/i; searchUrl = new URL(search); if (wikimediaRegex.test(searchUrl.hostname.toLowerCase())) { return inspector._performLookup(); } else if (/shamela\.ws|app\.turath\.io/.test(searchUrl.hostname.toLowerCase())) { isShamela = true; } else if (/archive\.org\/details/.test(search)) { isArchive = true; } } } // TODO: Add caching for requested urls if (inspector.lookupPromise) { // Abort existing lookup inspector.lookupPromise.abort(); inspector.lookupPromise = null; inspector.lookupInput.popPending(); } // Set as pending inspector.lookupButton.setDisabled(true); inspector.lookupInput.setDisabled(true).pushPending(); function detectIdentifier(input) { if (!input) return null; let str = input.trim(); str = str.replace(/\.pdf$/i, ''); const clean = str.replace(/[\s-]/g, ''); const doiRegex = /^10\.\d{4,9}\/\S+$/i; const arxivRegex = /^(\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7})(v\d+)?$/i; const isbnRegex = /^97[89]\d{10}$/; const isbn10Regex = /^\d{9}[\dXx]$/; if (doiRegex.test(str)) { return { P: 'P356', type: 'DOI', id: [str] }; } else if (arxivRegex.test(str) ) { return { P:'P818', type: 'arXiv', id: [str] }; } else if (isbnRegex.test(clean)) { return { P:'P212', type: 'ISBN', id: [str] }; } else if (isbn10Regex.test(clean)) { return { P:'P957', type: 'ISBN-10', id: [str] }; } return null; } function detectIDFromURL(url) { const ids = [ { P: 'P818', type: 'arXiv', regex: /^https?:\/\/(?:([^.]+\.))?(?:arxiv\.org|xxx\.lanl\.gov)\/(?:pdf|abs)\/(?<id2>(?<id>(?:\d{4}\.\d{4,5}|[a-z\-]+(\.[A-Z]{2})?\/\d{7}))(?:v\d+)?)(?:\.pdf)?/i, doipre: '10.48550/arXiv.' }, { P: 'P819', type: 'bibcode', regex: /^https?:\/\/ui\.adsabs\.harvard\.edu\/abs\/(?<id>\d{4}[A-Za-z\.\&]{5}[\w\.]{4}[ELPQ-Z\.][\d\.]{4}[A-Z])(?:\/abstract)?/i }, { P: 'P3951', type: 'biorxiv', regex: /^https?:\/\/(?:www\.)?biorxiv\.org\/(?:content\/)?(?<dio>10\.1101\/(?<id>(?:\d{4}\.\d{2}\.\d{2}\.)?\d{6}))(?:v\d+)?(?:\.full)?(?:\.pdf)?/i }, { P: 'P894', type: 'zbMATH', regex: /^https?:\/\/zbmath\.org\/(?:\?(?:format=complete&)?(?:q=an:))?(?<id>[\d\.]+)/i }, { P: 'P888', type: 'jstor', regex: /^https?:\/\/(?:www\.)?jstor\.org\/(?:stable\/)?(?<id>[a-z0-9.\-_/]+)/i, doipre: '10.2307/' }, { P: 'P7896', type: 'Academia', regex: /^https?:\/\/(?:www\.)?academia\.edu\/(?:\w+\/)?(?<id>\d+)/i }, { P: 'P12914', type: 'mandumah', regex: /^https?:\/\/(?:search\.)?mandumah\.com\/(?:Record\/|Download\?file=[^#\?&]+&id=)(?<id>\d+)/i }, { P: 'P14250', type: 'eMarefa', regex: /^https?:\/\/(?:search\-emarefa\-net\.wikipedialibrary\.idm\.oclc\.org|search\.emarefa\.net)\/(?:ar|en)\/(?:detail|viewer)\/BIM\-(?<id>\d+)/i }, { P: 'P889', type: 'mathscinet', regex: /^https?:\/\/mathscinet\.ams\.org\/mathscinet(?:-getitem|\/relay-station)\?mr=(?<id>[1-9]\d{1,6})/i }, { P: 'P243', type: 'oclc', regex: /^https?:\/\/search\.worldcat\.org\/title\/(?<id>\d+)/i }, { P: 'P648', type: 'openlibrary', regex: /^https?:\/\/openlibrary\.org\/works\/(?<id>[^\/]+)/i }, { P: 'P3894', type: 'osti', regex: /^https?:\/\/www\.osti\.gov\/biblio\/(?<id>\d+)/i }, { P: 'P932', type: 'PMC', regex: /^https?:\/\/pmc\.ncbi\.nlm\.nih\.gov\/articles\/PMC(?<id>\d+)/i }, { P: 'P698', type: 'PubMed', regex: /^https?:\/\/pubmed\.ncbi\.nlm\.nih\.gov\/(?<id>\d+)/i }, { P: 'P892', type: 'rfc', regex: /^https?:\/\/datatracker\.ietf\.org\/doc\/html\/rfc(?<id>\d+)/i }, { P: 'P893', type: 'ssrn', regex: /^https?:\/\/(?:(?:papers\.)?ssrn\.com\/(?:sol3\/papers\.cfm\?abstract_id|abstract)|download\.ssrn\.com\/[^\s]+&abstractId)=(?<id>\d+)$/i }, { P: 'P4011', type: 's2pid', regex: /^https?:\/\/(?:www\.)?semanticscholar\.org\/paper(?:\/[^\s\/]+)?\/(?<id>[a-f0-9]{40})$/i }, { P: 'P675', type: 'Google Books', regex: /^https?:\/\/(?:books\.google\.com\/books\?id=|www.google.com\/books\/edition\/[^\s\/]+\/)(?<id>[0-9A-Za-z_\-]{12})(?:\?hl=[a-z]+&gbpv=(?<vol>\d+))?/i }, { P: 'P5875', type: 'ResearchGate', regex: /^https?:\/\/(?:www\.)?researchgate\.net\/publication\/(?<id>[1-9]\d*)(?:_[\w\-\_']+)?/i }, ]; for (const idType of ids) { if (idType.regex) { const match = url.match(idType.regex); if (match) { let ret = { P: idType.P, type: idType.type , url: url}; for (const [name, value] of Object.entries(match.groups || {})) { if (value!==undefined) ret[name] = value; } if (idType.doipre && ret.id) { ret.doi = idType.doipre + ret.id; } return ret; } } } return null; } // fetch shamela data function fetch_shamela(search, qid = null) { let txt = "" if (!qid) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + "|expand=json}}" } else { for (let i = 0; i < qid.length; i++) { txt += "{{استشهاد بالشاملة|" + search.replace("=", "{{=}}") + `|qid=${qid[i]}` + "|expand=json}}"; if (i < qid.length - 1) { txt += ","; } } } let params = { action: "expandtemplates", text: txt, prop: "wikitext", format: "json" } return new mw.Api({ userAgent: gadgetAgent }).get(params); } // fetch shamela data async function refetch_shamela(search) { let ret = await fetch_shamela(search); ret = JSON.parse("[" + ret.expandtemplates.wikitext + "]"); if (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات" && /https:\/\/(shamela.ws|app.turath.io)\/book\//.test(search)) { console.log("AutoCiteWikidata: Initial Shamela lookup failed, attempting enhanced lookup using QID"); try { // Extract book_id from URL var book_id = search.match(/https:\/\/(shamela.ws|app.turath.io)\/book\/([0-9]+)/)[2]; // Get QIDs from wikidata var Qids = await getQID("P12239", book_id); if (Qids.length > 0) { // Refetch with the QID var retryResults = await fetch_shamela(search, Qids); ret = JSON.parse('[' + retryResults.expandtemplates.wikitext + ']'); } } catch (error) { console.error('Error in enhanced error handling:', error); } } return ret; } // Get QID from wikidata async function getQID(Pid, val, doi) { let searchValue = Array.isArray(val) ? 'haswbstatement:' + val.map(v => `${Pid}=${v}`).join('|') : `haswbstatement:${Pid}=${val}`; if (doi) { searchValue += `|P356=${doi}`; } let data = await wdapi.get({ action: 'query', list: 'search', srsearch: searchValue, format: "json" }); if (data.query && Array.isArray(data.query.search) && data.query.search.length > 0) { return data.query.search.map(item => item.title); } return []; } // get volume data from wikidata async function getVolumeData(Qid, volurl, Pid = 'P953') { console.log("AutoCiteWikidata: Fetching volume data from Wikidata for QID:", Qid, "and volume URL:", volurl); const resp = await wdapi.get({ action: 'wbgetentities', ids: Qid, props: 'claims', format: 'json' }); const entity = resp && resp.entities && resp.entities[Qid]; const claims = (entity && entity.claims) || {}; volcount = claims['P2635'] && claims['P2635'][0].mainsnak && claims['P2635'][0].mainsnak.datavalue ? parseInt(claims['P2635'][0].mainsnak.datavalue.value.amount) : null; wdvols = (claims[Pid] || []).map(s => { let wdurl = s.mainsnak && s.mainsnak.datavalue && s.mainsnak.datavalue.value; if (wdurl.indexOf(volurl) === 0 && s.qualifiers) { let qvol = s.qualifiers['P478'] && s.qualifiers['P478'][0].datavalue && s.qualifiers['P478'][0].datavalue.value ? s.qualifiers['P478'][0].datavalue.value : null; let qpageoffest = s.qualifiers['P8330'] && s.qualifiers['P8330'][0].datavalue && s.qualifiers['P8330'][0].datavalue.value ? parseInt(s.qualifiers['P8330'][0].datavalue.value.amount) : 0; return { vol: qvol, pageoffset: qpageoffest, volcount: volcount }; } return null; }).filter(v => v !== null); return wdvols.length > 0 ? wdvols[0] : {}; } // create template object function createTemplate(args) { const paramsObj = {}; for (const k in args) { if (Object.prototype.hasOwnProperty.call(args, k)) { paramsObj[k] = { wt: String(args[k]) }; } } return { template: { target: { href: "Template:استشهاد بويكي بيانات", wt: "استشهاد بويكي بيانات" }, params: paramsObj } }; } // fetch archive data async function fetch_archive(search) { const regex = /^https?:\/\/archive.org\/details\/([^\/]+)(?:\/([^\/]+))?(?:\/page\/([^\/]+))?(?:\/mode\/([12])up)?$/ const m = search.match(regex) if (!m) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } const identifier = m[1]; const vol = m[2] || null; const page = m[3] || null; const mode = parseInt(m[4]) || 1; const parseArabicNum = str => parseInt(str.replace(/[٠-٩۰-۹]/g, d => d.charCodeAt(0) & 15 )); const Qids = await getQID("P724", identifier); console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata for archive.org identifier:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { const qid = Qids[i]; let args = { 'qid': qid, 'المسار': realsearch }; let wdpageoffset = 0; if (vol || (page && page.startsWith('n'))) { let volurl = realsearch.replace(/(?:\/page\/[^\/ ]+)?(?:\/mode\/[12]up)/, ''); wdvoldata = await getVolumeData(qid, volurl); console.log("AutoCiteWikidata: Retrieved volume data from Wikidata:", wdvoldata); let wdvol = wdvoldata.vol !== undefined ? wdvoldata.vol : null; wdpageoffset = wdvoldata.pageoffset !== undefined ? wdvoldata.pageoffset : 0; const volcount = wdvoldata.volcount !== undefined ? wdvoldata.volcount : null; if (vol && !wdvol && volcount && volcount > 1) { let intvol = parseInt(vol); if (!intvol) { let mvol = vol.match(/^\d+/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null if (!intvol) { mvol = vol.match(/\d+$/); intvol = mvol.length > 0 && mvol[0].length < 3 && parseInt(mvol[0]) || null } } wdvol = intvol === 0 && vol.match(/p$/) ? 'المقدمة' : intvol ? intvol : vol; } if (wdvol) args['ج'] = wdvol; } if (page) { args['ص'] = (page.startsWith('n') && page.length > 1 ) ? (parseInt(page.substring(1)) + 1 - wdpageoffset) : parseArabicNum(page) || page; } ret.push(createTemplate(args)); if (mode === 2) { args['ص'] = args['ص'] ? (parseInt(args['ص']) + 1).toString() : '2'; ret.push(createTemplate(args)); } } return ret; } async function fetchByURL(realsearch) { return getQID('P953', realsearch).then(async Qids => { console.log("AutoCiteWikidata: Retrieved QIDs from Wikidata:", Qids); if (Qids.length == 0) { return [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } let ret = []; for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] , 'المسار': realsearch, }; wdvoldata = await getVolumeData(Qids[i], realsearch); if (wdvoldata.vol) { args['ج'] = wdvoldata.vol; } ret.push(createTemplate(args)); } return ret; }); } // We have to first set up a get response so we can have // a proper xhr object with "abort" method, so we can // hand off this abort method to the jquery promise let citoidXhr, citoidRequest; try { citoidRequest = (async function() { let ret = []; console.log("AutoCiteWikidata: Starting lookup for KID:", KID); if (KID) { let KIDids = KID.id2 ? [KID.id, KID.id2] : [KID.id]; const Qids = await getQID(KID.P, KIDids, KID.doi); if (Qids.length == 0) { ret = [{ error: "لم يعثر على بيانات الكتاب في ويكي بيانات" }]; } for (let i = 0; i < Qids.length; i++) { let args = { 'qid': Qids[i] }; if (KID.url !== undefined) args.url = KID.url; if (KID.vol !== undefined) args.vol = KID.vol; ret.push(createTemplate(args)); } } else if (isArchive) { ret = await fetch_archive(search); } else if (isShamela || isShamelaTxt) { ret = await refetch_shamela(search); } if (isURI && (ret.length === 0 || (ret[0].error && ret[0].error == "لم يعثر على بيانات الكتاب في ويكي بيانات"))) { ret = await fetchByURL(realsearch); } return ret; })(); citoidXhr = citoidRequest; } catch (e) { console.error("AutoCiteWikidata: Error during lookup:", e); return inspector._performLookup(); } // Ensure compatibility: if `citoidXhr` is a native Promise, wrap it // into a jQuery-compatible promise so callers can use `.always()` and // `.promise({ abort: ... })` like the original code expects. let jqCitoidXhr; if (citoidXhr && typeof citoidXhr.always === 'function' && typeof citoidXhr.promise === 'function') { jqCitoidXhr = citoidXhr; } else { const deferred = $.Deferred(); // Bridge native promise to jQuery Deferred if (citoidXhr && typeof citoidXhr.then === 'function') { citoidXhr.then(function (res) { deferred.resolve(res); }, function (err) { deferred.reject(err); }); } else { // If it's not thenable, resolve immediately with the value deferred.resolve(citoidXhr); } jqCitoidXhr = deferred.promise(); } inspector.lookupPromise = jqCitoidXhr .then( // Success function (rData) { // Normal template building logic (for both original success and retry success) if (Array.isArray(rData) && rData.length === 0) { console.log("AutoCiteWikidata: No data found"); return inspector._performLookup(); } else if (rData[0].error) { console.log("AutoCiteWikidata: Error - " + rData[0].error); // mw.notify(rData[0].error, { title: 'استشهاد آلي', type: 'error' }); return inspector._performLookup(); } else { // buildTemplateResults const renderPromises = [], partPromises = []; rData.forEach((citation) => { const templateName = citation.template.target.wt; const transclusionModel = new ve.dm.MWTransclusionModel(); const result = { templateName: templateName, template: ve.dm.MWTemplateModel.newFromName(transclusionModel, templateName), transclusionModel: transclusionModel }; inspector.results.push(result); partPromises.push( result.transclusionModel.addPart(result.template) .then(function () { for (let param in citation.template.params) { result.template.addParameter( new ve.dm.MWParameterModel( result.template, param, citation.template.params[param].wt ) ); }; }) ); }); return ve.promiseAll(partPromises) .then(() => { const sources = [], optionWidgets = []; // Create option widgets inspector.results.forEach((result, i) => { const refWidget = new ve.ui.CitoidReferenceWidget( inspector.getFragment().getSurface().getDocument(), result.transclusionModel, { data: i, templateName: result.templateName, citeTools: ve.ui.mwCitationTools }); const template = result.template; // T92428: Ignore empty templates if (ve.isEmptyObject(template.getParameters())) { return; } // sources.push(result.source); // source may be undefined or Array of strings optionWidgets.push(refWidget); renderPromises.push(refWidget.getRenderPromise()); }); if (optionWidgets.length > 0) { // Add citations to the select widget inspector.previewSelectWidget.addItems(optionWidgets); inspector.credit.setLabel( ve.msg( 'citoid-citoiddialog-credit', 'Wikidata' ) ); inspector.previewSelectWidget.$element.append( inspector.credit.$element ); return ve.promiseAll(renderPromises).then(() => { inspector.setModePanel('auto', 'result', false, {}); }, () => { inspector.lookupFailed(); return $.Deferred().resolve(); }); } // failed, so go back return $.Deferred().reject(); }); // End buildTemplateResults } }, // Fail (type, response) => { if (response && response.textStatus === 'abort') { return $.Deferred().reject(); } inspector.lookupFailed(); // Restore focus to the input field. // Definitely don't do this on success and focusing a hidden input causes jQuery // to prevent it from being focused the next time the inspector is opened (T285626) inspector.lookupInput .setDisabled(false).focus(); return $.Deferred().resolve(); }) .always(() => { inspector.lookupInput .setDisabled(false) .popPending(); inspector.lookupButton.setDisabled(false); }) .promise({ abort: () => { if (citoidRequest && citoidRequest.abort) { citoidRequest.abort(); } if (citoidXhr && citoidXhr.abort) { citoidXhr.abort(); } } }); return inspector.lookupPromise; }; }); lk4jd368mtr0p7lu65nig2wb3z6ps0j cuckoo for Cocoa Puffs 0 237541 1089674 2026-04-28T14:42:18Z Col923 38671 أنشأ الصفحة ب'==إنجليزي== ===أصل الكلمة=== العبارة الشهيرة لـ "سوني طائر الوقواق" — التميمة الكرتونية لحبوب الإفطار "كوكوا بافس" (Cocoa Puffs) من إنتاج شركة "جنرال ميلز" — هي: "أفقد صوابي من أجل كوكوا بافس!" ===صفة=== # مجنون، معتوه، غير عقلاني' 1089674 wikitext text/x-wiki ==إنجليزي== ===أصل الكلمة=== العبارة الشهيرة لـ "سوني طائر الوقواق" — التميمة الكرتونية لحبوب الإفطار "كوكوا بافس" (Cocoa Puffs) من إنتاج شركة "جنرال ميلز" — هي: "أفقد صوابي من أجل كوكوا بافس!" ===صفة=== # مجنون، معتوه، غير عقلاني stcvdxrh7gn38xlpnvy8jbpjmbiciwr وحدة:Wikibase 828 237542 1089675 2026-04-28T14:45:51Z حبيشان 31560 استيراد من ar.wikipedia.org 1089675 Scribunto text/plain ---------- Module:Wikibase ---------------- local p = {} function p.getEntityObject(id) if not mw.wikibase then return nil end entity = mw.wikibase.getEntityObject(id) return entity end -- Return the item ID of the item linked to the current page. function p.id(frame) if not mw.wikibase then return nil end entity = mw.wikibase.getEntityObject() if entity == nil then return "no entity" end return entity.id end -- Return the label of a given data item, or of connected page -- if no argument is provided to this method. function p.label(frame) if not mw.wikibase then return nil end if frame.args[1] == nil then entity = mw.wikibase.getEntityObject() if not entity then return nil end id = entity.id else id = mw.text.trim(frame.args[1]) end return mw.wikibase.label( id ) end -- Return the description of a given data item, or of connected page -- if no argument is provided to this method. function p.description(frame) if not mw.wikibase then return nil end if frame.args[1] == nil then entity = mw.wikibase.getEntityObject() if not entity then return nil end id = entity.id else id = mw.text.trim(frame.args[1]) end return mw.wikibase.description( id ) end -- Return the local page about a given data item, or of connected page -- if id is not specified. function p.page(frame) if not mw.wikibase then return nil end if frame.args[1] == nil then entity = mw.wikibase.getEntityObject() if not entity then return nil end id = entity.id else id = mw.text.trim(frame.args[1]) end return mw.wikibase.sitelink( id ) end -- Return the data type of a property function p.datatype(frame) if not mw.wikibase then return nil end if frame.args[1] and string.find(frame.args[1], "Property:P") then if mw.wikibase.getEntityObject(string.gsub(frame.args[1], "Property:P", "P")) then return mw.wikibase.getEntityObject(string.gsub(frame.args[1], "Property:P", "P") ).datatype end elseif frame.args[1] and string.find(frame.args[1], "P") then if mw.wikibase.getEntityObject(frame.args[1]) then return mw.wikibase.getEntityObject(frame.args[1]).datatype end end end return p 96eb1mk86uyvzsnoeay9i6mq1j08vgx وحدة:Wikibase/شرح 828 237543 1089676 2026-04-28T14:45:52Z حبيشان 31560 استيراد من ar.wikipedia.org 1089676 wikitext text/x-wiki هذه الوحدة تم نسخها من المثال من صفحة توثيق الوحدة في [[mw:Extension:Wikibase Client/Lua]]. ويجب أن تبقى متسقة مع تلك الصفحة. == الاستخدام == ; معرف : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''id''' }}</code> ; تسمية : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''label''' }}</code> : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''label''' | ''entity id (Q# or P#)'' }}</code> ; وصف : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''description''' }}</code> : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''description''' | ''entity id (Q# or P#)'' }}</code> ; صفحة : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''page''' }}</code> : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''page''' | ''item id (Q#)'' }}</code> ; نوع البيانات : <code><nowiki>{{</nowiki>#invoke: {{BASEPAGENAME}} | '''datatype''' | ''property id (P#)'' }}</code> == أمثلة == === معرف === * <code><nowiki>{{#invoke:Wikibase | id }}</nowiki></code> ينتج ← {{#invoke:Wikibase | id }} === تسمية === * <code><nowiki>{{#invoke:Wikibase | label }}</nowiki></code> ينتج ← {{#invoke:Wikibase | label }} * <code><nowiki>{{#invoke:Wikibase | label | Q132689 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | label | Q132689 }} * <code><nowiki>{{#invoke:Wikibase | label | P31 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | label | P31 }} === وصف === * <code><nowiki>{{#invoke:Wikibase | description }}</nowiki></code> ينتج ← {{#invoke:Wikibase | description }} * <code><nowiki>{{#invoke:Wikibase | description | Q132689 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | description | Q132689 }} * <code><nowiki>{{#invoke:Wikibase | description | P31 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | description | P31 }} === صفحة === * <code><nowiki>{{#invoke:Wikibase | page }}</nowiki></code> ينتج ← {{#invoke:Wikibase | page }} * <code><nowiki>{{#invoke:Wikibase | page | Q132689 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | page | Q132689 }} === نوع البيانات === {{أيضا| wikidata:Help:Data type}} {{أيضا| wikidata:Special:ListDatatypes }} {{int:datatypes-type-commonsMedia}}: {{خاصية|18}} * <code><nowiki>{{#invoke:Wikibase | datatype | P18 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P18 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P18 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P18 }} {{int:datatypes-type-globe-coordinate}}: {{خاصية|625}} * <code><nowiki>{{#invoke:Wikibase | datatype | P625 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P625 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P625 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P625 }} {{int:datatypes-type-wikibase-item}}: {{خاصية|6}} * <code><nowiki>{{#invoke:Wikibase | datatype | P6 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P6 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P6 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P6 }} {{int:datatypes-type-wikibase-property}}: {{خاصية|1647}} * <code><nowiki>{{#invoke:Wikibase | datatype | P1647 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P1647 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P1647 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P1647 }} {{int:datatypes-type-string}}: {{خاصية|225}} * <code><nowiki>{{#invoke:Wikibase | datatype | P225 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P225 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P225 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P225 }} {{int:datatypes-type-monolingualtext}}: {{خاصية|1448}} * <code><nowiki>{{#invoke:Wikibase | datatype | P1448 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P1448 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P1448 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P1448 }} {{int:datatypes-type-quantity}}: {{خاصية|1082}} * <code><nowiki>{{#invoke:Wikibase | datatype | P1082 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P1082 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P1082 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P1082 }} {{int:datatypes-type-time}}: {{خاصية|569}} * <code><nowiki>{{#invoke:Wikibase | datatype | P569 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P569 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P569 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P569 }} {{int:datatypes-type-url}}: {{خاصية|856}} * <code><nowiki>{{#invoke:Wikibase | datatype | P856 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P856 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P856 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P856 }} {{int:datatypes-type-math}}: {{خاصية|2534}} * <code><nowiki>{{#invoke:Wikibase | datatype | P2534 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P2534 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P2534 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P2534 }} {{int:datatypes-type-external-id}}: {{خاصية|212}} * <code><nowiki>{{#invoke:Wikibase | datatype | P212 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | P212 }} * <code><nowiki>{{#invoke:Wikibase | datatype | Property:P212 }}</nowiki></code> ينتج ← {{#invoke:Wikibase | datatype | Property:P212 }} <includeonly>{{#ifeq:{{SUBPAGENAME}}|ملعب|| <!-- Categories go here: --> [[تصنيف:وحدات ويكي بيانات]] [[تصنيف:وحدات تستخدم بيانات من ويكي بيانات]] }}</includeonly> 7h3txz4dd9bjlcrh90o7oyzjs09xajp قالب:وصلة خاصية ويكي بيانات 10 237544 1089677 2026-04-28T14:46:56Z حبيشان 31560 استيراد من ar.wikipedia.org 1089677 wikitext text/x-wiki <includeonly>{{#switch:{{str left|{{uc:{{{id|}}}}}|1}} | N <!--none--> = {{#switch:{{str left|{{uc:{{{1|}}}}}|1}} | P = [[d:Special:EntityPage/{{uc:{{{1|}}}}}|{{ويكي بيانات|label|{{uc:{{{1|}}}}}}}]] | [[d:Special:EntityPage/P{{uc:{{{1|}}}}}|{{ويكي بيانات|label|P{{uc:{{{1|}}}}}}}]] }} | O <!--only--> = {{#switch:{{str left|{{uc:{{{1|}}}}}|1}} | P = [[d:Special:EntityPage/{{uc:{{{1|}}}}}|{{uc:{{{1|}}}}}]] | [[d:Special:EntityPage/P{{uc:{{{1|}}}}}|P{{uc:{{{1|}}}}}]] }} | F <!--first--> = {{#switch:{{str left|{{uc:{{{1|}}}}}|1}} | P = [[d:Special:EntityPage/{{uc:{{{1|}}}}}|{{uc:{{{1|}}}}}]]{{#if:{{ويكي بيانات|label|{{uc:{{{1|}}}}}}}|&#58; <small>{{ويكي بيانات|label|{{uc:{{{1|}}}}}}}</small>}} | [[d:Special:EntityPage/P{{uc:{{{1|}}}}}|P{{uc:{{{1|}}}}}]]{{#if:{{ويكي بيانات|label|P{{uc:{{{1|}}}}}}}|&#58; <small>{{ويكي بيانات|label|P{{uc:{{{1|}}}}}}}</small>}} }} | #default = {{#switch:{{str left|{{uc:{{{1|}}}}}|1}} | P = [[d:Special:EntityPage/{{uc:{{{1|}}}}}|{{ويكي بيانات|label|{{uc:{{{1|}}}}}}} <small>({{uc:{{{1|}}}}})</small>]] | [[d:Special:EntityPage/P{{uc:{{{1|}}}}}|{{ويكي بيانات|label|P{{uc:{{{1|}}}}}}} <small>(P{{uc:{{{1|}}}}})</small>]] }} }}</includeonly><noinclude>{{توثيق}}</noinclude> tlx0e3mgvqeqttx3ffpqgob4pp6rt76 قالب:وصلة خاصية ويكي بيانات/شرح 10 237545 1089678 2026-04-28T14:46:58Z حبيشان 31560 استيراد من ar.wikipedia.org 1089678 wikitext text/x-wiki {{صفحة توثيق فرعية}} {{Lua|Module:Wikibase}} == مثال == *<code><nowiki>{{خاصية|31}}</nowiki></code>: {{خاصية|31}} *<code><nowiki>{{خاصية|P31}}</nowiki></code>: {{خاصية|P31}} <includeonly> [[تصنيف:قوالب ويكي بيانات]] </includeonly> 1a8sf4zmar9ftoyc1fftju9dnqirflg قالب:خاصية 10 237546 1089679 2026-04-28T14:47:26Z حبيشان 31560 استيراد من ar.wikipedia.org 1089679 wikitext text/x-wiki #تحويل [[قالب:وصلة خاصية ويكي بيانات]] 2vkkx2pyhrln19hhfg4s2ier4udv3pc قالب:خاصية/شرح 10 237547 1089680 2026-04-28T14:47:28Z حبيشان 31560 استيراد من ar.wikipedia.org 1089680 wikitext text/x-wiki #تحويل [[قالب:وصلة خاصية ويكي بيانات/شرح]] l9jtwzs9bgq5q3d5dsvkc9l1i4f208w قالب:P 10 237548 1089681 2026-04-28T14:48:25Z حبيشان 31560 استيراد من ar.wikipedia.org 1089681 wikitext text/x-wiki #تحويل [[قالب:وصلة خاصية ويكي بيانات]] {{تحويلة قالب من لغات بديلة}} avonbfevo6f8k2jqawbwi4z48pga3di ميدياويكي:Gadget-SettingsManager.js 8 237549 1089682 2026-04-28T14:51:32Z حبيشان 31560 مستوردة ويكيبيديا العربية 1089682 javascript text/javascript /** * [[:commons:MediaWiki:Gadget-SettingsManager.js]] * Managing user preferences of scripts * Managing gadgets and gadget preferences * * Use it for good, not for evil. * * @author Rillke, 2012 * @license GPL v.3 * <nowiki> */ // List the global variables for jsHint-Validation. // Scheme: globalVariable:allowOverwriting[, globalVariable:allowOverwriting][, globalVariable:allowOverwriting] /*global jQuery:false, mediaWiki:false*/ // Set jsHint-options. /*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:false, browser:true*/ ( function ( $, mw ) { "use strict"; /** * Refresh edit token * * @example * refreshToken( function() { doGoodStuff.retry(); } ); * * @param cb {Function} Callback function. The first argument supplied is whether the operation succeeded. * @context {closure} private function * @return {Object} a jQuery deferred-object-queue */ var refreshToken = function(cb) { var mwa = new mw.Api(), apiDef = mwa.get( { action: 'query', meta: 'tokens', type: 'csrf' } ); apiDef.done(function(result) { if (!result.query || !result.query.tokens) return cb( false, 'wrong-response' ); mw.user.tokens.set( 'csrfToken', result.query.tokens.csrftoken ); cb( true ); }); apiDef.fail(function(code, result) { if (!result.query || !result.query.tokens) return cb( false, code ); }); return apiDef; }; var firstItem = function(o) { for (var i in o) { if (o.hasOwnProperty( i )) { return o[i]; } } }; var valByString = function(identifier) { var arr = identifier.split( '.' ), lenArr = arr.length, i, elemArr, objCurrent = window; for (i = 0; i < lenArr; i++) { elemArr = arr[i]; objCurrent = objCurrent[elemArr]; } return objCurrent; }; var mwPrefPrefix = 'userjs-sm-'; var sm = { version: '0.1.0.1', errorPrefix: "SettingsWizard encountered a problem. We regret the inconvenience. ", /** * Constructor-method. Returns an option-object you should perform the actions on. * * @example * var opt = mw.libs.settingsManager.option( { optionName: 'CatALotOptions', value: { watchCopy: false, watchRemove: false } } ); * // Save the options we've set before and make the script triggering events on the document, you can listen to * opt.save( $(document), 'CatALotSaveProgress' ); * // or, use the deferred-object returned: * opt.save().done(function(msg, status, jsFile) { * alert( msg ); * }).status(function(msg, status, jsFile) { * console.log( 'settings progress>' + msg ); * }); * * @param specsIn {Object} specifications passed in. List of defaults (cf. specs) follows. * @context {mw.libs.settingsManager} * @return {Object} option-object you can use for performing actions on. */ option: function(specsIn) { // List of defaults: var specs = { // The global name the option will be saved under // This can be also something like "mw.settingsOfToolX" optionName: '', // The position where to save them. By default options are // saved at the user's common.js or <skin>.js (e.g. vector.js) // specify other locations like "settingsOfToolX" --> "User:Example/prefs/settingsOfToolX.js" saveAt: false, // By default the option is not enclosed in a comment-block // Comment-blocks are recommended for larger configurations // specifies the signature that will be used for the enclosing comments // blockSettingsOfToolX --> //blockSettingsOfToolX/////////////////////// // (ignored when saveAt is set) encloseSignature: false, // Specify additional block comments added below the signature // Should be something that explains what the following JSON does or is good for // Recommended line-length for consistent alignment: 48 chars encloseBlock: false, // If no own location for saving the option is used (options that must be // available while loading the script should not be saved to a separate file while // complex options should), if the RegExp will have a match on either the common.js // or the <skin>.js, and this option is not saved yet to another .js, the option // will be saved to this js-file. In case the option is not saved yet and there is // no RegExp supplied or it did not match, the option will be saved to the larger // JavaScript triggerSaveAt: false, // Should the new content be insered in front of the match by triggerSaveAt // If none of the following options is specified, the new content // will be appended to the script insertBeforeTrigger: false, insertAfterTrigger: false, replaceTrigger: false, // Finally the option's value. Objects are possible. They will be automatically // transformed into a JSON-string value: undefined, // Edit summary to use while saving the JavaScript editSummary: "" }; if (!specsIn) throw new Error(sm.errorPrefix + "Data to save or retrieve was not supplied by the script using SettingsWizard."); if (!specsIn.optionName && !specsIn.saveAt) throw new Error(sm.errorPrefix + "The options\'s name was not supplied by the script using SettingsWizard."); $.extend( true, specs, specsIn ); // Prepare variables we need later var nsUser = mw.config.get('wgFormattedNamespaces')[2], skin = mw.config.get('skin'), user = mw.config.get('wgUserName'), skinJS = [nsUser, ':', user, '/', skin, '.js'].join(''), commonJS = [nsUser, ':', user, '/','common', '.js'].join(''); // Event-handler system var $el, evt, jsFiles, process, $progress = new $.Deferred(), customJS; var triggerEvt = function(any) { return (evt && $el && $el instanceof jQuery && $el.triggerHandler( evt, Array.prototype.slice.call( arguments, 0 ) )); }; process = { updateVars: function() { // Reset variables that could be polluted jsFiles = []; $progress = new $.Deferred(); customJS = [nsUser, ':', user, '/prefs/', specs.saveAt, '.js'].join(''); }, start: function() { this.updateVars(); // Subscribe to any event: We want to know everything :-) $progress.then( triggerEvt, triggerEvt, triggerEvt ); // Always async setTimeout( $.proxy( this.getScripts, this ), 1 ); return $progress; }, getScripts: function() { var i, len; $progress.notify( "Preparing", 1 ); // First, we need something to work on/ edit token, etc. - request the JavaScript(s) if (specs.saveAt) { jsFiles.push( sm.script( customJS ) ); } else { jsFiles.push( sm.script( skinJS ) ); jsFiles.push( sm.script( commonJS ) ); } len = jsFiles.length; for (i = 0; i < len; i++) { var jsFile = jsFiles[i]; jsFile.fetchText( process.gotJS, process.gotJSErr ); $progress.notify( "Requesting " + jsFile.getSource(), Math.round( (i+1)*(9/len) ) + 1, jsFile ); } return $progress; }, gotJS: function(jsFile, r){ jsFile.gotContent = true; var i, len = jsFiles.length, pendings = 0; for (i = 0; i < len; i++) { if (!jsFiles[i].gotContent) { pendings++; } } $progress.notify( "Got " + jsFile.getSource() + '. File length: ' + jsFile.get().length + ' characters.' , Math.round( (len - pendings)*(9/len) ) + 10, jsFile ); if (pendings) return; process.process(); }, gotJSErr: function(jsFile) { $progress.reject( "Failed. Could not retrieve " + jsFile.getSource(), -1, jsFile ); }, getStartBlock: function(sig) { // String concat is sloooow return '//' + sig + new Array(48 - 2 - sig.length + 1).join('/'); }, getEndBlock: function(sig) { return new Array(48 - 2 - 3 - sig.length + 1).join('/') + sig + 'End' + '//'; }, getBlockRegExp: function(sig) { var escSig = process.escapeRE(sig); return new RegExp('\\n?\\n?\\/\\/' + escSig + '(?:.|\\n)*' + escSig + 'End\\/\\/', 'g'); }, escapeRE: function(string) { string = mw.util.escapeRegExp(string); var specials = ['t', 'n', 'v', '0', 'f']; $.each(specials, function(i, s) { var rx = new RegExp('\\'+s, 'g'); string = string.replace(rx, '\\'+s); }); return string; }, getVariableRegExp: function(varName) { var escVar = process.escapeRE(varName); return { varRE: new RegExp('\\s*(?:var\\s+|window\\.)?' + escVar + '\\s*=.+', 'g'), // Throw a warning if the last char of the line is a "+" , "{", "(" or "," varWarnRE: new RegExp('\\s*(?:var\\s+|window\\.)?' + escVar + '\\s*=.+(?:\\n?\\s*[\\,\\+\\{\\(])\\s*\\n') }; }, process: function() { var JSONVal = JSON.stringify( specs.value ), sig = specs.encloseSignature, tsa = specs.triggerSaveAt, opn = specs.optionName, jsFile, i, len = jsFiles.length, plainJSON = !opn && !!jsFile, oldText, newText, hadMatch; if (opn) { // No semicolon for valid JSON! JSONVal = 'window.' + opn + ' = ' + JSONVal + ';'; } if (!plainJSON) JSONVal = ((specs.encloseBlock && ('\n' + specs.encloseBlock)) || '') + JSONVal; if (sig && !plainJSON) JSONVal = process.getStartBlock( sig ) + JSONVal + '\n' + process.getEndBlock( sig ); JSONVal = '\n\n' + JSONVal; // Fine, we've constructed everything we'll need. Now look up where to insert. // Looking for signature if (sig) { var reBl = process.getBlockRegExp( sig ); for (i = 0; i < len; i++) { jsFile = jsFiles[i]; oldText = jsFile.get(); newText = oldText.replace( reBl, JSONVal ); if (reBl.test( oldText )) { $progress.notify( "Replacing text enclosed by signature " + jsFile.getSource(), 25, jsFile ); process.save( jsFile.set( newText ) ); hadMatch = true; } } } if (hadMatch) return; // Looking for variable-name if (opn) { var vre = process.getVariableRegExp( opn ), warnFile; for (i = 0; i < len; i++) { jsFile = jsFiles[i]; oldText = jsFile.get(); if (vre.varWarnRE.test(oldText)) { // WARNING!!! $progress.notify( "Unable to remove config from " + jsFile.getSource(), -2, jsFile ); warnFile = jsFile; } else { newText = oldText.replace( vre.varRE, JSONVal ); if (vre.varRE.test( oldText )) { $progress.notify( "Replacing variable " + jsFile.getSource(), 25, jsFile ); process.save( jsFile.set( newText ) ); hadMatch = true; } } // Only append in case of warning if it was not added to another file if (warnFile && !hadMatch) { $progress.notify( "Appending variable after warning to " + jsFile.getSource(), 25, jsFile ); process.save( warnFile.set( oldText + JSONVal ) ); hadMatch = true; } } } if (hadMatch) return; // If it's just JSON, replace the whole thingy if (!opn && specs.saveAt) { jsFile = jsFiles[0]; $progress.notify( "Replacing whole content of " + jsFile.getSource(), 25, jsFile ); process.save( jsFile.set( JSONVal ) ); hadMatch = true; } if (hadMatch) return; // Looking whether supplied RegExp can find something if (tsa) { var searchMatch, triggerLen = 0; for (i = 0; i < len; i++) { jsFile = jsFiles[i]; oldText = jsFile.get(); searchMatch = oldText.search( tsa ); if (-1 !== searchMatch) { if (specs.insertBeforeTrigger) { $progress.notify( "Inserting before pattern in " + jsFile.getSource(), 25, jsFile ); jsFile.set( oldText.slice( 0, searchMatch ) + JSONVal + oldText.slice( searchMatch ) ); } else if (specs.insertAfterTrigger) { triggerLen = oldText.match( tsa )[0].length; $progress.notify( "Inserting after pattern in " + jsFile.getSource(), 25, jsFile ); jsFile.set( oldText.slice( 0, searchMatch + triggerLen ) + JSONVal + oldText.slice( searchMatch + triggerLen ) ); } else if (specs.replaceTrigger) { $progress.notify( "Replacing pattern with new content in " + jsFile.getSource(), 25, jsFile ); jsFile.set( oldText.replace( tsa, JSONVal ) ); } else { $progress.notify( "Found pattern, appending to " + jsFile.getSource(), 25, jsFile ); jsFile.set( oldText + '\n//<nowiki>' + JSONVal + '\n//<\/nowiki>' ); } process.save( jsFile ); hadMatch = true; break; } } } if (hadMatch) return; // Finally compare file size var biggest = { size: 0, jsFile: null }; for (i = 0; i < len; i++) { jsFile = jsFiles[i]; oldText = jsFile.get(); var oldTextLen = oldText.length; if (oldTextLen >= biggest.size) biggest = { size: oldTextLen, jsFile: jsFile }; } $progress.notify( "Appending to bigger file: " + biggest.jsFile.getSource(), 25, biggest.jsFile ); biggest.jsFile.set( biggest.jsFile.get() + '\n//<nowiki>' + JSONVal + '\n//<\/nowiki>' ); process.save( biggest.jsFile ); }, save: function(jsFile) { jsFile.saving = true; $progress.notify( "Saving " + jsFile.getSource(), 30, jsFile ); jsFile.save( process.saved, process.savedErr, "[[MediaWiki:Gadget-SettingsManager.js|SettingsManager]]: " + specs.editSummary ); }, saved: function(jsFile) { var i, len = jsFiles.length, jsf, waitingFor = []; jsFile.saving = false; for (i = 0; i < len; i++) { jsf = jsFiles[i]; if (jsf.saving) { waitingFor.push(jsf.getSource()); } } $progress.notify( "Saved " + jsFile.getSource() + ". Waiting for " + (waitingFor.join(', ') || '-'), Math.round( (len - waitingFor.length)*(20/len) ) + 50, jsFile ); if (waitingFor.length) return; $progress.resolve( "Success!", 100, jsFile ); }, savedErr: function(jsFile, code, errObj) { $progress.reject( "Error saving " + jsFile.getSource() + ". Code is " + code + ".\n", -1, errObj ); } }; return { getSpecs: function() { return specs; }, setSpecs: function(specsIn) { specs = specsIn; return this; }, // Warning: If you specified a different save-position ("saveAt") // and also an optionName, the script has to be fetched and evaluated // We recommend omitting setting "optionName" when using "saveAt" fetchValue: function(cb, errCb) { process.updateVars(); if (specs.saveAt) { var s = sm.script( customJS ); if (specs.optionName) { s.fetchText(function() { s.doEval(); cb( valByString( specs.optionName ) ); }, errCb); } else { s.fetchJSON(function(scriptObj, JSON) { cb( JSON ); }, errCb); } return this; } cb( valByString( specs.optionName ) ); return this; }, getValue: function() { return specs.value; }, setValue: function(val) { specs.value = val; return this; }, save: function($elem, event) { // We won't check whether the value is undefined. This is your task. $el = $elem; evt = event; return process.start(); }, getProgress: function() { return $progress; } }; }, /** * Constructor-method. Returns a script-object you should perform the actions on. * * @example * var commonJS = mw.libs.settingsManager.script( 'User:Example/common.js' ); * commonJS.set( '// empty!' ).setSummary( 'Removing Content' ).save( function() { console.log( 'Successfully removed content from ' + commonJS.getSource() ) } ) * * @param source {String} The name of the JavaScript file with namespace. * @context {mw.libs.settingsManager} * @return {Object} script-object you can use for performing actions on. */ script: function(source) { var content, page, token, summary = "Changing configuration using [[:commons:MediaWiki:Gadget-SettingsManager.js]]", minor = 1, exists, fetch, save; fetch = function() { var mwa = new mw.Api(); return mwa.get( { action: 'query', prop: 'info|revisions', titles: source, rvprop: 'timestamp|content', meta: 'tokens', type: 'csrf' } ); }; save = function() { var mwa = new mw.Api(), edit = { action: 'edit', title: source, text: 'object' === typeof content ? JSON.stringify(content) : content, summary: summary, watchlist: 'nochange', recreate: 1 }; if (minor) edit.minor = 1; if (exists) { edit.basetimestamp = page.revisions[0].timestamp; } else { edit.starttimestamp = page.starttimestamp; } edit.token = token; return mwa.post( edit ); }; return { get: function() { return content; }, getSource: function() { return source; }, doEval: function() { /*jshint evil:true */ return eval(content); }, parseJSON: function() { return ('string' === typeof content && content !== '') ? JSON.parse( content ) : ''; }, // Supplied callback called with a string as second argument fetchText: function(cb, errCb) { var pgs, pg, scriptObj = this; fetch().done( function(result) { pgs = result.query.pages; page = firstItem( pgs ); token = result.query.tokens.csrftoken; exists = !!(page.revisions && page.revisions[0]); content = (exists && page.revisions[0]['*']) || ''; cb( scriptObj, content ); } ).fail( function( status, errObj ) { errCb( scriptObj, status, errObj ); } ); return this; }, // Supplied callback called with parsed JSON-data as second argument fetchJSON: function(cb, errCb) { this.fetchText( function(scriptObj, content) { cb( scriptObj, scriptObj.parseJSON() ); }, function(scriptObj, status, errObj) { errCb( scriptObj, status, errObj ); } ); return this; }, set: function(newContent) { content = newContent; return this; }, setMinor: function(newMinor) { minor = !!newMinor; }, setSummary: function(newSummary) { summary = newSummary; }, save: function(cb, errCb, newSummary, newContent, newMinor) { var scriptObj = this; if (newContent !== undefined) content = newContent; if (newSummary !== undefined) summary = newSummary; if (newMinor !== undefined) minor = !!newMinor; save().done( function(result) { cb( scriptObj, result ); } ).fail( function(status, errObj) { errCb( scriptObj, status, errObj ); } ); return this; } }; }, /** * Switch a user preference using Ajax! * * @example * mw.libs.settingsManager.switchPref( 'myOption', 'new value' ); * * @param prefName {String} The name of the preference. * @param prefVal {String} The new value the preference should set to. * @param cb {Function} Callback in case of success. * @param cb {Function} Callback in case of an error. * @context {mw.libs.settingsManager} * @return {Object} a jQuery deferred-object-queue. Don't use it for error-handling - Done by this method. */ switchPref: function(prefName, prefVal, cb, errCb) { var mwa = new mw.Api(), args = arguments, prefString = (typeof prefVal === 'object') ? JSON.stringify(prefVal) : prefVal, apiDef = mwa.post( { action: 'options', token: mw.user.tokens.get('csrfToken'), optionname: prefName, optionvalue: prefString || 0 } ); // If we changed a preference successfully, update user.options reflecting the change apiDef.done( function() { mw.user.options.set( prefName, prefString ); } ); if (cb) apiDef.done( cb ); // Catch badtoken and some other common errors apiDef.fail( function(code, result) { switch (code) { case 'badtoken': refreshToken(function (gotANewToken) { if (gotANewToken) return sm.switchPref.apply( sm, Array.prototype.slice.call( args, 0 ) ); } ); // Stop the propagation of return false; case 'http': case 'ok-but-empty': setTimeout( function() { return sm.switchPref.apply( sm, Array.prototype.slice.call(args, 0) ); }, 2500 ); return false; default: return (errCb && errCb(code, result) && false); } } ); return apiDef; }, /** * Switch a gadget preference using Ajax! * * @example * mw.libs.settingsManager.switchGadgetPref( 'myOption', 'new value' ).done(function() { console.log("DONE!") }); * * @param prefName {String} The name of the preference. * @param prefVal {String} The new value the preference should set to. * @context {mw.libs.settingsManager} * @return {Object} $.Deferred; a jQuery deferred-object-queue. */ switchGadgetPref: function(prefName, prefVal) { var $def = $.Deferred(); sm.switchPref( mwPrefPrefix + prefName, prefVal, $.proxy( $def.resolve, $def ), $.proxy( $def.reject, $def ) ); return $def; }, /** * Fetch a Gadget preference from various sources! * * @example * mw.libs.settingsManager.fetchGadgetSetting( 'mySetting', ['storage', 'option'] ).done(function(prefName, settingValue) { console.log("DONE!") }); * * @param prefName {String} The name of the preference. * @param prefSources {Array} One or more of the following values 'storage', 'cookie', 'option', 'window'. Default (if not passed): * All in the order listed there. Note that they are processed in the order you pass them in and as soon as one is found, * Script will return. * IMPORTANT: The Array is changed while processing. So make a copy if you need it again before passing it. * * @context {mw.libs.settingsManager} * @return {Object} $.Deferred; a jQuery deferred-object-queue. */ fetchGadgetSetting: function(prefName, prefSources) { var $def = $.Deferred(), requires = [], options = { 'storage': { requires: ['mediawiki.storage'], fetch: function() { var v = mw.storage.get( prefName ); return (null === v || undefined === v) ? undefined : v; } }, 'cookie': { requires: ['mediawiki.cookie'], fetch: function() { var v = mw.cookie.get( prefName ); try { v = JSON.parse( v ); } catch(invalidJSON) {} return (null === v || undefined === v) ? undefined : v; } }, 'option': { requires: ['mediawiki.user', 'user.options'], fetch: function() { var v = mw.user.options.get( mwPrefPrefix + prefName ); try { v = JSON.parse( v ); } catch(invalidJSON) {} return (null === v || undefined === v) ? undefined : v; } }, 'window': { requires: [], fetch: function() { return window[prefName]; } } }; if (!prefSources) prefSources = []; if (!prefSources.length) prefSources = ['storage', 'cookie', 'option', 'window']; var _fetch = function(s) { var so = options[s]; if (so) { mw.loader.using( so.requires, function() { var v = so.fetch(); if (undefined === v) { _fetched(); } else { $def.resolve( prefName, v ); } } ); } else { // Security guard: Don't load settings from unprotected pages if (!/^(?:User\:|MediaWiki\:).+\.js$/.test( s )) _fetched(); sm.script( s ).fetchJSON( function(me, jsonData) { if (jsonData) { $def.resolve( prefName, jsonData ); } else { _fetched(); } }, $.proxy( $def.reject, $def ) ); } }, _fetched = function() { prefSources.shift(); if (prefSources.length) { _fetch( prefSources[0] ); } else { $def.resolve( prefName /* no pref found */ ); } }; $.each( prefSources, function(i, s) { var so = options[s]; if (so) requires = requires.concat( options[s].requires ); } ); mw.loader.load( requires ); // ensure async setTimeout( function() { _fetch(prefSources[0]); }, 10 ); return $def; }, /** * Constructor-method. Returns an option-object you should perform the actions on. * * @example * var slideshowGadget = mw.libs.settingsManager.gadget( 'Slideshow' ); * if (slideshowGadget.isEnabled()) { slideshowGadget.disable( myCallback ) } * * // Enable a gadget and load it: * mw.libs.settingsManager.gadget( 'Slideshow' ).load().enable(); * * @param gadgetName {Object} The name of the gadget. (Not the script file; without Gadget- prefix or other decoration) * @context {mw.libs.settingsManager} * @return {Object} gadget-object you can use for performing actions on. */ gadget: function(gadgetName) { var optGadget = 'gadget-' + gadgetName, rlGadget = 'ext.gadget.' + gadgetName; return { getName: function() { return gadgetName; }, isDefault: function() { var opt = mw.user.options.get( optGadget ); return ('number' === typeof opt || '' === opt); }, isEnabled: function() { var opt = mw.user.options.get( optGadget ); return !!opt; }, getState: function() { return mw.loader.getState( rlGadget ); }, isLoaded: function() { return ('ready' === this.getState()); }, load: function(cb, errCb) { // Always async if (this.isLoaded && cb) return setTimeout( function() { cb( gadgetName, true ); }, 1 ); mw.loader.using( rlGadget, cb ? function() { cb( gadgetName ); } : undefined, errCb ? function() { errCb( gadgetName ); } : undefined ); return this; }, enable: function(cb, errCb) { // Type wouldn't matter due to URL-encoding but we also want to update // the user.options object sm.switchPref( optGadget, this.isDefault() ? 1 : '1', cb, errCb ); return this; }, disable: function(cb, errCb) { sm.switchPref( optGadget, '', cb, errCb ); return this; } }; } }; mw.libs.settingsManager = sm; // TODO add to gadget-def // mw.loader.load([ 'mediawiki.user', 'user.options']); }( jQuery, mediaWiki )); // </nowiki> gsy2zdnr7f7meqztrzn4nuf9v5yj5ju ميدياويكي:ActivateGadget.js 8 237550 1089683 2026-04-28T14:52:57Z حبيشان 31560 لتفعيل الإضافات عبر الروابط 1089683 javascript text/javascript /** * Prompt to activate a given gadget via the "gadgetname" URL param. * * @source https://commons.wikimedia.org/wiki/MediaWiki:ActivateGadget.js * @rev 2023-10-07 * @author Rillke, 2012 */ // List the global variables for jsHint-Validation. Please make sure that it passes http://jshint.com/ // Scheme: globalVariable:allowOverwriting[, globalVariable:allowOverwriting][, globalVariable:allowOverwriting] /* global $:false, mw:false */ // Set jsHint-options. You should not set forin or undef to false if your script does not validate. /*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:false, browser:true*/ (function() { "use strict"; var i18n = { headingAnon: "سجل دخولك حتى تتمكن من تفعيل الإضافة $1", headingDeactivation: "أكَّد تعطيل الإضافة $2", headingActivation: "أكَّد تفعيل الإضافة $2", alreadyDisabled: "الإضافة $1 معطلة بالفعل في تفضيلاتك.", alreadyEnabled: "الإضافة $1 مفعلة بالفعل في تفضيلاتك", promptDeactive: "هل تود تعطيل الإضافة $2?", promptActivate: "هل تود تفعيل الإضافة $2?", confirmYes: "Yes", confirmNo: "No", success: "Preference saved successfully. Please reload the pages to see any effect.", failed: "فشل في تعديل حالة الإضافة في تفضيلاتك. نأسف للإزعاج. قم بتغيير تفضيلاتك يدويا ، رجاءً. شكرا.", cancelled: "لعلك أدخلت عنوان URL خاطئا في شريط العنوان في متصفحك أو اتبعت الرابط الخطأ." }; mw.loader.using(['jquery.ui', 'mediawiki.user', 'mediawiki.util', 'ext.gadget.libJQuery', 'ext.gadget.SettingsManager'], function() { var gadgetname = mw.util.getParamValue('gadgetname'), deactivate = mw.util.getParamValue('disablegadget'), gadget = mw.libs.settingsManager.gadget(gadgetname), UNUSED_PARAM = $.noop; // If the gadgetname URL parameter wasn't supplied, silently fail if (!gadgetname) return; // Check whether such a gadget exists if (null === gadget.getState()) return; // Check whether it is already enabled/disabled if (deactivate) { if (!gadget.isEnabled()) return mw.notify(i18n.alreadyDisabled.replace('$1', gadgetname)); } else { if (gadget.isEnabled()) return mw.notify(i18n.alreadyEnabled.replace('$1', gadgetname)); } var $dlg = $('<div>').hide().appendTo('#mw-content-text'); if (mw.user.isAnon()) { // Ask the user to login var logInLink = mw.util.wikiScript() + '?' + $.param({ title: 'Special:UserLogin', uselang: mw.config.get('wgUserLanguage'), returnto: mw.config.get('wgPageName') }); $dlg.attr({ title: i18n.headingAnon.replace('$1', gadgetname) }).append( $('<a>').attr('href', logInLink).text($('#pt-login').text() || 'Login') ).dialog({ width: 600 }); } else { var $aboutGadget = $('<div>').css({ 'min-height': '50px', 'border': '1px solid grey', 'padding': '5px' }); $dlg.attr({ title: (deactivate ? i18n.headingDeactivation : i18n.headingActivation).replace('$2', gadgetname) }).text((deactivate ? i18n.promptDeactive : i18n.promptActivate).replace('$2', gadgetname)).append($aboutGadget).dialog({ width: 600, buttons: [ { text: i18n.confirmYes, click: function() { var $prog = $('<div>').css({ 'height': '50px' }).progressbar(); var action = deactivate ? 'disable' : 'enable'; $dlg.parent().find('button').button({ disabled: true }); $dlg.text('').append($prog); if (!deactivate) gadget.load(); gadget[action](function() { $prog.progressbar({ value: 100 }); var $successtext = $('<div>').text(i18n.success); $dlg.append($successtext); $successtext.load(mw.util.wikiScript() + '?' + $.param({ title: 'Template:Purge_client_cache/render', uselang: mw.config.get('wgUserLanguage'), action: 'render' })); setTimeout(function() { window.location = mw.util.getUrl(mw.config.get('wgPageName')); }, 4500); }, function() { var $errtext = $('<div>').text(i18n.failed); $dlg.append($errtext); setTimeout(function() { window.location = mw.util.getUrl('Special:Preferences') + '#mw-prefsection-gadgets'; }, 4500); }); } }, { text: i18n.confirmNo, click: function() { $dlg.dialog('close'); $dlg.remove(); mw.notify(i18n.cancelled); } } ], open: function() { // Look out for http://bugs.jqueryui.com/ticket/6830 / jQuery UI 1.9 var $buttons = $(this).parent().find('.ui-dialog-buttonpane button'), $submitButton = $buttons.eq(0).specialButton('proceed').focus(), $cancelButton = $buttons.eq(1).specialButton('cancel'); UNUSED_PARAM($submitButton); UNUSED_PARAM($cancelButton); } }); $.get(mw.util.wikiScript('api'), { format: 'json', action: 'parse', title: mw.config.get('wgPageName'), redirects: 1, prop: 'text', uselang: mw.config.get('wgUserLanguage'), text: '{{int:Gadget-' + gadgetname + '}}' }, function(r) { $aboutGadget.append(r.parse.text['*']); }); } }); }()); ewf2c4gc8vx33j3a05wba2e78ua57u4 قالب:تفعيل إضافة 10 237551 1089685 2026-04-28T15:01:10Z حبيشان 31560 استيراد من ar.wikipedia.org 1089685 wikitext text/x-wiki <span class="plainlinks">[{{fullurl:{{{page|{{FULLPAGENAME}}}}}|withJS=MediaWiki:ActivateGadget.js&gadgetname={{urlencode:{{{1|}}}}}{{#if:{{{تعطيل|}}}|&disablegadget={{{تعطيل|}}}}}}} <span class="{{#if:{{{block|}}}|mw-ui-button mw-ui-progressive}}">{{#if:{{{2|}}}|{{{2|}}}|{{#if:{{{تعطيل|}}}|تعطيل|تفعيل}} الإضافة}}</span>]</span><noinclude> {{توثيق}} </noinclude> saoy92fbjxzfzw5gk3w79u8lnnz88zl 1089701 1089685 2026-04-28T16:01:08Z حبيشان 31560 1089701 wikitext text/x-wiki <span class="plainlinks">[{{fullurl:{{{page|{{FULLPAGENAME}}}}}|use=MediaWiki:ActivateGadget.js&gadgetname={{urlencode:{{{1|}}}}}{{#if:{{{تعطيل|}}}|&disablegadget={{{تعطيل|}}}}}}} <span class="{{#if:{{{block|}}}|mw-ui-button mw-ui-progressive}}">{{#if:{{{2|}}}|{{{2|}}}|{{#if:{{{تعطيل|}}}|تعطيل|تفعيل}} الإضافة}}</span>]</span><noinclude> {{توثيق}} </noinclude> 77h7ju2t7mgdflsg75bk7yl1mzvu2s9 قالب:تفعيل إضافة/شرح 10 237552 1089686 2026-04-28T15:01:12Z حبيشان 31560 استيراد من ar.wikipedia.org 1089686 wikitext text/x-wiki {{صفحة توثيق فرعية}} === استعمال === يعمل رابط لتفعيل إضافة يعتمد على إضافتي [[mediawiki:ActivateGadget.js]] و [[mediawiki:Gadget-SettingsManager.js]] == بيانات القالب== {{رأس بيانات القالب}} <templatedata> { "params": { "1": { "label": "اسم صفحة الإضافة", "example": "HotCat", "type": "string", "required": true }, "2": { "label": "اسم وصفي للإضافة", "type": "string", "suggested": true }, "تعطيل": { "label": "تعطيل الإضافة بدلا من تفعيلها", "type": "boolean" }, "block": { "label": "عرض بشكل زر", "type": "boolean", "suggested": true } }, "format": "block", "description": "يعمل رابط لتفعيل إضافة" } </templatedata> <includeonly>{{ملعب أخر|| <!-- [[تصنيف:قوالب ويكيبيديا]] --> }}</includeonly> hur6yeppc9daz6zmjit0ev77jl70y3e وحدة:Wd 828 237553 1089688 2026-04-28T15:42:00Z حبيشان 31560 استيراد من ar.wikipedia.org 1089688 Scribunto text/plain -- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]]. require("strict") local p = {} local arg = ... local i18n local function loadI18n(aliasesP, frame) local title if frame then -- current module invoked by page/template, get its title from frame title = frame:getTitle() else -- current module included by other module, get its title from ... title = arg end if not i18n then i18n = require(title .. "/i18n").init(aliasesP) end end p.claimCommands = { property = "property", properties = "properties", qualifier = "qualifier", qualifiers = "qualifiers", reference = "reference", references = "references" } p.generalCommands = { label = "label", title = "title", description = "description", alias = "alias", aliases = "aliases", badge = "badge", badges = "badges" } p.flags = { linked = "linked", short = "short", raw = "raw", multilanguage = "multilanguage", unit = "unit", ------------- preferred = "preferred", normal = "normal", deprecated = "deprecated", best = "best", future = "future", current = "current", former = "former", edit = "edit", editAtEnd = "edit@end", mdy = "mdy", single = "single", sourced = "sourced" } p.args = { eid = "eid", page = "page", date = "date", globalSiteId = "globalSiteId" } local aliasesP = { coord = "P625", ----------------------- image = "P18", author = "P50", authorNameString = "P2093", publisher = "P123", importedFrom = "P143", wikimediaImportURL = "P4656", statedIn = "P248", pages = "P304", language = "P407", hasPart = "P527", publicationDate = "P577", startTime = "P580", endTime = "P582", chapter = "P792", retrieved = "P813", referenceURL = "P854", sectionVerseOrParagraph = "P958", archiveURL = "P1065", title = "P1476", formatterURL = "P1630", quote = "P1683", shortName = "P1813", definingFormula = "P2534", archiveDate = "P2960", inferredFrom = "P3452", typeOfReference = "P3865", column = "P3903", subjectNamedAs = "P1810", wikidataProperty = "P1687", publishedIn = "P1433" } local aliasesQ = { percentage = "Q11229", prolepticJulianCalendar = "Q1985786", citeWeb = "Q5637226", citeQ = "Q22321052" } local parameters = { property = "%p", qualifier = "%q", reference = "%r", alias = "%a", badge = "%b", separator = "%s", general = "%x" } local formats = { property = "%p[%s][%r]", qualifier = "%q[%s][%r]", reference = "%r", propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]", alias = "%a[%s]", badge = "%b[%s]" } local hookNames = { -- {level_1, level_2} [parameters.property] = {"getProperty"}, [parameters.reference] = {"getReferences", "getReference"}, [parameters.qualifier] = {"getAllQualifiers"}, [parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"}, [parameters.alias] = {"getAlias"}, [parameters.badge] = {"getBadge"} } -- default value objects, should NOT be mutated but instead copied local defaultSeparators = { ["sep"] = {" "}, ["sep%s"] = {"،"}, ["sep%q"] = {"؛ "}, ["sep%q\\d"] = {", "}, ["sep%r"] = nil, -- none ["punc"] = nil -- none } local rankTable = { ["preferred"] = 1, ["normal"] = 2, ["deprecated"] = 3 } local function replaceAlias(id) if aliasesP[id] then id = aliasesP[id] end return id end local function errorText(code, param) local text = i18n["errors"][code] if param then text = mw.ustring.gsub(text, "$1", param) end return text end local function throwError(errorMessage, param) error(errorText(errorMessage, param)) end local function replaceDecimalMark(num) return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1) end local function padZeros(num, numDigits) local numZeros local negative = false if num < 0 then negative = true num = num * -1 end num = tostring(num) numZeros = numDigits - num:len() for _ = 1, numZeros do num = "0"..num end if negative then num = "-"..num end return num end local function replaceSpecialChar(chr) if chr == '_' then -- replace underscores with spaces return ' ' else return chr end end local function replaceSpecialChars(str) local chr local esc = false local strOut = "" for i = 1, #str do chr = str:sub(i,i) if not esc then if chr == '\\' then esc = true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local function buildWikilink(target, label) if not label or target == label then return "[[" .. target .. "]]" else return "[[" .. target .. "|" .. label .. "]]" end end -- used to make frame.args mutable, to replace #frame.args (which is always 0) -- with the actual amount and to simply copy tables local function copyTable(tIn) if not tIn then return nil end local tOut = {} for i, v in pairs(tIn) do tOut[i] = v end return tOut end -- used to merge output arrays together; -- note that it currently mutates the first input array local function mergeArrays(a1, a2) for i = 1, #a2 do a1[#a1 + 1] = a2[i] end return a1 end local function split(str, del) local out = {} local i, j = str:find(del) if i and j then out[1] = str:sub(1, i - 1) out[2] = str:sub(j + 1) else out[1] = str end return out end local function parseWikidataURL(url) local id if url:match('^http[s]?://') then id = split(url, "Q") if id[2] then return "Q" .. id[2] end end return nil end local function parseDate(dateStr, precision) precision = precision or "d" local i, j, index, ptr local parts = {nil, nil, nil} if dateStr == nil then return parts[1], parts[2], parts[3] -- year, month, day end -- 'T' for snak values, '/' for outputs with '/Julian' attached i, j = dateStr:find("[T/]") if i then dateStr = dateStr:sub(1, i-1) end local from = 1 if dateStr:sub(1,1) == "-" then -- this is a negative number, look further ahead from = 2 end index = 1 ptr = 1 i, j = dateStr:find("-", from) if i then -- year parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error if parts[index] == -0 then parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead end if precision == "y" then -- we're done return parts[1], parts[2], parts[3] -- year, month, day end index = index + 1 ptr = i + 1 i, j = dateStr:find("-", ptr) if i then -- month parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) if precision == "m" then -- we're done return parts[1], parts[2], parts[3] -- year, month, day end index = index + 1 ptr = i + 1 end end if dateStr:sub(ptr) ~= "" then -- day if we have month, month if we have year, or year parts[index] = tonumber(dateStr:sub(ptr), 10) end return parts[1], parts[2], parts[3] -- year, month, day end local function datePrecedesDate(aY, aM, aD, bY, bM, bD) if aY == nil or bY == nil then return nil end aM = aM or 1 aD = aD or 1 bM = bM or 1 bD = bD or 1 if aY < bY then return true end if aY > bY then return false end if aM < bM then return true end if aM > bM then return false end if aD < bD then return true end return false end local function getHookName(param, index) if hookNames[param] then return hookNames[param][index] elseif param:len() > 2 then return hookNames[param:sub(1, 2).."\\d"][index] else return nil end end local function alwaysTrue() return true end -- The following function parses a format string. -- -- The example below shows how a parsed string is structured in memory. -- Variables other than 'str' and 'child' are left out for clarity's sake. -- -- Example: -- "A %p B [%s[%q1]] C [%r] D" -- -- Structure: -- [ -- { -- str = "A " -- }, -- { -- str = "%p" -- }, -- { -- str = " B ", -- child = -- [ -- { -- str = "%s", -- child = -- [ -- { -- str = "%q1" -- } -- ] -- } -- ] -- }, -- { -- str = " C ", -- child = -- [ -- { -- str = "%r" -- } -- ] -- }, -- { -- str = " D" -- } -- ] -- local function parseFormat(str) local chr, esc, param, root, cur, prev, new local params = {} local function newObject(array) local obj = {} -- new object obj.str = "" array[#array + 1] = obj -- array{object} obj.parent = array return obj end local function endParam() if param > 0 then if cur.str ~= "" then cur.str = "%"..cur.str cur.param = true params[cur.str] = true cur.parent.req[cur.str] = true prev = cur cur = newObject(cur.parent) end param = 0 end end root = {} -- array root.req = {} cur = newObject(root) prev = nil esc = false param = 0 for i = 1, #str do chr = str:sub(i,i) if not esc then if chr == '\\' then endParam() esc = true elseif chr == '%' then endParam() if cur.str ~= "" then cur = newObject(cur.parent) end param = 2 elseif chr == '[' then endParam() if prev and cur.str == "" then table.remove(cur.parent) cur = prev end cur.child = {} -- new array cur.child.req = {} cur.child.parent = cur cur = newObject(cur.child) elseif chr == ']' then endParam() if cur.parent.parent then new = newObject(cur.parent.parent.parent) if cur.str == "" then table.remove(cur.parent) end cur = new end else if param > 1 then param = param - 1 elseif param == 1 then if not chr:match('%d') then endParam() end end cur.str = cur.str .. replaceSpecialChar(chr) end else cur.str = cur.str .. chr esc = false end prev = nil end endParam() -- make sure that at least one required parameter has been defined if not next(root.req) then throwError("missing-required-parameter") end -- make sure that the separator parameter "%s" is not amongst the required parameters if root.req[parameters.separator] then throwError("extra-required-parameter", parameters.separator) end return root, params end local function sortOnRank(claims) local rankPos local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default) local sorted = {} for _, v in ipairs(claims) do rankPos = rankTable[v.rank] or 4 ranks[rankPos][#ranks[rankPos] + 1] = v end sorted = ranks[1] sorted = mergeArrays(sorted, ranks[2]) sorted = mergeArrays(sorted, ranks[3]) return sorted end local Config = {} -- allows for recursive calls function Config:new() local cfg = {} setmetatable(cfg, self) self.__index = self cfg.separators = { -- single value objects wrapped in arrays so that we can pass by reference ["sep"] = {copyTable(defaultSeparators["sep"])}, ["sep%s"] = {copyTable(defaultSeparators["sep%s"])}, ["sep%q"] = {copyTable(defaultSeparators["sep%q"])}, ["sep%r"] = {copyTable(defaultSeparators["sep%r"])}, ["punc"] = {copyTable(defaultSeparators["punc"])} } cfg.entity = nil cfg.entityID = nil cfg.propertyID = nil cfg.propertyValue = nil cfg.qualifierIDs = {} cfg.qualifierIDsAndValues = {} cfg.bestRank = true cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false cfg.foundRank = #cfg.ranks cfg.flagBest = false cfg.flagRank = false cfg.periods = {true, true, true} -- future = true, current = true, former = true cfg.flagPeriod = false cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day} cfg.mdyDate = false cfg.singleClaim = false cfg.sourcedOnly = false cfg.editable = false cfg.editAtEnd = false cfg.inSitelinks = false cfg.langCode = mw.language.getContentLanguage().code cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode) cfg.langObj = mw.language.new(cfg.langCode) cfg.siteID = mw.wikibase.getGlobalSiteId() cfg.states = {} cfg.states.qualifiersCount = 0 cfg.curState = nil cfg.prefetchedRefs = nil return cfg end local State = {} function State:new(cfg, type) local stt = {} setmetatable(stt, self) self.__index = self stt.conf = cfg stt.type = type stt.results = {} stt.parsedFormat = {} stt.separator = {} stt.movSeparator = {} stt.puncMark = {} stt.linked = false stt.rawValue = false stt.shortName = false stt.anyLanguage = false stt.unitOnly = false stt.singleValue = false return stt end -- if id == nil then item connected to current page is used function Config:getLabel(id, raw, link, short) local label = nil local prefix, title= "", nil if not id then id = mw.wikibase.getEntityIdForCurrentPage() if not id then return "" end end id = id:upper() -- just to be sure if raw then -- check if given id actually exists if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then label = id end prefix, title = "d:Special:EntityPage/", label -- may be nil else -- try short name first if requested if short then label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name if label == "" then label = nil end end -- get label if not label then label = mw.wikibase.getLabelByLang(id, self.langCode) -- XXX: should use fallback labels? end end if not label then label = "" elseif link then -- build a link if requested if not title then if id:sub(1,1) == "Q" then title = mw.wikibase.getSitelink(id) elseif id:sub(1,1) == "P" then -- properties have no sitelink, link to Wikidata instead prefix, title = "d:Special:EntityPage/", id end end label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup if title then label = buildWikilink(prefix .. title, label) end end return label end function Config:getEditIcon() local value = "" local prefix = "" local front = "&nbsp;" local back = "" if self.entityID:sub(1,1) == "P" then prefix = "Property:" end if self.editAtEnd then front = '<span style="float:' if self.langObj:isRTL() then front = front .. 'left' else front = front .. 'right' end front = front .. '">' back = '</span>' end value = "[[ملف:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode if self.propertyID then value = value .. "#" .. self.propertyID elseif self.inSitelinks then value = value .. "#sitelinks-wikipedia" end value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]" return front .. value .. back end -- used to create the final output string when it's all done, so that for references the -- function extensionTag("ref", ...) is only called when they really ended up in the final output function Config:concatValues(valuesArray) local outString = "" local j, skip for i = 1, #valuesArray do -- check if this is a reference if valuesArray[i].refHash then j = i - 1 skip = false -- skip this reference if it is part of a continuous row of references that already contains the exact same reference while valuesArray[j] and valuesArray[j].refHash do if valuesArray[i].refHash == valuesArray[j].refHash then skip = true break end j = j - 1 end if not skip then -- add <ref> tag with the reference's hash as its name (to deduplicate references) outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash}) end else outString = outString .. valuesArray[i][1] end end return outString end function Config:convertUnit(unit, raw, link, short, unitOnly) local space = " " local label = "" local itemID if unit == "" or unit == "1" then return nil end if unitOnly then space = "" end itemID = parseWikidataURL(unit) if itemID then if itemID == aliasesQ.percentage then return "%" else label = self:getLabel(itemID, raw, link, short) if label ~= "" then return space .. label end end end return "" end function State:getValue(snak) return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2)) end function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type) if snak.snaktype == 'value' then local datatype = snak.datavalue.type local subtype = snak.datatype local datavalue = snak.datavalue.value if datatype == 'string' then if subtype == 'url' and link then -- create link explicitly if raw then -- will render as a linked number like [1] return "[" .. datavalue .. "]" else return "[" .. datavalue .. " " .. datavalue .. "]" end elseif subtype == 'commonsMedia' then if link then return buildWikilink("c:File:" .. datavalue, datavalue) elseif not raw then return "[[ملف:" .. datavalue .. "]]" else return datavalue end elseif subtype == 'geo-shape' and link then return buildWikilink("c:" .. datavalue, datavalue) elseif subtype == 'math' and not raw then local attribute = nil if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then attribute = {qid = self.entityID} end return mw.getCurrentFrame():extensionTag("math", datavalue, attribute) elseif subtype == 'external-id' and link then local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL if url ~= "" then url = mw.ustring.gsub(url, "$1", datavalue) return "[" .. url .. " " .. datavalue .. "]" else return datavalue end else return datavalue end elseif datatype == 'monolingualtext' then if anyLang or datavalue['language'] == self.langCode then return datavalue['text'] else return nil end elseif datatype == 'quantity' then local value = "" local unit if not unitOnly then -- get value and strip + signs from front value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1") if raw then return value end -- replace decimal mark based on locale value = replaceDecimalMark(value) -- add delimiters for readability value = i18n.addDelimiters(value) end unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly) if unit then value = value .. unit end return value elseif datatype == 'time' then local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr local yFactor = 1 local sign = 1 local prefix = "" local suffix = "" local mayAddCalendar = false local calendar = "" local precision = datavalue['precision'] if precision == 11 then p = "d" elseif precision == 10 then p = "m" else p = "y" yFactor = 10^(9-precision) end y, m, d = parseDate(datavalue['time'], p) if y < 0 then sign = -1 y = y * sign end -- if precision is tens/hundreds/thousands/millions/billions of years if precision <= 8 then yDiv = y / yFactor -- if precision is tens/hundreds/thousands of years if precision >= 6 then mayAddCalendar = true if precision <= 7 then -- round centuries/millenniums up (e.g. 20th century or 3rd millennium) yRound = math.ceil(yDiv) if not raw then if precision == 6 then suffix = i18n['datetime']['suffixes']['millennium'] else suffix = i18n['datetime']['suffixes']['century'] end suffix = i18n.getOrdinalSuffix(yRound) .. suffix else -- if not verbose, take the first year of the century/millennium -- (e.g. 1901 for 20th century or 2001 for 3rd millennium) yRound = (yRound - 1) * yFactor + 1 end else -- precision == 8 -- round decades down (e.g. 2010s) yRound = math.floor(yDiv) * yFactor if not raw then prefix = i18n['datetime']['prefixes']['decade-period'] suffix = i18n['datetime']['suffixes']['decade-period'] end end if raw and sign < 0 then -- if BCE then compensate for "counting backwards" -- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE) yRound = yRound + yFactor - 1 end else local yReFactor, yReDiv, yReRound -- round to nearest for tens of thousands of years or more yRound = math.floor(yDiv + 0.5) if yRound == 0 then if precision <= 2 and y ~= 0 then yReFactor = 1e6 yReDiv = y / yReFactor yReRound = math.floor(yReDiv + 0.5) if yReDiv == yReRound then -- change precision to millions of years only if we have a whole number of them precision = 3 yFactor = yReFactor yRound = yReRound end end if yRound == 0 then -- otherwise, take the unrounded (original) number of years precision = 5 yFactor = 1 yRound = y mayAddCalendar = true end end if precision >= 1 and y ~= 0 then yFull = yRound * yFactor yReFactor = 1e9 yReDiv = yFull / yReFactor yReRound = math.floor(yReDiv + 0.5) if yReDiv == yReRound then -- change precision to billions of years if we're in that range precision = 0 yFactor = yReFactor yRound = yReRound else yReFactor = 1e6 yReDiv = yFull / yReFactor yReRound = math.floor(yReDiv + 0.5) if yReDiv == yReRound then -- change precision to millions of years if we're in that range precision = 3 yFactor = yReFactor yRound = yReRound end end end if not raw then if precision == 3 then suffix = i18n['datetime']['suffixes']['million-years'] elseif precision == 0 then suffix = i18n['datetime']['suffixes']['billion-years'] else yRound = yRound * yFactor if yRound == 1 then suffix = i18n['datetime']['suffixes']['year'] else suffix = i18n['datetime']['suffixes']['years'] end end else yRound = yRound * yFactor end end else yRound = y mayAddCalendar = true end if mayAddCalendar then calendarID = parseWikidataURL(datavalue['calendarmodel']) if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then if not raw then if link then calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")" else calendar = " ("..i18n['datetime']['julian']..")" end else calendar = "/"..i18n['datetime']['julian'] end end end if not raw then local ce = nil if sign < 0 then ce = i18n['datetime']['BCE'] elseif precision <= 5 then ce = i18n['datetime']['CE'] end if ce then if link then ce = buildWikilink(i18n['datetime']['common-era'], ce) end suffix = suffix .. " " .. ce end value = tostring(yRound) if m then dateStr = self.langObj:formatDate("F", "1-"..m.."-1") if d then if self.mdyDate then dateStr = dateStr .. " " .. d .. "," else dateStr = d .. " " .. dateStr end end value = dateStr .. " " .. value end value = prefix .. value .. suffix .. calendar else value = padZeros(yRound * sign, 4) if m then value = value .. "-" .. padZeros(m, 2) if d then value = value .. "-" .. padZeros(d, 2) end end value = value .. calendar end return value elseif datatype == 'globecoordinate' then -- logic from https://github.com/DataValues/Geo (v4.0.1) local precision, unitsPerDegree, numDigits, strFormat, value, globe local latitude, latConv, latValue, latLink local longitude, lonConv, lonValue, lonLink local latDirection, latDirectionN, latDirectionS, latDirectionEN local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN local degSymbol, minSymbol, secSymbol, separator local latDegrees = nil local latMinutes = nil local latSeconds = nil local lonDegrees = nil local lonMinutes = nil local lonSeconds = nil local latDegSym = "" local latMinSym = "" local latSecSym = "" local lonDegSym = "" local lonMinSym = "" local lonSecSym = "" local latDirectionEN_N = "N" local latDirectionEN_S = "S" local lonDirectionEN_E = "E" local lonDirectionEN_W = "W" if not raw then latDirectionN = i18n['coord']['latitude-north'] latDirectionS = i18n['coord']['latitude-south'] lonDirectionE = i18n['coord']['longitude-east'] lonDirectionW = i18n['coord']['longitude-west'] degSymbol = i18n['coord']['degrees'] minSymbol = i18n['coord']['minutes'] secSymbol = i18n['coord']['seconds'] separator = i18n['coord']['separator'] else latDirectionN = latDirectionEN_N latDirectionS = latDirectionEN_S lonDirectionE = lonDirectionEN_E lonDirectionW = lonDirectionEN_W degSymbol = "/" minSymbol = "/" secSymbol = "/" separator = "/" end latitude = datavalue['latitude'] longitude = datavalue['longitude'] if latitude < 0 then latDirection = latDirectionS latDirectionEN = latDirectionEN_S latitude = math.abs(latitude) else latDirection = latDirectionN latDirectionEN = latDirectionEN_N end if longitude < 0 then lonDirection = lonDirectionW lonDirectionEN = lonDirectionEN_W longitude = math.abs(longitude) else lonDirection = lonDirectionE lonDirectionEN = lonDirectionEN_E end precision = datavalue['precision'] if not precision or precision <= 0 then precision = 1 / 3600 -- precision not set (correctly), set to arcsecond end -- remove insignificant detail latitude = math.floor(latitude / precision + 0.5) * precision longitude = math.floor(longitude / precision + 0.5) * precision if precision >= 1 - (1 / 60) and precision < 1 then precision = 1 elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then precision = 1 / 60 end if precision >= 1 then unitsPerDegree = 1 elseif precision >= (1 / 60) then unitsPerDegree = 60 else unitsPerDegree = 3600 end numDigits = math.ceil(-math.log10(unitsPerDegree * precision)) if numDigits <= 0 then numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead end strFormat = "%." .. numDigits .. "f" if precision >= 1 then latDegrees = strFormat:format(latitude) lonDegrees = strFormat:format(longitude) if not raw then latDegSym = replaceDecimalMark(latDegrees) .. degSymbol lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol else latDegSym = latDegrees .. degSymbol lonDegSym = lonDegrees .. degSymbol end else latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits if precision >= (1 / 60) then latMinutes = latConv lonMinutes = lonConv else latSeconds = latConv lonSeconds = lonConv latMinutes = math.floor(latSeconds / 60) lonMinutes = math.floor(lonSeconds / 60) latSeconds = strFormat:format(latSeconds - (latMinutes * 60)) lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60)) if not raw then latSecSym = replaceDecimalMark(latSeconds) .. secSymbol lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol else latSecSym = latSeconds .. secSymbol lonSecSym = lonSeconds .. secSymbol end end latDegrees = math.floor(latMinutes / 60) lonDegrees = math.floor(lonMinutes / 60) latDegSym = latDegrees .. degSymbol lonDegSym = lonDegrees .. degSymbol latMinutes = latMinutes - (latDegrees * 60) lonMinutes = lonMinutes - (lonDegrees * 60) if precision >= (1 / 60) then latMinutes = strFormat:format(latMinutes) lonMinutes = strFormat:format(lonMinutes) if not raw then latMinSym = replaceDecimalMark(latMinutes) .. minSymbol lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol else latMinSym = latMinutes .. minSymbol lonMinSym = lonMinutes .. minSymbol end else latMinSym = latMinutes .. minSymbol lonMinSym = lonMinutes .. minSymbol end end latValue = latDegSym .. latMinSym .. latSecSym .. latDirection lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection value = latValue .. separator .. lonValue if link then globe = parseWikidataURL(datavalue['globe']) if globe then globe = mw.wikibase.getLabelByLang(globe, "en"):lower() else globe = "earth" end latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_") lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_") value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."&params="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]" end return value elseif datatype == 'wikibase-entityid' then local label local itemID = datavalue['numeric-id'] if subtype == 'wikibase-item' then itemID = "Q" .. itemID elseif subtype == 'wikibase-property' then itemID = "P" .. itemID else return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>' end label = self:getLabel(itemID, raw, link, short) if label == "" then label = nil end return label else return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>' end elseif snak.snaktype == 'somevalue' and not noSpecial then if raw then return " " -- single space represents 'somevalue' else return i18n['values']['unknown'] end elseif snak.snaktype == 'novalue' and not noSpecial then if raw then return "" -- empty string represents 'novalue' else return i18n['values']['none'] end else return nil end end function Config:getSingleRawQualifier(claim, qualifierID) local qualifiers if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end if qualifiers and qualifiers[1] then return self:getValue(qualifiers[1], true) -- raw = true else return nil end end function Config:snakEqualsValue(snak, value) local snakValue = self:getValue(snak, true) -- raw = true if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end return snakValue == value end function Config:setRank(rank) local rankPos if rank == p.flags.best then self.bestRank = true self.flagBest = true -- mark that 'best' flag was given return end if rank:sub(1,9) == p.flags.preferred then rankPos = 1 elseif rank:sub(1,6) == p.flags.normal then rankPos = 2 elseif rank:sub(1,10) == p.flags.deprecated then rankPos = 3 else return end -- one of the rank flags was given, check if another one was given before if not self.flagRank then self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before self.flagRank = true -- mark that a rank flag was given end if rank:sub(-1) == "+" then for i = rankPos, 1, -1 do self.ranks[i] = true end elseif rank:sub(-1) == "-" then for i = rankPos, #self.ranks do self.ranks[i] = true end else self.ranks[rankPos] = true end end function Config:setPeriod(period) local periodPos if period == p.flags.future then periodPos = 1 elseif period == p.flags.current then periodPos = 2 elseif period == p.flags.former then periodPos = 3 else return end -- one of the period flags was given, check if another one was given before if not self.flagPeriod then self.periods = {false, false, false} -- no other period flag given before, so unset periods self.flagPeriod = true -- mark that a period flag was given end self.periods[periodPos] = true end function Config:qualifierMatches(claim, id, value) local qualifiers if claim.qualifiers then qualifiers = claim.qualifiers[id] end if qualifiers then for _, v in pairs(qualifiers) do if self:snakEqualsValue(v, value) then return true end end elseif value == "" then -- if the qualifier is not present then treat it the same as the special value 'novalue' return true end return false end function Config:rankMatches(rankPos) if self.bestRank then return (self.ranks[rankPos] and self.foundRank >= rankPos) else return self.ranks[rankPos] end end function Config:timeMatches(claim) local startTime = nil local startTimeY = nil local startTimeM = nil local startTimeD = nil local endTime = nil local endTimeY = nil local endTimeM = nil local endTimeD = nil if self.periods[1] and self.periods[2] and self.periods[3] then -- any time return true end startTime = self:getSingleRawQualifier(claim, aliasesP.startTime) if startTime and startTime ~= "" and startTime ~= " " then startTimeY, startTimeM, startTimeD = parseDate(startTime) end endTime = self:getSingleRawQualifier(claim, aliasesP.endTime) if endTime and endTime ~= "" and endTime ~= " " then endTimeY, endTimeM, endTimeD = parseDate(endTime) end if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then -- invalidate end time if it precedes start time endTimeY = nil endTimeM = nil endTimeD = nil end if self.periods[1] then -- future if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then return true end end if self.periods[2] then -- current if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and (endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then return true end end if self.periods[3] then -- former if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then return true end end return false end function Config:processFlag(flag) if not flag then return false end if flag == p.flags.linked then self.curState.linked = true return true elseif flag == p.flags.raw then self.curState.rawValue = true if self.curState == self.states[parameters.reference] then -- raw reference values end with periods and require a separator (other than none) self.separators["sep%r"][1] = {" "} end return true elseif flag == p.flags.short then self.curState.shortName = true return true elseif flag == p.flags.multilanguage then self.curState.anyLanguage = true return true elseif flag == p.flags.unit then self.curState.unitOnly = true return true elseif flag == p.flags.mdy then self.mdyDate = true return true elseif flag == p.flags.single then self.singleClaim = true return true elseif flag == p.flags.sourced then self.sourcedOnly = true return true elseif flag == p.flags.edit then self.editable = true return true elseif flag == p.flags.editAtEnd then self.editable = true self.editAtEnd = true return true elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then self:setRank(flag) return true elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then self:setPeriod(flag) return true elseif flag == "" then -- ignore empty flags and carry on return true else return false end end function Config:processFlagOrCommand(flag) local param = "" if not flag then return false end if flag == p.claimCommands.property or flag == p.claimCommands.properties then param = parameters.property elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then self.states.qualifiersCount = self.states.qualifiersCount + 1 param = parameters.qualifier .. self.states.qualifiersCount self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])} elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then param = parameters.reference else return self:processFlag(flag) end if self.states[param] then return false end -- create a new state for each command self.states[param] = State:new(self, param) -- use "%x" as the general parameter name self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p" -- set the separator self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then self.states[param].singleValue = true end self.curState = self.states[param] return true end function Config:processSeparators(args) local sep for i, v in pairs(self.separators) do if args[i] then sep = replaceSpecialChars(args[i]) if sep ~= "" then self.separators[i][1] = {sep} else self.separators[i][1] = nil end end end end function Config:setFormatAndSeparators(state, parsedFormat) state.parsedFormat = parsedFormat state.separator = self.separators["sep"] state.movSeparator = self.separators["sep"..parameters.separator] state.puncMark = self.separators["punc"] end -- determines if a claim has references by prefetching them from the claim using getReferences, -- which applies some filtering that determines if a reference is actually returned, -- and caches the references for later use function State:isSourced(claim) self.conf.prefetchedRefs = self:getReferences(claim) return (#self.conf.prefetchedRefs > 0) end function State:resetCaches() -- any prefetched references of the previous claim must not be used self.conf.prefetchedRefs = nil end function State:claimMatches(claim) local matches, rankPos -- first of all, reset any cached values used for the previous claim self:resetCaches() -- if a property value was given, check if it matches the claim's property value if self.conf.propertyValue then matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue) else matches = true end -- if any qualifier values were given, check if each matches one of the claim's qualifier values for i, v in pairs(self.conf.qualifierIDsAndValues) do matches = (matches and self.conf:qualifierMatches(claim, i, v)) end -- check if the claim's rank and time period match rankPos = rankTable[claim.rank] or 4 matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim)) -- if only claims with references must be returned, check if this one has any if self.conf.sourcedOnly then matches = (matches and self:isSourced(claim)) -- prefetches and caches references end return matches, rankPos end function State:out() local result -- collection of arrays with value objects local valuesArray -- array with value objects local sep = nil -- value object local out = {} -- array with value objects local function walk(formatTable, result) local valuesArray = {} -- array with value objects for i, v in pairs(formatTable.req) do if not result[i] or not result[i][1] then -- we've got no result for a parameter that is required on this level, -- so skip this level (and its children) by returning an empty result return {} end end for _, v in ipairs(formatTable) do if v.param then valuesArray = mergeArrays(valuesArray, result[v.str]) elseif v.str ~= "" then valuesArray[#valuesArray + 1] = {v.str} end if v.child then valuesArray = mergeArrays(valuesArray, walk(v.child, result)) end end return valuesArray end -- iterate through the results from back to front, so that we know when to add separators for i = #self.results, 1, -1 do result = self.results[i] -- if there is already some output, then add the separators if #out > 0 then sep = self.separator[1] -- fixed separator result[parameters.separator] = {self.movSeparator[1]} -- movable separator else sep = nil result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark end valuesArray = walk(self.parsedFormat, result) if #valuesArray > 0 then if sep then valuesArray[#valuesArray + 1] = sep end out = mergeArrays(valuesArray, out) end end -- reset state before next iteration self.results = {} return out end -- level 1 hook function State:getProperty(claim) local value = {self:getValue(claim.mainsnak)} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end -- level 1 hook function State:getQualifiers(claim, param) local qualifiers if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end if qualifiers then -- iterate through claim's qualifier statements to collect their values; -- return array with multiple value objects return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook else return {} -- return empty array end end -- level 2 hook function State:getQualifier(snak) local value = {self:getValue(snak)} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end -- level 1 hook function State:getAllQualifiers(claim, param, result, hooks) local out = {} -- array with value objects local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object -- iterate through the output of the separate "qualifier(s)" commands for i = 1, self.conf.states.qualifiersCount do -- if a hook has not been called yet, call it now if not result[parameters.qualifier..i] then self:callHook(parameters.qualifier..i, hooks, claim, result) end -- if there is output for this particular "qualifier(s)" command, then add it if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then -- if there is already some output, then add the separator if #out > 0 and sep then out[#out + 1] = sep end out = mergeArrays(out, result[parameters.qualifier..i]) end end return out end -- level 1 hook function State:getReferences(claim) if self.conf.prefetchedRefs then -- return references that have been prefetched by isSourced return self.conf.prefetchedRefs end if claim.references then -- iterate through claim's reference statements to collect their values; -- return array with multiple value objects return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook else return {} -- return empty array end end -- level 2 hook function State:getReference(statement) -- title of general template for citing web references local citeWeb = split(mw.wikibase.getSitelink(aliasesQ.citeWeb) or "", ":")[2] -- split off namespace from front -- title of template that expands stated-in references into citations local citeQ = split(mw.wikibase.getSitelink(aliasesQ.citeQ) or "", ":")[2] -- split off namespace from front -- will hold rendered properties from statement.snaks local processedProperties = {} -- will hold properties of the reference which are not directly from statement.snaks, -- Namely, these are a backup title from "subject named as" and a URL generated from an external ID. local additionalProcessedProperties = {} -- for each citation type, there will be an associative array that associates lists of rendered properties -- to citation-template parameters local groupedProcessedProperties = {['web'] = {}, ['q'] = {}} -- like above, but only associates one rendered property to each parameter; if the above variable -- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1") local citeParams = {['web'] = {}, ['q'] = {}} local citeErrors = {} local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved local version = 9 -- increment this each time the below logic is changed to avoid conflict errors if not statement.snaks then return {} end -- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia) if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then return {} end -- don't include "type of reference" if statement.snaks[aliasesP.typeOfReference] then statement.snaks[aliasesP.typeOfReference] = nil end -- don't include "image" to prevent littering if statement.snaks[aliasesP.image] then statement.snaks[aliasesP.image] = nil end -- don't include "language" if it is equal to the local one if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then statement.snaks[aliasesP.language] = nil end if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then -- "stated in" was given but "reference URL" was not. -- get "Wikidata property" properties from the item in "stated in" -- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference -- find the "Wikidata property" properties in the item from "stated in" local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true) for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then local tempLink = self.conf:getValue(statement.snaks[wikidataPropertyOfSource][1], false, true) -- not raw, linked if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets. -- the link is in wiki markup, so strip the square brackets and the display text -- gsub also returns another, discarted value, therefore the result is assigned to tempLink first tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1") additionalProcessedProperties[aliasesP.referenceURL] = {tempLink} statement.snaks[wikidataPropertyOfSource] = nil break end end end end -- don't include "subject named as", but use it as the title when "title" is not present but a URL is if statement.snaks[aliasesP.subjectNamedAs] then if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalProcessedProperties[aliasesP.referenceURL]) then additionalProcessedProperties[aliasesP.title] = {statement.snaks[aliasesP.subjectNamedAs][1].datavalue.value} end statement.snaks[aliasesP.subjectNamedAs] = nil end -- fill processedProperties for refProperty in pairs(statement.snaks) do -- multiple authors may be given if refProperty == aliasesP.author or refProperty == aliasesP.authorNameString then processedProperties[refProperty] = self:getReferenceDetails(statement.snaks, refProperty, false, self.linked, true) -- link = true/false, anyLang = true elseif refProperty == aliasesP.statedIn then -- Get "stated in" raw, as it is wanted (for Cite Q) even if it doesn't have a local language label. processedProperties[aliasesP.statedIn] = {self:getReferenceDetail(statement.snaks, aliasesP.statedIn, true)} -- raw = true else processedProperties[refProperty] = {self:getReferenceDetail(statement.snaks, refProperty, false, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true end if #processedProperties[refProperty] == 0 then processedProperties[refProperty] = nil end end -- fill groupedProcessedProperties for refProperty in pairs(statement.snaks) do if processedProperties[refProperty] ~= nil then local i18nKey local prefix = "" referenceEmpty = false if statement.snaks[refProperty][1].datatype == 'external-id' then i18nKey = "external-id" prefix = self.conf:getLabel(refProperty) if prefix ~= "" then prefix = prefix .. " " end else i18nKey = refProperty end -- add the parameter to each matching type of citation for citeType in pairs(groupedProcessedProperties) do repeat -- just a simple wrapper to emulate "continue" -- skip if there already have been errors if citeErrors[citeType] then break end local paramName = i18n['cite'][citeType][i18nKey] -- handle unknown properties in the reference if not paramName then citeErrors[citeType] = true break end if paramName == "" then break end referenceEmpty = false if not groupedProcessedProperties[citeType][paramName] then groupedProcessedProperties[citeType][paramName] = {} end for _, propertyValue in pairs(processedProperties[refProperty]) do table.insert(groupedProcessedProperties[citeType][paramName], propertyValue) end until true end end end -- handle additional properties for refProperty in pairs(additionalProcessedProperties) do for citeType in pairs(citeParams) do repeat -- skip if there already have been errors if citeErrors[citeType] then break end local paramName = i18n['cite'][citeType][refProperty] -- handle unknown properties in the reference if not paramName then citeErrors[citeType] = true break end if paramName == "" then break end referenceEmpty = false if not groupedProcessedProperties[citeType][paramName] then groupedProcessedProperties[citeType][paramName] = {} end for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do table.insert(groupedProcessedProperties[citeType][paramName], propertyValue) end until true end end -- fill citeParams for citeType in pairs(citeParams) do for paramName, paramValues in pairs(groupedProcessedProperties[citeType]) do if #paramValues == 1 then citeParams[citeType][paramName] = paramValues[1] else -- There is more than one value for this parameter - the values will -- go into separate numbered parameters (e.g. "author1", "author2") for paramNum, paramValue in pairs(paramValues) do citeParams[citeType][paramName .. paramNum] = paramValue end end end end -- handle missing mandatory parameters for the templates if not citeParams['web'][i18n['cite']['web'][aliasesP.referenceURL]] then citeErrors['web'] = true end if not citeParams['q'][i18n['cite']['q'][aliasesP.statedIn]] then citeErrors['q'] = true end local templateToUse = nil local paramsToUse = nil -- choose the output template -- (1) use the general template for citing web references if there is a match and if at least "reference URL" is present if citeWeb and not citeErrors['web'] then -- we need a processed "stated in" for this template citeParams['web'][i18n['cite']['web'][aliasesP.statedIn]] = self:getReferenceDetail(statement.snaks, aliasesP.statedIn, false, self.linked, true) templateToUse = citeWeb paramsToUse = citeParams['web'] -- (2) use the template that expands stated-in references into citations if there is a match and if at least "stated in" is present elseif citeQ and not citeErrors['q'] then templateToUse = citeQ paramsToUse = citeParams['q'] end -- fill refContent local refContent = "" if templateToUse and paramsToUse then -- if this module is being substituted then build a regular template call, otherwise expand the template if mw.isSubsting() then for i, v in pairs(paramsToUse) do refContent = refContent .. "|" .. i .. "=" .. v end refContent = "{{" .. templateToUse .. refContent .. "}}" else refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end -- If the citation couldn't be displayed using Cite web or Cite Q, but is not empty (barring ignored propeties), throw an error elseif not referenceEmpty then refContent = "<span style=\"color:#dd3333\">" .. errorText("malformed-reference") .. "</span>" end -- wrap refContent local ref = {} if refContent ~= "" then ref = {refContent} if not self.rawValue then -- this should become a <ref> tag, so save the reference's hash for later ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['cite']['version']) + version) end return {ref} else return {} end end -- gets a detail of one particular type for a reference function State:getReferenceDetail(snaks, dType, raw, link, anyLang) local switchLang = anyLang local value = nil if not snaks[dType] then return nil end -- if anyLang, first try the local language and otherwise any language repeat for _, v in ipairs(snaks[dType]) do value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true if value then break end end if value or not anyLang then break end switchLang = not switchLang until anyLang and switchLang return value end -- gets the details of one particular type for a reference function State:getReferenceDetails(snaks, dType, raw, link, anyLang) local values = {} if not snaks[dType] then return {} end for _, v in ipairs(snaks[dType]) do -- if nil is returned then it will not be added to the table values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true end return values end -- level 1 hook function State:getAlias(object) local value = object.value local title = nil if value and self.linked then if self.conf.entityID:sub(1,1) == "Q" then title = mw.wikibase.getSitelink(self.conf.entityID) elseif self.conf.entityID:sub(1,1) == "P" then title = "d:Property:" .. self.conf.entityID end if title then value = buildWikilink(title, value) end end value = {value} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end -- level 1 hook function State:getBadge(value) value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName) if value == "" then value = nil end value = {value} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end function State:callHook(param, hooks, statement, result) local valuesArray, refHash -- call a parameter's hook if it has been defined and if it has not been called before if not result[param] and hooks[param] then valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects -- add to the result if #valuesArray > 0 then result[param] = valuesArray result.count = result.count + 1 else result[param] = {} -- an empty array to indicate that we've tried this hook already return true -- miss == true end end return false end -- iterate through claims, claim's qualifiers or claim's references to collect values function State:iterate(statements, hooks, matchHook) matchHook = matchHook or alwaysTrue local matches = false local rankPos = nil local result, gotRequired for _, v in ipairs(statements) do -- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.) matches, rankPos = matchHook(self, v) if matches then result = {count = 0} -- collection of arrays with value objects local function walk(formatTable) local miss for i2, v2 in pairs(formatTable.req) do -- call a hook, adding its return value to the result miss = self:callHook(i2, hooks, v, result) if miss then -- we miss a required value for this level, so return false return false end if result.count == hooks.count then -- we're done if all hooks have been called; -- returning at this point breaks the loop return true end end for _, v2 in ipairs(formatTable) do if result.count == hooks.count then -- we're done if all hooks have been called; -- returning at this point prevents further childs from being processed return true end if v2.child then walk(v2.child) end end return true end gotRequired = walk(self.parsedFormat) -- only append the result if we got values for all required parameters on the root level if gotRequired then -- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank if rankPos and self.conf.foundRank > rankPos then self.conf.foundRank = rankPos end -- append the result self.results[#self.results + 1] = result -- break if we only need a single value if self.singleValue then break end end end end return self:out() end local function getEntityId(arg, eid, page, allowOmitPropPrefix, globalSiteId) local id = nil local prop = nil if arg then if arg:sub(1,1) == ":" then page = arg eid = nil elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then eid = arg page = nil else prop = arg end end if eid then if eid:sub(1,9):lower() == "property:" then id = replaceAlias(mw.text.trim(eid:sub(10))) if id:sub(1,1):upper() ~= "P" then id = "" end else id = replaceAlias(eid) end elseif page then if page:sub(1,1) == ":" then page = mw.text.trim(page:sub(2)) end id = mw.wikibase.getEntityIdForTitle(page, globalSiteId) or "" end if not id then id = mw.wikibase.getEntityIdForCurrentPage() or "" end id = id:upper() if not mw.wikibase.isValidEntityId(id) then id = "" end return id, prop end local function nextArg(args) local arg = args[args.pointer] if arg then args.pointer = args.pointer + 1 return mw.text.trim(arg) else return nil end end local function claimCommand(args, funcName) local cfg = Config:new() cfg:processFlagOrCommand(funcName) -- process first command (== function name) local lastArg, parsedFormat, formatParams, claims, value local hooks = {count = 0} -- set the date if given; -- must come BEFORE processing the flags if args[p.args.date] then cfg.atDate = {parseDate(args[p.args.date])} cfg.periods = {false, true, false} -- change default time constraint to 'current' end -- process flags and commands repeat lastArg = nextArg(args) until not cfg:processFlagOrCommand(lastArg) -- get the entity ID from either the positional argument, the eid argument or the page argument cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], false, args[p.args.globalSiteId]) if cfg.entityID == "" then return "" -- we cannot continue without a valid entity ID end cfg.entity = mw.wikibase.getEntity(cfg.entityID) if not cfg.propertyID then cfg.propertyID = nextArg(args) end cfg.propertyID = replaceAlias(cfg.propertyID) if not cfg.entity or not cfg.propertyID then return "" -- we cannot continue without an entity or a property ID end cfg.propertyID = cfg.propertyID:upper() if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then return "" -- there is no use to continue without any claims end claims = cfg.entity.claims[cfg.propertyID] if cfg.states.qualifiersCount > 0 then -- do further processing if "qualifier(s)" command was given if #args - args.pointer + 1 > cfg.states.qualifiersCount then -- claim ID or literal value has been given cfg.propertyValue = nextArg(args) end for i = 1, cfg.states.qualifiersCount do -- check if given qualifier ID is an alias and add it cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper() end elseif cfg.states[parameters.reference] then -- do further processing if "reference(s)" command was given cfg.propertyValue = nextArg(args) end -- check for special property value 'somevalue' or 'novalue' if cfg.propertyValue then cfg.propertyValue = replaceSpecialChars(cfg.propertyValue) if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue' else cfg.propertyValue = mw.text.trim(cfg.propertyValue) end end -- parse the desired format, or choose an appropriate format if args["format"] then parsedFormat, formatParams = parseFormat(args["format"]) elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given if cfg.states[parameters.property] then -- "propert(y|ies)" command given parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier) else parsedFormat, formatParams = parseFormat(formats.qualifier) end elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given parsedFormat, formatParams = parseFormat(formats.property) else -- "reference(s)" command given parsedFormat, formatParams = parseFormat(formats.reference) end -- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then cfg.separators["sep"..parameters.separator][1] = {";"} end -- if only "reference(s)" has been given, set the default separator to none (except when raw) if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0 and not cfg.states[parameters.reference].rawValue then cfg.separators["sep"][1] = nil end -- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent if cfg.states.qualifiersCount == 1 then cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"] end -- process overridden separator values; -- must come AFTER tweaking the default separators cfg:processSeparators(args) -- define the hooks that should be called (getProperty, getQualifiers, getReferences); -- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given for i, v in pairs(cfg.states) do -- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q" if formatParams[i] or formatParams[i:sub(1, 2)] then hooks[i] = getHookName(i, 1) hooks.count = hooks.count + 1 end end -- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...); -- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1) hooks.count = hooks.count + 1 end -- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration; -- must come AFTER defining the hooks if not cfg.states[parameters.property] then cfg.states[parameters.property] = State:new(cfg, parameters.property) -- if the "single" flag has been given then this state should be equivalent to "property" (singular) if cfg.singleClaim then cfg.states[parameters.property].singleValue = true end end -- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values, -- which must exist in order to be able to determine if a claim has any references; -- must come AFTER defining the hooks if cfg.sourcedOnly and not cfg.states[parameters.reference] then cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead end -- set the parsed format and the separators (and optional punctuation mark); -- must come AFTER creating the additonal states cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat) -- process qualifier matching values, analogous to cfg.propertyValue for i, v in pairs(args) do i = tostring(i) if i:match('^[Pp]%d+$') or aliasesP[i] then v = replaceSpecialChars(v) -- check for special qualifier value 'somevalue' if v ~= "" and mw.text.trim(v) == "" then v = " " -- single space represents 'somevalue' end cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v end end -- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated) claims = sortOnRank(claims) -- then iterate through the claims to collect values value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook -- if desired, add a clickable icon that may be used to edit the returned values on Wikidata if cfg.editable and value ~= "" then value = value .. cfg:getEditIcon() end return value end local function generalCommand(args, funcName) local cfg = Config:new() cfg.curState = State:new(cfg) local lastArg local value = nil repeat lastArg = nextArg(args) until not cfg:processFlag(lastArg) -- get the entity ID from either the positional argument, the eid argument or the page argument cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true, args[p.args.globalSiteId]) if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then return "" -- we cannot continue without an entity end -- serve according to the given command if funcName == p.generalCommands.label then value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName) elseif funcName == p.generalCommands.title then cfg.inSitelinks = true if cfg.entityID:sub(1,1) == "Q" then value = mw.wikibase.getSitelink(cfg.entityID) end if cfg.curState.linked and value then value = buildWikilink(value) end elseif funcName == p.generalCommands.description then value = mw.wikibase.getDescription(cfg.entityID) else local parsedFormat, formatParams local hooks = {count = 0} cfg.entity = mw.wikibase.getEntity(cfg.entityID) if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then cfg.curState.singleValue = true end if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then return "" -- there is no use to continue without any aliasses end local aliases = cfg.entity.aliases[cfg.langCode] -- parse the desired format, or parse the default aliases format if args["format"] then parsedFormat, formatParams = parseFormat(args["format"]) else parsedFormat, formatParams = parseFormat(formats.alias) end -- process overridden separator values; -- must come AFTER tweaking the default separators cfg:processSeparators(args) -- define the hook that should be called (getAlias); -- only define the hook if the parameter ("%a") has been given if formatParams[parameters.alias] then hooks[parameters.alias] = getHookName(parameters.alias, 1) hooks.count = hooks.count + 1 end -- set the parsed format and the separators (and optional punctuation mark) cfg:setFormatAndSeparators(cfg.curState, parsedFormat) -- iterate to collect values value = cfg:concatValues(cfg.curState:iterate(aliases, hooks)) elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then return "" -- there is no use to continue without any badges end local badges = cfg.entity.sitelinks[cfg.siteID].badges cfg.inSitelinks = true -- parse the desired format, or parse the default aliases format if args["format"] then parsedFormat, formatParams = parseFormat(args["format"]) else parsedFormat, formatParams = parseFormat(formats.badge) end -- process overridden separator values; -- must come AFTER tweaking the default separators cfg:processSeparators(args) -- define the hook that should be called (getBadge); -- only define the hook if the parameter ("%b") has been given if formatParams[parameters.badge] then hooks[parameters.badge] = getHookName(parameters.badge, 1) hooks.count = hooks.count + 1 end -- set the parsed format and the separators (and optional punctuation mark) cfg:setFormatAndSeparators(cfg.curState, parsedFormat) -- iterate to collect values value = cfg:concatValues(cfg.curState:iterate(badges, hooks)) end end value = value or "" if cfg.editable and value ~= "" then -- if desired, add a clickable icon that may be used to edit the returned value on Wikidata value = value .. cfg:getEditIcon() end return value end -- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args) local function establishCommands(commandList, commandFunc) for _, commandName in pairs(commandList) do local function wikitextWrapper(frame) local args = copyTable(frame.args) args.pointer = 1 loadI18n(aliasesP, frame) return commandFunc(args, commandName) end p[commandName] = wikitextWrapper local function luaWrapper(args) args = copyTable(args) args.pointer = 1 loadI18n(aliasesP) return commandFunc(args, commandName) end p["_" .. commandName] = luaWrapper end end establishCommands(p.claimCommands, claimCommand) establishCommands(p.generalCommands, generalCommand) -- main function that is supposed to be used by wrapper templates function p.main(frame) if not mw.wikibase then return nil end local f, args loadI18n(aliasesP, frame) -- get the parent frame to take the arguments that were passed to the wrapper template frame = frame:getParent() or frame if not frame.args[1] then throwError("no-function-specified") end f = mw.text.trim(frame.args[1]) if f == "main" then throwError("main-called-twice") end assert(p["_"..f], errorText('no-such-function', f)) -- copy arguments from immutable to mutable table args = copyTable(frame.args) -- remove the function name from the list table.remove(args, 1) return p["_"..f](args) end return p g2zup6y84br7ocd2uyxmp91z0dp2j50 وحدة:Wd/i18n 828 237554 1089689 2026-04-28T15:42:02Z حبيشان 31560 استيراد من ar.wikipedia.org 1089689 Scribunto text/plain -- The values and functions in this submodule should be localized per wiki. local p = {} function p.init(aliasesP) p = { ["errors"] = { ["unknown-data-type"] = "Unknown or unsupported datatype '$1'.", ["missing-required-parameter"] = "No required parameters defined, needing at least one", ["extra-required-parameter"] = "Parameter '$1' must be defined as optional", ["no-function-specified"] = "You must specify a function to call", -- equal to the standard module error message ["main-called-twice"] = 'The function "main" cannot be called twice', ["no-such-function"] = 'The function "$1" does not exist', -- equal to the standard module error message ["malformed-reference"] = "Error: Unable to display the reference properly. See [[Module:wd/doc#References|the documentation]] for details." }, ["info"] = { ["edit-on-wikidata"] = "عدل على Wikidata" }, ["numeric"] = { ["decimal-mark"] = ".", ["delimiter"] = "," }, ["datetime"] = { ["prefixes"] = { ["decade-period"] = "" }, ["suffixes"] = { ["decade-period"] = "s", ["millennium"] = " ألفية", ["century"] = " القرن", ["million-years"] = " مليون سنة", ["billion-years"] = " مليار سنة", ["year"] = " سنة", ["years"] = " years" }, ["julian-calendar"] = "Julian calendar", -- linked page title ["julian"] = "Julian", ["BCE"] = "ق.م", ["CE"] = "CE", ["common-era"] = "Common Era" -- linked page title }, ["coord"] = { ["latitude-north"] = "N", ["latitude-south"] = "S", ["longitude-east"] = "E", ["longitude-west"] = "W", ["degrees"] = "°", ["minutes"] = "'", ["seconds"] = '"', ["separator"] = ", " }, ["values"] = { ["unknown"] = "غير معروف", ["none"] = "none" }, ["cite"] = { ["version"] = "3", -- increment this each time the below parameters are changed to avoid conflict errors ["web"] = { -- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources -- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "") [aliasesP.statedIn] = "website", [aliasesP.referenceURL] = "url", [aliasesP.publicationDate] = "date", [aliasesP.retrieved] = "access-date", [aliasesP.title] = "title", [aliasesP.archiveURL] = "archive-url", [aliasesP.archiveDate] = "archive-date", [aliasesP.language] = "language", [aliasesP.author] = "author", -- existence of author1, author2, author3, etc. is assumed [aliasesP.authorNameString] = "author", [aliasesP.publisher] = "publisher", [aliasesP.quote] = "quote", [aliasesP.pages] = "pages" -- extra option }, ["q"] = { -- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources -- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "") [aliasesP.statedIn] = "1", [aliasesP.pages] = "pages", [aliasesP.column] = "at", [aliasesP.chapter] = "chapter", [aliasesP.sectionVerseOrParagraph] = "section", ["external-id"] = "id", -- used for any type of database property ID [aliasesP.title] = "title", [aliasesP.publicationDate] = "date", [aliasesP.retrieved] = "access-date" } } } p.getOrdinalSuffix = function(num) if tostring(num):sub(-2,-2) == '1' then return "th" -- 10th, 11th, 12th, 13th, ... 19th end num = tostring(num):sub(-1) if num == '1' then return "st" elseif num == '2' then return "nd" elseif num == '3' then return "rd" else return "th" end end p.addDelimiters = function(n) local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$") if left and num and right then return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right else return n end end return p end return p 3xh4yb41jgrwp3fgcgv65nsmlap51nk وحدة:Wd/i18n/ملعب 828 237555 1089690 2026-04-28T15:42:08Z حبيشان 31560 استيراد من ar.wikipedia.org 1089690 Scribunto text/plain -- The values and functions in this submodule should be localized per wiki. local p = {} function p.init(aliasesP) p = { ["version"] = "7", -- increment this each time the below parameters are changed to avoid reference conflict errors ["errors"] = { ["unknown-data-type"] = "Unknown or unsupported datatype '%s'.", ["missing-required-parameter"] = "No required parameters defined, needing at least one", ["extra-required-parameter"] = "Parameter '%s' must be defined as optional", ["no-function-specified"] = "You must specify a function to call", -- equal to the standard module error message ["main-called-twice"] = 'The function "main" cannot be called twice', ["no-such-function"] = 'The function "%s" does not exist', -- equal to the standard module error message ["no-such-reference-template"] = 'Error: template "%s", which is set in %s as the output template for the citation-output type "%s", does not exist', -- Parts of the error message signalling a malformed reference. ["malformed-reference-header"] = "<span style=\"color:#dd3333\">\nError: Unable to display the reference from Wikidata properly. Technical details:\n", ["malformed-reference-footer"] = "See [[Module:wd/doc#References|the documentation]] for further details.\n</span>\n[[Category:Module:Wd reference errors]]", ["template-failure-reason"] = "* Reason for the failure of {{tl|%s}}: %s\n", ["missing-mandatory-param"] = 'The output template call would miss the mandatory parameter <code>%s</code>.', ["unknown-property-in-ref"] = 'The Wikidata reference contains the property {{property|%s}}, which is not assigned to any parameter of this template.' }, ["info"] = { ["edit-on-wikidata"] = "Edit this on Wikidata" }, ["numeric"] = { ["decimal-mark"] = ".", ["delimiter"] = "," }, ["datetime"] = { ["prefixes"] = { ["decade-period"] = "" }, ["suffixes"] = { ["decade-period"] = "s", ["millennium"] = " millennium", ["century"] = " century", ["million-years"] = " million years", ["billion-years"] = " billion years", ["year"] = " year", ["years"] = " years" }, ["julian-calendar"] = "Julian calendar", -- linked page title ["julian"] = "Julian", ["BCE"] = "BCE", ["CE"] = "CE", ["common-era"] = "Common Era" -- linked page title }, ["coord"] = { ["latitude-north"] = "N", ["latitude-south"] = "S", ["longitude-east"] = "E", ["longitude-west"] = "W", ["degrees"] = "°", ["minutes"] = "'", ["seconds"] = '"', ["separator"] = ", " }, ["values"] = { ["unknown"] = "unknown", ["none"] = "none" }, ["cite"] = { ["output-types"] = {"web", "q"}, -- In this order, the output types will be tried ["param-mapping"] = { ["web"] = { -- <= left side: all allowed reference properties for *web page sources* per https://www.wikidata.org/wiki/Help:Sources -- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite web]] (if non-existent, keep empty i.e. "") [aliasesP.statedIn] = "website", [aliasesP.referenceURL] = "url", [aliasesP.publicationDate] = "date", [aliasesP.retrieved] = "access-date", [aliasesP.title] = "title", [aliasesP.archiveURL] = "archive-url", [aliasesP.archiveDate] = "archive-date", [aliasesP.language] = "language", [aliasesP.author] = "author", [aliasesP.authorNameString] = "author", [aliasesP.publisher] = "publisher", [aliasesP.quote] = "quote", [aliasesP.pages] = "pages", -- extra option [aliasesP.publishedIn] = "website", [aliasesP.sectionVerseOrParagraph] = "at" }, ["q"] = { -- <= left side: all allowed reference properties for *sources other than web pages* per https://www.wikidata.org/wiki/Help:Sources -- => right side: corresponding parameter names in (equivalent of) [[:en:Template:Cite Q]] (if non-existent, keep empty i.e. "") [aliasesP.statedIn] = "1", [aliasesP.pages] = "pages", [aliasesP.column] = "at", [aliasesP.chapter] = "chapter", [aliasesP.sectionVerseOrParagraph] = "section", ["external-id"] = "id", -- used for any type of database property ID [aliasesP.title] = "title", [aliasesP.publicationDate] = "date", [aliasesP.retrieved] = "access-date" } }, ["config"] = { -- supported fields: -- - template: name of the template used for output -- - numbered-params: citation params accepting an arbitrary number of values by numbering the params (e.g. author1, author2) -- - raw-value-params: params taking a raw value (which means the property is rendered with getValue with raw=true) -- - mandatory-params: params that are required be in the template call (after potentially appending numbers to params listed in numbered-params) -- Leaving out the "template" field causes the output type to be ignored. ["web"] = { ["template"] = "Cite web", ["numbered-params"] = {"author"}, ["mandatory-params"] = {"url"} }, ["q"] = { ["template"] = "Cite Q", ["raw-value-params"] = {"1"}, -- the first, unnamed parameter of CiteQ takes a QID, not the name of the item cited ["mandatory-params"] = {"1"} } } } } p.getOrdinalSuffix = function(num) if tostring(num):sub(-2,-2) == '1' then return "th" -- 10th, 11th, 12th, 13th, ... 19th end num = tostring(num):sub(-1) if num == '1' then return "st" elseif num == '2' then return "nd" elseif num == '3' then return "rd" else return "th" end end p.addDelimiters = function(n) local left, num, right = string.match(n, "^([^%d]*%d)(%d*)(.-)$") if left and num and right then return left .. (num:reverse():gsub("(%d%d%d)", "%1" .. p['numeric']['delimiter']):reverse()) .. right else return n end end return p end return p 9x26xqgg01idb8drjyqhb64or1txdtn وحدة:Wd/شرح 828 237556 1089691 2026-04-28T15:42:11Z حبيشان 31560 استيراد من ar.wikipedia.org 1089691 wikitext text/x-wiki {{استخدام واسع|demo=Module:{{ROOTPAGENAME}}}} <!--يرجى وضع التصنيفات أسفل هذه الصفحة ووصلات اللغات في ويكي بيانات (انظر [[ويكيبيديا: ويكي بيانات]]) --> == الاستخدام == <code><nowiki>{{</nowiki>#استدعاء:Wd|''اسم_الوظيفة''}}</code> {{#ifeq:{{SUBPAGENAME}}|ملعب| | <!-- التصنيفات أسفل هذا السطر ووصلات اللغات في ويكي بيانات --> }} h2jxn1vzzeispabnbktncw8frookpq5 وحدة:Wd/ملعب 828 237557 1089692 2026-04-28T15:42:13Z حبيشان 31560 استيراد من ar.wikipedia.org 1089692 Scribunto text/plain -- Original module located at [[:en:Module:Wd]] and [[:en:Module:Wd/i18n]]. require("strict") local p = {} local module_arg = ... local i18n local i18nPath local function loadI18n(aliasesP, frame) local title if frame then -- current module invoked by page/template, get its title from frame title = frame:getTitle() else -- current module included by other module, get its title from ... title = module_arg end if not i18n then i18nPath = title .. "/i18n" i18n = require(i18nPath).init(aliasesP) end end p.claimCommands = { property = "property", properties = "properties", qualifier = "qualifier", qualifiers = "qualifiers", reference = "reference", references = "references" } p.generalCommands = { label = "label", title = "title", description = "description", alias = "alias", aliases = "aliases", badge = "badge", badges = "badges" } p.flags = { linked = "linked", short = "short", raw = "raw", multilanguage = "multilanguage", unit = "unit", ------------- preferred = "preferred", normal = "normal", deprecated = "deprecated", best = "best", future = "future", current = "current", former = "former", edit = "edit", editAtEnd = "edit@end", mdy = "mdy", single = "single", sourced = "sourced" } p.args = { eid = "eid", page = "page", date = "date", globalSiteId = "globalSiteId" } local aliasesP = { coord = "P625", ----------------------- image = "P18", author = "P50", authorNameString = "P2093", publisher = "P123", importedFrom = "P143", wikimediaImportURL = "P4656", statedIn = "P248", pages = "P304", language = "P407", hasPart = "P527", publicationDate = "P577", startTime = "P580", endTime = "P582", chapter = "P792", retrieved = "P813", referenceURL = "P854", sectionVerseOrParagraph = "P958", archiveURL = "P1065", title = "P1476", formatterURL = "P1630", quote = "P1683", shortName = "P1813", definingFormula = "P2534", archiveDate = "P2960", inferredFrom = "P3452", typeOfReference = "P3865", column = "P3903", subjectNamedAs = "P1810", wikidataProperty = "P1687", publishedIn = "P1433" } local aliasesQ = { percentage = "Q11229", prolepticJulianCalendar = "Q1985786", citeWeb = "Q5637226", citeQ = "Q22321052" } local parameters = { property = "%p", qualifier = "%q", reference = "%r", alias = "%a", badge = "%b", separator = "%s", general = "%x" } local formats = { property = "%p[%s][%r]", qualifier = "%q[%s][%r]", reference = "%r", propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]", alias = "%a[%s]", badge = "%b[%s]" } local hookNames = { -- {level_1, level_2} [parameters.property] = {"getProperty"}, [parameters.reference] = {"getReferences", "getReference"}, [parameters.qualifier] = {"getAllQualifiers"}, [parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"}, [parameters.alias] = {"getAlias"}, [parameters.badge] = {"getBadge"} } -- default value objects, should NOT be mutated but instead copied local defaultSeparators = { ["sep"] = {" "}, ["sep%s"] = {","}, ["sep%q"] = {"; "}, ["sep%q\\d"] = {", "}, ["sep%r"] = nil, -- none ["punc"] = nil -- none } local rankTable = { ["preferred"] = 1, ["normal"] = 2, ["deprecated"] = 3 } local function replaceAlias(id) if aliasesP[id] then id = aliasesP[id] end return id end local function errorText(code, ...) local text = i18n["errors"][code] if arg then text = mw.ustring.format(text, unpack(arg)) end return text end local function throwError(errorMessage, ...) error(errorText(errorMessage, unpack(arg))) end local function replaceDecimalMark(num) return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1) end local function padZeros(num, numDigits) local numZeros local negative = false if num < 0 then negative = true num = num * -1 end num = tostring(num) numZeros = numDigits - num:len() for _ = 1, numZeros do num = "0"..num end if negative then num = "-"..num end return num end local function replaceSpecialChar(chr) if chr == '_' then -- replace underscores with spaces return ' ' else return chr end end local function replaceSpecialChars(str) local chr local esc = false local strOut = "" for i = 1, #str do chr = str:sub(i,i) if not esc then if chr == '\\' then esc = true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local function buildWikilink(target, label) if not label or target == label then return "[[" .. target .. "]]" else return "[[" .. target .. "|" .. label .. "]]" end end -- used to make frame.args mutable, to replace #frame.args (which is always 0) -- with the actual amount and to simply copy tables local function copyTable(tIn) if not tIn then return nil end local tOut = {} for i, v in pairs(tIn) do tOut[i] = v end return tOut end -- used to merge output arrays together; -- note that it currently mutates the first input array local function mergeArrays(a1, a2) for i = 1, #a2 do a1[#a1 + 1] = a2[i] end return a1 end local function split(str, del) local out = {} local i, j = str:find(del) if i and j then out[1] = str:sub(1, i - 1) out[2] = str:sub(j + 1) else out[1] = str end return out end local function parseWikidataURL(url) local id if url:match('^http[s]?://') then id = split(url, "Q") if id[2] then return "Q" .. id[2] end end return nil end local function parseDate(dateStr, precision) precision = precision or "d" local i, j, index, ptr local parts = {nil, nil, nil} if dateStr == nil then return parts[1], parts[2], parts[3] -- year, month, day end -- 'T' for snak values, '/' for outputs with '/Julian' attached i, j = dateStr:find("[T/]") if i then dateStr = dateStr:sub(1, i-1) end local from = 1 if dateStr:sub(1,1) == "-" then -- this is a negative number, look further ahead from = 2 end index = 1 ptr = 1 i, j = dateStr:find("-", from) if i then -- year parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error if parts[index] == -0 then parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead end if precision == "y" then -- we're done return parts[1], parts[2], parts[3] -- year, month, day end index = index + 1 ptr = i + 1 i, j = dateStr:find("-", ptr) if i then -- month parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) if precision == "m" then -- we're done return parts[1], parts[2], parts[3] -- year, month, day end index = index + 1 ptr = i + 1 end end if dateStr:sub(ptr) ~= "" then -- day if we have month, month if we have year, or year parts[index] = tonumber(dateStr:sub(ptr), 10) end return parts[1], parts[2], parts[3] -- year, month, day end local function datePrecedesDate(aY, aM, aD, bY, bM, bD) if aY == nil or bY == nil then return nil end aM = aM or 1 aD = aD or 1 bM = bM or 1 bD = bD or 1 if aY < bY then return true end if aY > bY then return false end if aM < bM then return true end if aM > bM then return false end if aD < bD then return true end return false end local function getHookName(param, index) if hookNames[param] then return hookNames[param][index] elseif param:len() > 2 then return hookNames[param:sub(1, 2).."\\d"][index] else return nil end end local function alwaysTrue() return true end -- The following function parses a format string. -- -- The example below shows how a parsed string is structured in memory. -- Variables other than 'str' and 'child' are left out for clarity's sake. -- -- Example: -- "A %p B [%s[%q1]] C [%r] D" -- -- Structure: -- [ -- { -- str = "A " -- }, -- { -- str = "%p" -- }, -- { -- str = " B ", -- child = -- [ -- { -- str = "%s", -- child = -- [ -- { -- str = "%q1" -- } -- ] -- } -- ] -- }, -- { -- str = " C ", -- child = -- [ -- { -- str = "%r" -- } -- ] -- }, -- { -- str = " D" -- } -- ] -- local function parseFormat(str) local chr, esc, param, root, cur, prev, new local params = {} local function newObject(array) local obj = {} -- new object obj.str = "" array[#array + 1] = obj -- array{object} obj.parent = array return obj end local function endParam() if param > 0 then if cur.str ~= "" then cur.str = "%"..cur.str cur.param = true params[cur.str] = true cur.parent.req[cur.str] = true prev = cur cur = newObject(cur.parent) end param = 0 end end root = {} -- array root.req = {} cur = newObject(root) prev = nil esc = false param = 0 for i = 1, #str do chr = str:sub(i,i) if not esc then if chr == '\\' then endParam() esc = true elseif chr == '%' then endParam() if cur.str ~= "" then cur = newObject(cur.parent) end param = 2 elseif chr == '[' then endParam() if prev and cur.str == "" then table.remove(cur.parent) cur = prev end cur.child = {} -- new array cur.child.req = {} cur.child.parent = cur cur = newObject(cur.child) elseif chr == ']' then endParam() if cur.parent.parent then new = newObject(cur.parent.parent.parent) if cur.str == "" then table.remove(cur.parent) end cur = new end else if param > 1 then param = param - 1 elseif param == 1 then if not chr:match('%d') then endParam() end end cur.str = cur.str .. replaceSpecialChar(chr) end else cur.str = cur.str .. chr esc = false end prev = nil end endParam() -- make sure that at least one required parameter has been defined if not next(root.req) then throwError("missing-required-parameter") end -- make sure that the separator parameter "%s" is not amongst the required parameters if root.req[parameters.separator] then throwError("extra-required-parameter", parameters.separator) end return root, params end local function sortOnRank(claims) local rankPos local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default) local sorted = {} for _, v in ipairs(claims) do rankPos = rankTable[v.rank] or 4 ranks[rankPos][#ranks[rankPos] + 1] = v end sorted = ranks[1] sorted = mergeArrays(sorted, ranks[2]) sorted = mergeArrays(sorted, ranks[3]) return sorted end local function isValueInTable(searchedItem, inputTable) for _, item in pairs(inputTable) do if item == searchedItem then return true end end return false end local Config = {} -- allows for recursive calls function Config:new() local cfg = {} setmetatable(cfg, self) self.__index = self cfg.separators = { -- single value objects wrapped in arrays so that we can pass by reference ["sep"] = {copyTable(defaultSeparators["sep"])}, ["sep%s"] = {copyTable(defaultSeparators["sep%s"])}, ["sep%q"] = {copyTable(defaultSeparators["sep%q"])}, ["sep%r"] = {copyTable(defaultSeparators["sep%r"])}, ["punc"] = {copyTable(defaultSeparators["punc"])} } cfg.entity = nil cfg.entityID = nil cfg.propertyID = nil cfg.propertyValue = nil cfg.qualifierIDs = {} cfg.qualifierIDsAndValues = {} cfg.bestRank = true cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false cfg.foundRank = #cfg.ranks cfg.flagBest = false cfg.flagRank = false cfg.periods = {true, true, true} -- future = true, current = true, former = true cfg.flagPeriod = false cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day} cfg.mdyDate = false cfg.singleClaim = false cfg.sourcedOnly = false cfg.editable = false cfg.editAtEnd = false cfg.inSitelinks = false cfg.langCode = mw.language.getContentLanguage().code cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode) cfg.langObj = mw.language.new(cfg.langCode) cfg.siteID = mw.wikibase.getGlobalSiteId() cfg.states = {} cfg.states.qualifiersCount = 0 cfg.curState = nil cfg.prefetchedRefs = nil return cfg end local State = {} function State:new(cfg, type) local stt = {} setmetatable(stt, self) self.__index = self stt.conf = cfg stt.type = type stt.results = {} stt.parsedFormat = {} stt.separator = {} stt.movSeparator = {} stt.puncMark = {} stt.linked = false stt.rawValue = false stt.shortName = false stt.anyLanguage = false stt.unitOnly = false stt.singleValue = false return stt end -- if id == nil then item connected to current page is used function Config:getLabel(id, raw, link, short) local label = nil local prefix, title= "", nil if not id then id = mw.wikibase.getEntityIdForCurrentPage() if not id then return "" end end id = id:upper() -- just to be sure if raw then -- check if given id actually exists if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then label = id end prefix, title = "d:Special:EntityPage/", label -- may be nil else -- try short name first if requested if short then label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name if label == "" then label = nil end end -- get label if not label then label = mw.wikibase.getLabel(id) end end if not label then label = "" elseif link then -- build a link if requested if not title then if id:sub(1,1) == "Q" then title = mw.wikibase.getSitelink(id) elseif id:sub(1,1) == "P" then -- properties have no sitelink, link to Wikidata instead prefix, title = "d:Special:EntityPage/", id end end label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup if title then label = buildWikilink(prefix .. title, label) end end return label end function Config:getEditIcon() local value = "" local prefix = "" local front = "&nbsp;" local back = "" if self.entityID:sub(1,1) == "P" then prefix = "Property:" end if self.editAtEnd then front = '<span style="float:' if self.langObj:isRTL() then front = front .. 'left' else front = front .. 'right' end front = front .. '">' back = '</span>' end value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode if self.propertyID then value = value .. "#" .. self.propertyID elseif self.inSitelinks then value = value .. "#sitelinks-wikipedia" end value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]" return front .. value .. back end -- used to create the final output string when it's all done, so that for references the -- function extensionTag("ref", ...) is only called when they really ended up in the final output function Config:concatValues(valuesArray) local outString = "" local j, skip for i = 1, #valuesArray do -- check if this is a reference if valuesArray[i].refHash then j = i - 1 skip = false -- skip this reference if it is part of a continuous row of references that already contains the exact same reference while valuesArray[j] and valuesArray[j].refHash do if valuesArray[i].refHash == valuesArray[j].refHash then skip = true break end j = j - 1 end if not skip then -- add <ref> tag with the reference's hash as its name (to deduplicate references) outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash}) end else outString = outString .. valuesArray[i][1] end end return outString end function Config:convertUnit(unit, raw, link, short, unitOnly) local space = " " local label = "" local itemID if unit == "" or unit == "1" then return nil end if unitOnly then space = "" end itemID = parseWikidataURL(unit) if itemID then if itemID == aliasesQ.percentage then return "%" else label = self:getLabel(itemID, raw, link, short) if label ~= "" then return space .. label end end end return "" end function State:getValue(snak) return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2)) end function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type) if snak.snaktype == 'value' then local datatype = snak.datavalue.type local subtype = snak.datatype local datavalue = snak.datavalue.value if datatype == 'string' then if subtype == 'url' and link then -- create link explicitly if raw then -- will render as a linked number like [1] return "[" .. datavalue .. "]" else return "[" .. datavalue .. " " .. datavalue .. "]" end elseif subtype == 'commonsMedia' then if link then return buildWikilink("c:File:" .. datavalue, datavalue) elseif not raw then return "[[File:" .. datavalue .. "]]" else return datavalue end elseif subtype == 'geo-shape' and link then return buildWikilink("c:" .. datavalue, datavalue) elseif subtype == 'math' and not raw then local attribute = nil if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then attribute = {qid = self.entityID} end return mw.getCurrentFrame():extensionTag("math", datavalue, attribute) elseif subtype == 'external-id' and link then local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL if url ~= "" then url = mw.ustring.gsub(url, "$1", datavalue) return "[" .. url .. " " .. datavalue .. "]" else return datavalue end else return datavalue end elseif datatype == 'monolingualtext' then if anyLang or datavalue['language'] == self.langCode then return datavalue['text'] else return nil end elseif datatype == 'quantity' then local value = "" local unit if not unitOnly then -- get value and strip + signs from front value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1") if raw then return value end -- replace decimal mark based on locale value = replaceDecimalMark(value) -- add delimiters for readability value = i18n.addDelimiters(value) end unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly) if unit then value = value .. unit end return value elseif datatype == 'time' then local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr local yFactor = 1 local sign = 1 local prefix = "" local suffix = "" local mayAddCalendar = false local calendar = "" local precision = datavalue['precision'] if precision == 11 then p = "d" elseif precision == 10 then p = "m" else p = "y" yFactor = 10^(9-precision) end y, m, d = parseDate(datavalue['time'], p) if y < 0 then sign = -1 y = y * sign end -- if precision is tens/hundreds/thousands/millions/billions of years if precision <= 8 then yDiv = y / yFactor -- if precision is tens/hundreds/thousands of years if precision >= 6 then mayAddCalendar = true if precision <= 7 then -- round centuries/millenniums up (e.g. 20th century or 3rd millennium) yRound = math.ceil(yDiv) if not raw then if precision == 6 then suffix = i18n['datetime']['suffixes']['millennium'] else suffix = i18n['datetime']['suffixes']['century'] end suffix = i18n.getOrdinalSuffix(yRound) .. suffix else -- if not verbose, take the first year of the century/millennium -- (e.g. 1901 for 20th century or 2001 for 3rd millennium) yRound = (yRound - 1) * yFactor + 1 end else -- precision == 8 -- round decades down (e.g. 2010s) yRound = math.floor(yDiv) * yFactor if not raw then prefix = i18n['datetime']['prefixes']['decade-period'] suffix = i18n['datetime']['suffixes']['decade-period'] end end if raw and sign < 0 then -- if BCE then compensate for "counting backwards" -- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE) yRound = yRound + yFactor - 1 end else local yReFactor, yReDiv, yReRound -- round to nearest for tens of thousands of years or more yRound = math.floor(yDiv + 0.5) if yRound == 0 then if precision <= 2 and y ~= 0 then yReFactor = 1e6 yReDiv = y / yReFactor yReRound = math.floor(yReDiv + 0.5) if yReDiv == yReRound then -- change precision to millions of years only if we have a whole number of them precision = 3 yFactor = yReFactor yRound = yReRound end end if yRound == 0 then -- otherwise, take the unrounded (original) number of years precision = 5 yFactor = 1 yRound = y mayAddCalendar = true end end if precision >= 1 and y ~= 0 then yFull = yRound * yFactor yReFactor = 1e9 yReDiv = yFull / yReFactor yReRound = math.floor(yReDiv + 0.5) if yReDiv == yReRound then -- change precision to billions of years if we're in that range precision = 0 yFactor = yReFactor yRound = yReRound else yReFactor = 1e6 yReDiv = yFull / yReFactor yReRound = math.floor(yReDiv + 0.5) if yReDiv == yReRound then -- change precision to millions of years if we're in that range precision = 3 yFactor = yReFactor yRound = yReRound end end end if not raw then if precision == 3 then suffix = i18n['datetime']['suffixes']['million-years'] elseif precision == 0 then suffix = i18n['datetime']['suffixes']['billion-years'] else yRound = yRound * yFactor if yRound == 1 then suffix = i18n['datetime']['suffixes']['year'] else suffix = i18n['datetime']['suffixes']['years'] end end else yRound = yRound * yFactor end end else yRound = y mayAddCalendar = true end if mayAddCalendar then calendarID = parseWikidataURL(datavalue['calendarmodel']) if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then if not raw then if link then calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")" else calendar = " ("..i18n['datetime']['julian']..")" end else calendar = "/"..i18n['datetime']['julian'] end end end if not raw then local ce = nil if sign < 0 then ce = i18n['datetime']['BCE'] elseif precision <= 5 then ce = i18n['datetime']['CE'] end if ce then if link then ce = buildWikilink(i18n['datetime']['common-era'], ce) end suffix = suffix .. " " .. ce end value = tostring(yRound) if m then dateStr = self.langObj:formatDate("F", "1-"..m.."-1") if d then if self.mdyDate then dateStr = dateStr .. " " .. d .. "," else dateStr = d .. " " .. dateStr end end value = dateStr .. " " .. value end value = prefix .. value .. suffix .. calendar else value = padZeros(yRound * sign, 4) if m then value = value .. "-" .. padZeros(m, 2) if d then value = value .. "-" .. padZeros(d, 2) end end value = value .. calendar end return value elseif datatype == 'globecoordinate' then -- logic from https://github.com/DataValues/Geo (v4.0.1) local precision, unitsPerDegree, numDigits, strFormat, value, globe local latitude, latConv, latValue, latLink local longitude, lonConv, lonValue, lonLink local latDirection, latDirectionN, latDirectionS, latDirectionEN local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN local degSymbol, minSymbol, secSymbol, separator local latDegrees = nil local latMinutes = nil local latSeconds = nil local lonDegrees = nil local lonMinutes = nil local lonSeconds = nil local latDegSym = "" local latMinSym = "" local latSecSym = "" local lonDegSym = "" local lonMinSym = "" local lonSecSym = "" local latDirectionEN_N = "N" local latDirectionEN_S = "S" local lonDirectionEN_E = "E" local lonDirectionEN_W = "W" if not raw then latDirectionN = i18n['coord']['latitude-north'] latDirectionS = i18n['coord']['latitude-south'] lonDirectionE = i18n['coord']['longitude-east'] lonDirectionW = i18n['coord']['longitude-west'] degSymbol = i18n['coord']['degrees'] minSymbol = i18n['coord']['minutes'] secSymbol = i18n['coord']['seconds'] separator = i18n['coord']['separator'] else latDirectionN = latDirectionEN_N latDirectionS = latDirectionEN_S lonDirectionE = lonDirectionEN_E lonDirectionW = lonDirectionEN_W degSymbol = "/" minSymbol = "/" secSymbol = "/" separator = "/" end latitude = datavalue['latitude'] longitude = datavalue['longitude'] if latitude < 0 then latDirection = latDirectionS latDirectionEN = latDirectionEN_S latitude = math.abs(latitude) else latDirection = latDirectionN latDirectionEN = latDirectionEN_N end if longitude < 0 then lonDirection = lonDirectionW lonDirectionEN = lonDirectionEN_W longitude = math.abs(longitude) else lonDirection = lonDirectionE lonDirectionEN = lonDirectionEN_E end precision = datavalue['precision'] if not precision or precision <= 0 then precision = 1 / 3600 -- precision not set (correctly), set to arcsecond end -- remove insignificant detail latitude = math.floor(latitude / precision + 0.5) * precision longitude = math.floor(longitude / precision + 0.5) * precision if precision >= 1 - (1 / 60) and precision < 1 then precision = 1 elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then precision = 1 / 60 end if precision >= 1 then unitsPerDegree = 1 elseif precision >= (1 / 60) then unitsPerDegree = 60 else unitsPerDegree = 3600 end numDigits = math.ceil(-math.log10(unitsPerDegree * precision)) if numDigits <= 0 then numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead end strFormat = "%." .. numDigits .. "f" if precision >= 1 then latDegrees = strFormat:format(latitude) lonDegrees = strFormat:format(longitude) if not raw then latDegSym = replaceDecimalMark(latDegrees) .. degSymbol lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol else latDegSym = latDegrees .. degSymbol lonDegSym = lonDegrees .. degSymbol end else latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits if precision >= (1 / 60) then latMinutes = latConv lonMinutes = lonConv else latSeconds = latConv lonSeconds = lonConv latMinutes = math.floor(latSeconds / 60) lonMinutes = math.floor(lonSeconds / 60) latSeconds = strFormat:format(latSeconds - (latMinutes * 60)) lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60)) if not raw then latSecSym = replaceDecimalMark(latSeconds) .. secSymbol lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol else latSecSym = latSeconds .. secSymbol lonSecSym = lonSeconds .. secSymbol end end latDegrees = math.floor(latMinutes / 60) lonDegrees = math.floor(lonMinutes / 60) latDegSym = latDegrees .. degSymbol lonDegSym = lonDegrees .. degSymbol latMinutes = latMinutes - (latDegrees * 60) lonMinutes = lonMinutes - (lonDegrees * 60) if precision >= (1 / 60) then latMinutes = strFormat:format(latMinutes) lonMinutes = strFormat:format(lonMinutes) if not raw then latMinSym = replaceDecimalMark(latMinutes) .. minSymbol lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol else latMinSym = latMinutes .. minSymbol lonMinSym = lonMinutes .. minSymbol end else latMinSym = latMinutes .. minSymbol lonMinSym = lonMinutes .. minSymbol end end latValue = latDegSym .. latMinSym .. latSecSym .. latDirection lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection value = latValue .. separator .. lonValue if link then globe = parseWikidataURL(datavalue['globe']) if globe then globe = mw.wikibase.getLabelByLang(globe, "en"):lower() else globe = "earth" end latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_") lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_") value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."&params="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]" end return value elseif datatype == 'wikibase-entityid' then local label local itemID = datavalue['numeric-id'] if subtype == 'wikibase-item' then itemID = "Q" .. itemID elseif subtype == 'wikibase-property' then itemID = "P" .. itemID else return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>' end label = self:getLabel(itemID, raw, link, short) if label == "" then label = nil end return label else return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>' end elseif snak.snaktype == 'somevalue' and not noSpecial then if raw then return " " -- single space represents 'somevalue' else return i18n['values']['unknown'] end elseif snak.snaktype == 'novalue' and not noSpecial then if raw then return "" -- empty string represents 'novalue' else return i18n['values']['none'] end else return nil end end function Config:getSingleRawQualifier(claim, qualifierID) local qualifiers if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end if qualifiers and qualifiers[1] then return self:getValue(qualifiers[1], true) -- raw = true else return nil end end function Config:snakEqualsValue(snak, value) local snakValue = self:getValue(snak, true) -- raw = true if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end return snakValue == value end function Config:setRank(rank) local rankPos if rank == p.flags.best then self.bestRank = true self.flagBest = true -- mark that 'best' flag was given return end if rank:sub(1,9) == p.flags.preferred then rankPos = 1 elseif rank:sub(1,6) == p.flags.normal then rankPos = 2 elseif rank:sub(1,10) == p.flags.deprecated then rankPos = 3 else return end -- one of the rank flags was given, check if another one was given before if not self.flagRank then self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before self.flagRank = true -- mark that a rank flag was given end if rank:sub(-1) == "+" then for i = rankPos, 1, -1 do self.ranks[i] = true end elseif rank:sub(-1) == "-" then for i = rankPos, #self.ranks do self.ranks[i] = true end else self.ranks[rankPos] = true end end function Config:setPeriod(period) local periodPos if period == p.flags.future then periodPos = 1 elseif period == p.flags.current then periodPos = 2 elseif period == p.flags.former then periodPos = 3 else return end -- one of the period flags was given, check if another one was given before if not self.flagPeriod then self.periods = {false, false, false} -- no other period flag given before, so unset periods self.flagPeriod = true -- mark that a period flag was given end self.periods[periodPos] = true end function Config:qualifierMatches(claim, id, value) local qualifiers if claim.qualifiers then qualifiers = claim.qualifiers[id] end if qualifiers then for _, v in pairs(qualifiers) do if self:snakEqualsValue(v, value) then return true end end elseif value == "" then -- if the qualifier is not present then treat it the same as the special value 'novalue' return true end return false end function Config:rankMatches(rankPos) if self.bestRank then return (self.ranks[rankPos] and self.foundRank >= rankPos) else return self.ranks[rankPos] end end function Config:timeMatches(claim) local startTime = nil local startTimeY = nil local startTimeM = nil local startTimeD = nil local endTime = nil local endTimeY = nil local endTimeM = nil local endTimeD = nil if self.periods[1] and self.periods[2] and self.periods[3] then -- any time return true end startTime = self:getSingleRawQualifier(claim, aliasesP.startTime) if startTime and startTime ~= "" and startTime ~= " " then startTimeY, startTimeM, startTimeD = parseDate(startTime) end endTime = self:getSingleRawQualifier(claim, aliasesP.endTime) if endTime and endTime ~= "" and endTime ~= " " then endTimeY, endTimeM, endTimeD = parseDate(endTime) end if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then -- invalidate end time if it precedes start time endTimeY = nil endTimeM = nil endTimeD = nil end if self.periods[1] then -- future if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then return true end end if self.periods[2] then -- current if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and (endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then return true end end if self.periods[3] then -- former if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then return true end end return false end function Config:processFlag(flag) if not flag then return false end if flag == p.flags.linked then self.curState.linked = true return true elseif flag == p.flags.raw then self.curState.rawValue = true if self.curState == self.states[parameters.reference] then -- raw reference values end with periods and require a separator (other than none) self.separators["sep%r"][1] = {" "} end return true elseif flag == p.flags.short then self.curState.shortName = true return true elseif flag == p.flags.multilanguage then self.curState.anyLanguage = true return true elseif flag == p.flags.unit then self.curState.unitOnly = true return true elseif flag == p.flags.mdy then self.mdyDate = true return true elseif flag == p.flags.single then self.singleClaim = true return true elseif flag == p.flags.sourced then self.sourcedOnly = true return true elseif flag == p.flags.edit then self.editable = true return true elseif flag == p.flags.editAtEnd then self.editable = true self.editAtEnd = true return true elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then self:setRank(flag) return true elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then self:setPeriod(flag) return true elseif flag == "" then -- ignore empty flags and carry on return true else return false end end function Config:processFlagOrCommand(flag) local param = "" if not flag then return false end if flag == p.claimCommands.property or flag == p.claimCommands.properties then param = parameters.property elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then self.states.qualifiersCount = self.states.qualifiersCount + 1 param = parameters.qualifier .. self.states.qualifiersCount self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])} elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then param = parameters.reference else return self:processFlag(flag) end if self.states[param] then return false end -- create a new state for each command self.states[param] = State:new(self, param) -- use "%x" as the general parameter name self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p" -- set the separator self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then self.states[param].singleValue = true end self.curState = self.states[param] return true end function Config:processSeparators(args) local sep for i, v in pairs(self.separators) do if args[i] then sep = replaceSpecialChars(args[i]) if sep ~= "" then self.separators[i][1] = {sep} else self.separators[i][1] = nil end end end end function Config:setFormatAndSeparators(state, parsedFormat) state.parsedFormat = parsedFormat state.separator = self.separators["sep"] state.movSeparator = self.separators["sep"..parameters.separator] state.puncMark = self.separators["punc"] end -- determines if a claim has references by prefetching them from the claim using getReferences, -- which applies some filtering that determines if a reference is actually returned, -- and caches the references for later use function State:isSourced(claim) self.conf.prefetchedRefs = self:getReferences(claim) return (#self.conf.prefetchedRefs > 0) end function State:resetCaches() -- any prefetched references of the previous claim must not be used self.conf.prefetchedRefs = nil end function State:claimMatches(claim) local matches, rankPos -- first of all, reset any cached values used for the previous claim self:resetCaches() -- if a property value was given, check if it matches the claim's property value if self.conf.propertyValue then matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue) else matches = true end -- if any qualifier values were given, check if each matches one of the claim's qualifier values for i, v in pairs(self.conf.qualifierIDsAndValues) do matches = (matches and self.conf:qualifierMatches(claim, i, v)) end -- check if the claim's rank and time period match rankPos = rankTable[claim.rank] or 4 matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim)) -- if only claims with references must be returned, check if this one has any if self.conf.sourcedOnly then matches = (matches and self:isSourced(claim)) -- prefetches and caches references end return matches, rankPos end function State:out() local result -- collection of arrays with value objects local valuesArray -- array with value objects local sep = nil -- value object local out = {} -- array with value objects local function walk(formatTable, result) local valuesArray = {} -- array with value objects for i, v in pairs(formatTable.req) do if not result[i] or not result[i][1] then -- we've got no result for a parameter that is required on this level, -- so skip this level (and its children) by returning an empty result return {} end end for _, v in ipairs(formatTable) do if v.param then valuesArray = mergeArrays(valuesArray, result[v.str]) elseif v.str ~= "" then valuesArray[#valuesArray + 1] = {v.str} end if v.child then valuesArray = mergeArrays(valuesArray, walk(v.child, result)) end end return valuesArray end -- iterate through the results from back to front, so that we know when to add separators for i = #self.results, 1, -1 do result = self.results[i] -- if there is already some output, then add the separators if #out > 0 then sep = self.separator[1] -- fixed separator result[parameters.separator] = {self.movSeparator[1]} -- movable separator else sep = nil result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark end valuesArray = walk(self.parsedFormat, result) if #valuesArray > 0 then if sep then valuesArray[#valuesArray + 1] = sep end out = mergeArrays(valuesArray, out) end end -- reset state before next iteration self.results = {} return out end -- level 1 hook function State:getProperty(claim) local value = {self:getValue(claim.mainsnak)} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end -- level 1 hook function State:getQualifiers(claim, param) local qualifiers if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end if qualifiers then -- iterate through claim's qualifier statements to collect their values; -- return array with multiple value objects return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook else return {} -- return empty array end end -- level 2 hook function State:getQualifier(snak) local value = {self:getValue(snak)} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end -- level 1 hook function State:getAllQualifiers(claim, param, result, hooks) local out = {} -- array with value objects local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object -- iterate through the output of the separate "qualifier(s)" commands for i = 1, self.conf.states.qualifiersCount do -- if a hook has not been called yet, call it now if not result[parameters.qualifier..i] then self:callHook(parameters.qualifier..i, hooks, claim, result) end -- if there is output for this particular "qualifier(s)" command, then add it if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then -- if there is already some output, then add the separator if #out > 0 and sep then out[#out + 1] = sep end out = mergeArrays(out, result[parameters.qualifier..i]) end end return out end -- level 1 hook function State:getReferences(claim) if self.conf.prefetchedRefs then -- return references that have been prefetched by isSourced return self.conf.prefetchedRefs end if claim.references then -- iterate through claim's reference statements to collect their values; -- return array with multiple value objects return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook else return {} -- return empty array end end -- level 2 hook function State:getReference(statement) local citeParamMapping = i18n['cite']['param-mapping'] local citeConfig = i18n['cite']['config'] local citeTypes = i18n['cite']['output-types'] -- will hold rendered properties of the reference which are not directly from statement.snaks, -- Namely, these are a backup title from "subject named as" and a URL generated from an external ID. local additionalProcessedProperties = {} -- for each citation type, there will be an associative array that associates lists of rendered properties -- to citation-template parameters local groupedProcessedProperties = {} -- like above, but only associates one rendered property to each parameter; if the above variable -- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1") local citeParams = {} local citeErrors = {} local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved local version = 11 -- increment this each time the below logic is changed to avoid conflict errors if not statement.snaks then return {} end -- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia) if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then return {} end -- don't include "type of reference" if statement.snaks[aliasesP.typeOfReference] then statement.snaks[aliasesP.typeOfReference] = nil end -- don't include "image" to prevent littering if statement.snaks[aliasesP.image] then statement.snaks[aliasesP.image] = nil end -- don't include "language" if it is equal to the local one if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then statement.snaks[aliasesP.language] = nil end if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then -- "stated in" was given but "reference URL" was not. -- get "Wikidata property" properties from the item in "stated in" -- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference -- find the "Wikidata property" properties in the item from "stated in" local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true) for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets. -- the link is in wiki markup, so strip the square brackets and the display text -- gsub also returns another, discarted value, therefore the result is assigned to tempLink first tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1") additionalProcessedProperties[aliasesP.referenceURL] = {tempLink} statement.snaks[wikidataPropertyOfSource] = nil break end end end end -- don't include "subject named as", but use it as the title when "title" is not present but a URL is if statement.snaks[aliasesP.subjectNamedAs] then if not statement.snaks[aliasesP.title] and (statement.snaks[aliasesP.referenceURL] or additionalProcessedProperties[aliasesP.referenceURL]) then additionalProcessedProperties[aliasesP.title] = {self:getReferenceDetail(statement.snaks, aliasesP.subjectNamedAs, false, false, true)} -- not raw, not linked, anyLang end statement.snaks[aliasesP.subjectNamedAs] = nil end -- initialize groupedProcessedProperties and citeParams for _, citeType in ipairs(citeTypes) do groupedProcessedProperties[citeType] = {} citeParams[citeType] = {} end -- fill groupedProcessedProperties for refProperty in pairs(statement.snaks) do -- add the parameter to each matching type of citation for _, citeType in ipairs(citeTypes) do repeat -- just a simple wrapper to emulate "continue" -- skip if there already have been errors if citeErrors[citeType] then break end -- set mappingKey and prefix local mappingKey local prefix = "" if statement.snaks[refProperty][1].datatype == 'external-id' then mappingKey = "external-id" prefix = self.conf:getLabel(refProperty) if prefix ~= "" then prefix = prefix .. " " end else mappingKey = refProperty end local paramName = citeParamMapping[citeType][mappingKey] -- skip properties with empty parameter name if paramName == "" then break end referenceEmpty = false -- handle unknown properties in the reference if not paramName then local error_message = errorText("unknown-property-in-ref", refProperty) assert(error_message) -- Should not be nil citeErrors[citeType] = error_message break end -- set processedProperty local processedProperty local raw = false -- if the value is wanted raw if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then raw = true end if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then -- Multiple values may be given. processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true else -- If multiple values are given, all but the first suitable one are discarted. processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true end if #processedProperty == 0 then break end -- add an entry to groupedProcessedProperties if not groupedProcessedProperties[citeType][paramName] then groupedProcessedProperties[citeType][paramName] = {} end for _, propertyValue in pairs(processedProperty) do table.insert(groupedProcessedProperties[citeType][paramName], prefix .. propertyValue) end until true end end -- handle additional properties for refProperty in pairs(additionalProcessedProperties) do for _, citeType in ipairs(citeTypes) do repeat -- skip if there already have been errors if citeErrors[citeType] then break end local paramName = citeParamMapping[citeType][refProperty] -- handle unknown properties in the reference if not paramName then -- Skip this additional property, but do not cause an error. break end if paramName == "" then break end referenceEmpty = false if not groupedProcessedProperties[citeType][paramName] then groupedProcessedProperties[citeType][paramName] = {} end for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do table.insert(groupedProcessedProperties[citeType][paramName], propertyValue) end until true end end -- fill citeParams for _, citeType in ipairs(citeTypes) do for paramName, paramValues in pairs(groupedProcessedProperties[citeType]) do if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then citeParams[citeType][paramName] = paramValues[1] else -- There is more than one value for this parameter - the values will -- go into separate numbered parameters (e.g. "author1", "author2") for paramNum, paramValue in pairs(paramValues) do citeParams[citeType][paramName .. paramNum] = paramValue end end end end -- handle missing mandatory parameters for the templates for _, citeType in ipairs(citeTypes) do for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do if not citeParams[citeType][requiredCiteParam] then -- The required param is not present. if citeErrors[citeType] then -- Do not override the previous error, if it exists. break end local error_message = errorText("missing-mandatory-param", requiredCiteParam) assert(error_message) -- Should not be nil citeErrors[citeType] = error_message end end end local citeTypeToUse = nil -- choose the output template for _, citeType in ipairs(citeTypes) do if not citeErrors[citeType] then citeTypeToUse = citeType break end end -- set refContent local refContent = "" if citeTypeToUse then local templateToUse = citeConfig[citeTypeToUse]["template"] local paramsToUse = citeParams[citeTypeToUse] if not templateToUse or templateToUse == "" then throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse) end -- if this module is being substituted then build a regular template call, otherwise expand the template if mw.isSubsting() then for i, v in pairs(paramsToUse) do refContent = refContent .. "|" .. i .. "=" .. v end refContent = "{{" .. templateToUse .. refContent .. "}}" else xpcall( function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end, function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end ) end -- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error. elseif not referenceEmpty then refContent = errorText("malformed-reference-header") for _, citeType in ipairs(citeTypes) do refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType]) end refContent = refContent .. errorText("malformed-reference-footer") end -- wrap refContent local ref = {} if refContent ~= "" then ref = {refContent} if not self.rawValue then -- this should become a <ref> tag, so save the reference's hash for later ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version) end return {ref} else return {} end end -- gets a detail of one particular type for a reference function State:getReferenceDetail(snaks, dType, raw, link, anyLang) local switchLang = anyLang local value = nil if not snaks[dType] then return nil end -- if anyLang, first try the local language and otherwise any language repeat for _, v in ipairs(snaks[dType]) do value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true if value then break end end if value or not anyLang then break end switchLang = not switchLang until anyLang and switchLang return value end -- gets the details of one particular type for a reference function State:getReferenceDetails(snaks, dType, raw, link, anyLang) local values = {} if not snaks[dType] then return {} end for _, v in ipairs(snaks[dType]) do -- if nil is returned then it will not be added to the table values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true end return values end -- level 1 hook function State:getAlias(object) local value = object.value local title = nil if value and self.linked then if self.conf.entityID:sub(1,1) == "Q" then title = mw.wikibase.getSitelink(self.conf.entityID) elseif self.conf.entityID:sub(1,1) == "P" then title = "d:Property:" .. self.conf.entityID end if title then value = buildWikilink(title, value) end end value = {value} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end -- level 1 hook function State:getBadge(value) value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName) if value == "" then value = nil end value = {value} -- create one value object if #value > 0 then return {value} -- wrap the value object in an array and return it else return {} -- return empty array if there was no value end end function State:callHook(param, hooks, statement, result) local valuesArray, refHash -- call a parameter's hook if it has been defined and if it has not been called before if not result[param] and hooks[param] then valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects -- add to the result if #valuesArray > 0 then result[param] = valuesArray result.count = result.count + 1 else result[param] = {} -- an empty array to indicate that we've tried this hook already return true -- miss == true end end return false end -- iterate through claims, claim's qualifiers or claim's references to collect values function State:iterate(statements, hooks, matchHook) matchHook = matchHook or alwaysTrue local matches = false local rankPos = nil local result, gotRequired for _, v in ipairs(statements) do -- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.) matches, rankPos = matchHook(self, v) if matches then result = {count = 0} -- collection of arrays with value objects local function walk(formatTable) local miss for i2, v2 in pairs(formatTable.req) do -- call a hook, adding its return value to the result miss = self:callHook(i2, hooks, v, result) if miss then -- we miss a required value for this level, so return false return false end if result.count == hooks.count then -- we're done if all hooks have been called; -- returning at this point breaks the loop return true end end for _, v2 in ipairs(formatTable) do if result.count == hooks.count then -- we're done if all hooks have been called; -- returning at this point prevents further childs from being processed return true end if v2.child then walk(v2.child) end end return true end gotRequired = walk(self.parsedFormat) -- only append the result if we got values for all required parameters on the root level if gotRequired then -- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank if rankPos and self.conf.foundRank > rankPos then self.conf.foundRank = rankPos end -- append the result self.results[#self.results + 1] = result -- break if we only need a single value if self.singleValue then break end end end end return self:out() end local function getEntityId(arg, eid, page, allowOmitPropPrefix, globalSiteId) local id = nil local prop = nil if arg then if arg:sub(1,1) == ":" then page = arg eid = nil elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then eid = arg page = nil else prop = arg end end if eid then if eid:sub(1,9):lower() == "property:" then id = replaceAlias(mw.text.trim(eid:sub(10))) if id:sub(1,1):upper() ~= "P" then id = "" end else id = replaceAlias(eid) end elseif page then if page:sub(1,1) == ":" then page = mw.text.trim(page:sub(2)) end id = mw.wikibase.getEntityIdForTitle(page, globalSiteId) or "" end if not id then id = mw.wikibase.getEntityIdForCurrentPage() or "" end id = id:upper() if not mw.wikibase.isValidEntityId(id) then id = "" end return id, prop end local function nextArg(args) local arg = args[args.pointer] if arg then args.pointer = args.pointer + 1 return mw.text.trim(arg) else return nil end end local function claimCommand(args, funcName) local cfg = Config:new() cfg:processFlagOrCommand(funcName) -- process first command (== function name) local lastArg, parsedFormat, formatParams, claims, value local hooks = {count = 0} -- set the date if given; -- must come BEFORE processing the flags if args[p.args.date] then cfg.atDate = {parseDate(args[p.args.date])} cfg.periods = {false, true, false} -- change default time constraint to 'current' end -- process flags and commands repeat lastArg = nextArg(args) until not cfg:processFlagOrCommand(lastArg) -- get the entity ID from either the positional argument, the eid argument or the page argument cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], false, args[p.args.globalSiteId]) if cfg.entityID == "" then return "" -- we cannot continue without a valid entity ID end cfg.entity = mw.wikibase.getEntity(cfg.entityID) if not cfg.propertyID then cfg.propertyID = nextArg(args) end cfg.propertyID = replaceAlias(cfg.propertyID) if not cfg.entity or not cfg.propertyID then return "" -- we cannot continue without an entity or a property ID end cfg.propertyID = cfg.propertyID:upper() if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then return "" -- there is no use to continue without any claims end claims = cfg.entity.claims[cfg.propertyID] if cfg.states.qualifiersCount > 0 then -- do further processing if "qualifier(s)" command was given if #args - args.pointer + 1 > cfg.states.qualifiersCount then -- claim ID or literal value has been given cfg.propertyValue = nextArg(args) end for i = 1, cfg.states.qualifiersCount do -- check if given qualifier ID is an alias and add it cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper() end elseif cfg.states[parameters.reference] then -- do further processing if "reference(s)" command was given cfg.propertyValue = nextArg(args) end -- check for special property value 'somevalue' or 'novalue' if cfg.propertyValue then cfg.propertyValue = replaceSpecialChars(cfg.propertyValue) if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue' else cfg.propertyValue = mw.text.trim(cfg.propertyValue) end end -- parse the desired format, or choose an appropriate format if args["format"] then parsedFormat, formatParams = parseFormat(args["format"]) elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given if cfg.states[parameters.property] then -- "propert(y|ies)" command given parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier) else parsedFormat, formatParams = parseFormat(formats.qualifier) end elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given parsedFormat, formatParams = parseFormat(formats.property) else -- "reference(s)" command given parsedFormat, formatParams = parseFormat(formats.reference) end -- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then cfg.separators["sep"..parameters.separator][1] = {";"} end -- if only "reference(s)" has been given, set the default separator to none (except when raw) if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0 and not cfg.states[parameters.reference].rawValue then cfg.separators["sep"][1] = nil end -- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent if cfg.states.qualifiersCount == 1 then cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"] end -- process overridden separator values; -- must come AFTER tweaking the default separators cfg:processSeparators(args) -- define the hooks that should be called (getProperty, getQualifiers, getReferences); -- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given for i, v in pairs(cfg.states) do -- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q" if formatParams[i] or formatParams[i:sub(1, 2)] then hooks[i] = getHookName(i, 1) hooks.count = hooks.count + 1 end end -- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...); -- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1) hooks.count = hooks.count + 1 end -- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration; -- must come AFTER defining the hooks if not cfg.states[parameters.property] then cfg.states[parameters.property] = State:new(cfg, parameters.property) -- if the "single" flag has been given then this state should be equivalent to "property" (singular) if cfg.singleClaim then cfg.states[parameters.property].singleValue = true end end -- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values, -- which must exist in order to be able to determine if a claim has any references; -- must come AFTER defining the hooks if cfg.sourcedOnly and not cfg.states[parameters.reference] then cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead end -- set the parsed format and the separators (and optional punctuation mark); -- must come AFTER creating the additonal states cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat) -- process qualifier matching values, analogous to cfg.propertyValue for i, v in pairs(args) do i = tostring(i) if i:match('^[Pp]%d+$') or aliasesP[i] then v = replaceSpecialChars(v) -- check for special qualifier value 'somevalue' if v ~= "" and mw.text.trim(v) == "" then v = " " -- single space represents 'somevalue' end cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v end end -- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated) claims = sortOnRank(claims) -- then iterate through the claims to collect values value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook -- if desired, add a clickable icon that may be used to edit the returned values on Wikidata if cfg.editable and value ~= "" then value = value .. cfg:getEditIcon() end return value end local function generalCommand(args, funcName) local cfg = Config:new() cfg.curState = State:new(cfg) local lastArg local value = nil repeat lastArg = nextArg(args) until not cfg:processFlag(lastArg) -- get the entity ID from either the positional argument, the eid argument or the page argument cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true, args[p.args.globalSiteId]) if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then return "" -- we cannot continue without an entity end -- serve according to the given command if funcName == p.generalCommands.label then value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName) elseif funcName == p.generalCommands.title then cfg.inSitelinks = true if cfg.entityID:sub(1,1) == "Q" then value = mw.wikibase.getSitelink(cfg.entityID) end if cfg.curState.linked and value then value = buildWikilink(value) end elseif funcName == p.generalCommands.description then value = mw.wikibase.getDescription(cfg.entityID) else local parsedFormat, formatParams local hooks = {count = 0} cfg.entity = mw.wikibase.getEntity(cfg.entityID) if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then cfg.curState.singleValue = true end if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then return "" -- there is no use to continue without any aliasses end local aliases = cfg.entity.aliases[cfg.langCode] -- parse the desired format, or parse the default aliases format if args["format"] then parsedFormat, formatParams = parseFormat(args["format"]) else parsedFormat, formatParams = parseFormat(formats.alias) end -- process overridden separator values; -- must come AFTER tweaking the default separators cfg:processSeparators(args) -- define the hook that should be called (getAlias); -- only define the hook if the parameter ("%a") has been given if formatParams[parameters.alias] then hooks[parameters.alias] = getHookName(parameters.alias, 1) hooks.count = hooks.count + 1 end -- set the parsed format and the separators (and optional punctuation mark) cfg:setFormatAndSeparators(cfg.curState, parsedFormat) -- iterate to collect values value = cfg:concatValues(cfg.curState:iterate(aliases, hooks)) elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then return "" -- there is no use to continue without any badges end local badges = cfg.entity.sitelinks[cfg.siteID].badges cfg.inSitelinks = true -- parse the desired format, or parse the default aliases format if args["format"] then parsedFormat, formatParams = parseFormat(args["format"]) else parsedFormat, formatParams = parseFormat(formats.badge) end -- process overridden separator values; -- must come AFTER tweaking the default separators cfg:processSeparators(args) -- define the hook that should be called (getBadge); -- only define the hook if the parameter ("%b") has been given if formatParams[parameters.badge] then hooks[parameters.badge] = getHookName(parameters.badge, 1) hooks.count = hooks.count + 1 end -- set the parsed format and the separators (and optional punctuation mark) cfg:setFormatAndSeparators(cfg.curState, parsedFormat) -- iterate to collect values value = cfg:concatValues(cfg.curState:iterate(badges, hooks)) end end value = value or "" if cfg.editable and value ~= "" then -- if desired, add a clickable icon that may be used to edit the returned value on Wikidata value = value .. cfg:getEditIcon() end return value end -- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args) local function establishCommands(commandList, commandFunc) for _, commandName in pairs(commandList) do local function wikitextWrapper(frame) local args = copyTable(frame.args) args.pointer = 1 loadI18n(aliasesP, frame) return commandFunc(args, commandName) end p[commandName] = wikitextWrapper local function luaWrapper(args) args = copyTable(args) args.pointer = 1 loadI18n(aliasesP) return commandFunc(args, commandName) end p["_" .. commandName] = luaWrapper end end establishCommands(p.claimCommands, claimCommand) establishCommands(p.generalCommands, generalCommand) -- main function that is supposed to be used by wrapper templates function p.main(frame) if not mw.wikibase then return nil end local f, args loadI18n(aliasesP, frame) -- get the parent frame to take the arguments that were passed to the wrapper template frame = frame:getParent() or frame if not frame.args[1] then throwError("no-function-specified") end f = mw.text.trim(frame.args[1]) if f == "main" then throwError("main-called-twice") end assert(p["_"..f], errorText('no-such-function', f)) -- copy arguments from immutable to mutable table args = copyTable(frame.args) -- remove the function name from the list table.remove(args, 1) return p["_"..f](args) end return p klnosw6qk6m6vbnazowivije405gt0c قالب:ويكي بيانات 10 237558 1089693 2026-04-28T15:42:35Z حبيشان 31560 استيراد من ar.wikipedia.org 1089693 wikitext text/x-wiki <includeonly>{{safesubst:#invoke:Wd|main}}</includeonly><noinclude> {{توثيق}} </noinclude> c39pgsjddot6wk947nx40ubdjtjq2jp قالب:ويكي بيانات/p106 10 237559 1089694 2026-04-28T15:42:37Z حبيشان 31560 استيراد من ar.wikipedia.org 1089694 wikitext text/x-wiki <noinclude> {{توثيق}}</noinclude><noinclude> [[تصنيف:قوالب بأسماء أجنبية]] </noinclude> 84z4rbnrjw265y0a0edyjtbn9fxfj3r قالب:ويكي بيانات/p225 10 237560 1089695 2026-04-28T15:42:39Z حبيشان 31560 استيراد من ar.wikipedia.org 1089695 wikitext text/x-wiki <includeonly>{{#invoke:Wikidata/ru|formatStatements|claim-module=Wikidata/Biology|claim-function=formatTaxonNameClaim|property=p225|value={{{1|}}}|plain={{{plain|false}}}||separator={{{separator|;<br />}}}|conjunction={{{conjunction|;<br />}}}}}<noinclude> [[تصنيف:قوالب بأسماء أجنبية]] </noinclude><noinclude> [[تصنيف:قوالب]] </noinclude><noinclude> [[تصنيف:قوالب ويكيبيديا]] </noinclude> ry6pyhj9ytgkm5qmeggcudjtuql2iwv قالب:ويكي بيانات/p348 10 237561 1089696 2026-04-28T15:42:46Z حبيشان 31560 استيراد من ar.wikipedia.org 1089696 wikitext text/x-wiki <includeonly>{{#invoke:Wikidata/ru|formatStatements|claim-module=Wikidata/Software|claim-function=formatVersionClaim|property={{#switch:{{{type|}}} |all=p348 |stable=p348[p548:q12355314] |unstable=p348[p548][!p548:q12355314] |alpha=p348[p548:q2122918] |beta=p348[p548:q3295609] |rc=p348[p548:q1072356] |test=p348[p548][!p548:q2122918][!p548:q3295609][!p548:q1072356][!p548:q12355314][!p548:q15726348] |#default=p348[!p548] }}|value={{{1|}}}|plain={{{plain|false}}}|references={{{references|true}}}|os_style={{{os_style|}}}|separator={{{separator|,<br />}}}|conjunction={{{conjunction|,<br />}}}}}</includeonly><noinclude>{{توثيق}} </noinclude> gk0z6o1gu5k0u2a4r22qiyf30lcfy4p قالب:ويكي بيانات/شرح 10 237562 1089697 2026-04-28T15:42:51Z حبيشان 31560 استيراد من ar.wikipedia.org 1089697 wikitext text/x-wiki <noinclude>{{صفحة توثيق فرعية}}</noinclude>{{#ifeq:{{ROOTPAGENAME}}|Wikidata|{{اختصار قالب|wd}} {{Lua sidebar|template={{{template|Wikidata}}}|module=Wd}} {{#ifeq:{{NAMESPACE}}:{{ROOTPAGENAME}}|Template:Wikidata|{{تقييم القالب|protected}} {{استخدام واسع|risk}}}} {{#ifeq:{{NAMESPACENUMBER}}|10|{{Lua|Module:Wd}} {{ملاحظة علوية|For a version of this template with an opt-in toggle, see {{وصلة قالب|WikidataOI}}.}}}}}} {{ملاحظة علوية|بالنسبة للوحدة التي يجب استخدامها في قوالب صناديق المعلومات بدلاً من هذا {{lcfirst:{{NAMESPACE}}}}، يرجى مراجعة [[:وحدة:WikidataIB]].}} هذا {{lcfirst:{{NAMESPACE}}}} مُعدة لجلب البيانات من '''[[ويكي بيانات]]''' مع أو بدون رابط إلى المقالة المتصلة في ويكيبيديا، وبالإضافة إلى العديد من الميزات الأخرى. {{{intro|}}} {{استخدام واسع}} == الاستخدام == البنية العامة لاستدعاء هذا {{lcfirst:{{NAMESPACE}}}} هي كما يلي. لاحظ أن البنية الأساسية تتكون من أوامر موضعية، وأعلام، ومعطيات، حيث يكون لكل منها موقع ثابت. :{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}{{0|&ensp;}}{{لون الخلفية|#cddae3|<nowiki>|command1|flag1a|flag1b|flag1c</nowiki>}}{{0|&ensp;}}{{لون الخلفية|#dce5ec|<nowiki>|command2|flag2a|flag2b|flag2c</nowiki>}}{{0|&ensp;}}{{لون الخلفية|#c1debf|<nowiki>|flag0a|flag0b|flag0c</nowiki>}}{{0|&ensp;}}{{لون الخلفية|#ffdfc4|<nowiki>|arg1|arg2|arg3</nowiki>}}}} استخدم أوامر مختلفة [[#Commands|{{لون الخلفية|#cddae3|commands}}]] للحصول على أنواع مختلفة من القيم من ويكي بيانات. يجب إعطاء أمر واحد على الأقل، ويمكن دمج أوامر متعددة في استدعاء واحد كما هو موضح أعلاه (وبأي ترتيب، ويمكن استخدام أكثر من اثنين أيضًا)، ولكن هذا ينطبق فقط على الأوامر من [[#Claim class|claim class]]؛ الاستدعاءات التي تحتوي على أمر من [[#General class|general class]] لا يمكن أن تحتوي على أي أمر آخر. يمكن أن يتبع كل أمر أي عدد من [[#Command flags|{{لون الخلفية|#cddae3|command flags}}]]، وهي اختيارية ويمكن استخدامها لتعديل المخرجات التي يولدها هذا الأمر. يمكن أن تتبع الأوامر وأعلامها أي عدد من [[#Configuration flags|{{لون الخلفية|#c1debf|configuration flags}}]]، وهي أيضًا اختيارية وتؤثر على اختيار البيانات وسلوك {{lcfirst:{{NAMESPACE}}}} بشكل عام. يتم إغلاق الاستدعاء بـ [[#Positional arguments|{{لون الخلفية|#ffdfc4|positional arguments}}]]، والتي قد تكون مطلوبة بناءً على الأوامر المعطاة. كما توجد بعض [[#Named arguments|named arguments]] (أي أزواج الاسم والقيمة)، بالإضافة إلى مجموعة من الأعلام المسماة لـ [[#Advanced usage|الاستخدام المتقدم]] التي يمكن استخدامها لتغيير الطريقة التي يتم بها دمج القيم المسترجعة في المخرجات. تم تصميم هذا {{lcfirst:{{NAMESPACE}}}} لتلبية الاحتياجات الأساسية لجلب البيانات من ويكي بيانات، ولكن يمكن تحقيق الكثير من خلال تركيبات مختلفة من الاستدعاءات. لسهولة الاستخدام، يمكن الاستفادة من هذه التركيبات في قوالب جديدة تلبي حاجة معينة. راجع أيضًا قسم [[#حالات الاستخدام الشائعة]] أدناه لبعض الأمثلة على "البناءات الأساسية" المفيدة. وبالمثل، يمكن توسيع وظائف هذا {{lcfirst:{{NAMESPACE}}}} من خلال إنشاء قوالب تستخدم [[وحدة:Wd]] المقدمة من {{وحدة أخرى|هذا الموديول|[[وحدة:Wd]] الذي يستخدمه هذا القالب}} (مثلما في {{وصلة قالب|WikidataOI}}). === حالات الاستخدام الشائعة === فيما يلي قائمة بحالات الاستخدام الشائعة. في المستقبل، قد يتم تنفيذ أوامر مختصرة تكون مكافئة لهذه الاستدعاءات لتسهيل استخدامها. {| class="wikitable" |- ! الخلية ! حالة الاستخدام |- | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|label|raw|{{{extraparams|}}}}}}} | ويكي بيانات هي تخص العنصر المتصل بالصفحة الحالية (مثل "Q55"). |- | {{بدون لف|<code><nowiki>{{#if:</nowiki>{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|label|raw|{{{extraparams|}}}}}<nowiki>|...}}</nowiki></code>}} | يقوم بإجراء فحص لتحديد ما إذا كانت الصفحة الحالية تحتوي على معرف ويكي بيانات. لاحظ أن هذا البيان يعتمد على قيمة مُرجعة إما فارغة أو غير فارغة وأن تضمين الوسيط <code>raw</code> هو أمر مهم. بدون هذا الوسيط، سيتم إرجاع التسمية العادية المعرف الموجود، والتي قد تكون فارغة، مما يؤدي إلى نتيجة غير مرغوبة. من ناحية أخرى، إذا تم تضمين الوسيط، فسيتم دائمًا إرجاع معرف ويكي بيانات غير فارغ إذا كان المعرف موجودًا، وقيمة فارغة إذا لم يكن المعرف موجودًا. |} == الأوامر == تحدد الأوامر (<code>{{لون الخلفية|#cddae3|command1}}</code>, <code>{{لون الخلفية|#dce5ec|command2}}</code>, ...) نوع القيم التي يتم إرجاعها. يمكن أن يحتوي الاستدعاء الواحد فقط على أوامر من فئة واحدة. === فئة الادعاءات === يمكن دمج أوامر فئة الادعاءات، مما يعني أنه يمكن إعطاء أوامر متعددة من أنواع مختلفة من هذه الفئة في وقت واحد (راجع الاستخدام أعلاه). يمكن دمج أوامر متعددة في استدعاء واحد لهذه الـ {{lcfirst:{{NAMESPACE}}}}، بدلاً من إجراء استدعاءات متعددة لهذه الـ {{lcfirst:{{NAMESPACE}}}} مع أمر واحد في كل مرة، للتأكد من أن جميع أجزاء المعلومات المرتجعة تنتمي لبعضها البعض (راجع الأمثلة أدناه أيضًا). {| class="wikitable" |- ! النوع ! الأمر ! يُرجع ! الاستخدام الأساسي ! الوصف |- | rowspan="2" style="text-align:right;" | I ! style="text-align:right;" | <code>property</code> | {{صغير|أول تطابق{{ملا|يُرجع قيمة واحدة فقط بدلاً من متعددة (إذا تطابقت ادعاءات أو بيانات متعددة). القيمة المرتجعة هي '''أول تطابق يتم العثور عليه من بين أفضل الادعاءات مرتبة'''.}}}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|property|P1|{{{extraparams|}}}}}}} | rowspan="2" | يُرجع الخاصية المطلوبة – أو قائمة بالخصائص – من الكيان الحالي أو من كيان معين. يمكن إعطاء هذا الأمر مرة واحدة فقط في استدعاء واحد. |- ! style="text-align:right;" | <code>properties</code> | {{صغير|كل التطابقات}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|properties|P1|{{{extraparams|}}}}}}} |- | colspan="5" | |- | rowspan="2" style="text-align:right;" | II ! style="text-align:right;" | <code>qualifier</code> | {{صغير|أول تطابق{{ملا|يُرجع قيمة واحدة فقط بدلاً من متعددة لكل ادعاء متطابق. للحصول على أكثر من قيمة واحدة في المجموع في حالة عدم استخدام أمر <code>property</code> أيضًا، استخدم أيضًا [[#Configuration flags|علامة التكوين <code>single</code>]].|name=fm}}}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|qualifier|P1|P2|{{{extraparams|}}}}}}} | rowspan="2" | يُرجع المؤهل المطلوب – أو قائمة المؤهلات – من الخاصية المعطاة للكيان الحالي أو لكيان معين. على عكس الأوامر الأخرى لفئة الادعاءات، يمكن إعطاء هذا الأمر عدة مرات لاسترجاع مؤهلات مختلفة في استدعاء واحد. |- ! style="text-align:right;" | <code>qualifiers</code> | {{صغير|كل التطابقات}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|qualifiers|P1|P2|{{{extraparams|}}}}}}} |- | colspan="5" | |- | rowspan="2" style="text-align:right;" | III ! style="text-align:right;" | <code>reference</code> | {{صغير|أول تطابق{{ملا|name=fm}}}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|reference|P1|{{{extraparams|}}}}}}} | rowspan="2" | يُرجع مرجعًا – أو قائمة مراجع – من الخاصية المعطاة للكيان الحالي أو لكيان معين.{{ملا|راجع [[#References|القسم عن المراجع]] للحصول على التفاصيل.}} يمكن إعطاء هذا الأمر مرة واحدة فقط في استدعاء واحد. |- ! style="text-align:right;" | <code>references</code> | {{صغير|كل التطابقات}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|references|P1|{{{extraparams|}}}}}}} |- | colspan="5" | |- | colspan="5" style="text-align:right;" | {{ملاحظات}} |} === General class === The general class commands cannot be combined. {| class="wikitable" |- ! Type ! Command ! Returns ! Basic usage ! Description |- | style="text-align:right;" | I ! style="text-align:left;" | <code>label</code> | | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|label|{{{extraparams|}}}}}}} | Returns the label of the current item-entity or of a given entity if present. |- | colspan="5" | |- | style="text-align:right;" | II ! style="text-align:left;" | <code>title</code> | | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|title|{{{extraparams|}}}}}}} | Returns the title of the page connected to the current item-entity or to a given item-entity if such page exists. |- | colspan="5" | |- | style="text-align:right;" | III ! style="text-align:left;" | <code>description</code> | | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|description|{{{extraparams|}}}}}}} | Returns the description of the current item-entity or of a given entity if present. |- |- | colspan="5" | |- | rowspan="2" style="text-align:right;" | IV ! style="text-align:left;" | <code>alias</code> | {{صغير|first match{{ملا|Returns only a single value instead of multiple (if multiple values are present).|name=fmg}}}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|alias|{{{extraparams|}}}}}}} | rowspan="2" | Returns an alias – or list of aliases – of the current item-entity or of a given entity if present. |- ! style="text-align:left;" | <code>aliases</code> | {{صغير|all matches}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|aliases|{{{extraparams|}}}}}}} |- | colspan="5" | |- | rowspan="2" style="text-align:right;" | V ! style="text-align:left;" | <code>badge</code> | {{صغير|first match{{ملا|name=fmg}}}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|badge|{{{extraparams|}}}}}}} | rowspan="2" | Returns a badge – or list of badges – for the page connected to the current item-entity or to a given item-entity if such page exists. |- ! style="text-align:left;" | <code>badges</code> | {{صغير|all matches}} | {{بدون لف|{{Tnull|{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}|badges|{{{extraparams|}}}}}}} |- | colspan="5" | |- | colspan="5" style="text-align:left;" | {{ملاحظات}} |} == Flags == The following (optional) flags are available which can be used to alter this {{lcfirst:{{NAMESPACE}}}}'s behaviour. They must be given after the (first) {{لون الخلفية|#cddae3|command}} and before the {{لون الخلفية|#ffdfc4|positional arguments}}. For convenience, empty flags (i.e. <code>||</code>) are allowed and will simply be ignored. === Command flags === These flags (<code>{{لون الخلفية|#cddae3|flag1*}}</code>, <code>{{لون الخلفية|#dce5ec|flag2*}}</code>, ...) apply to the command that precedes them directly. {| class="wikitable" |- ! Flag ! Description |- ! style="text-align:left;" | <code>raw</code> | Returns the raw value if applicable. If this flag is used with item or property datatypes, then this will return the Q-identifier or P-identifier instead of the regular label. For quantity datatypes, this flag will strip off any units of measurement, unless the <code>unit</code> flag is also given in which case the raw unit of measurement (its Q-identifier) will be returned. If this flag is used with time datatypes, then the returned date will be in the format of <code>yyyy-mm-dd</code> (e.g. <code>1731-02-11</code>), or <code>yyyy-mm</code>, or <code>yyyy</code> depending on the date's precision. Dates in the Julian calendar stored with a precision of days through millenniums will have <code>/Julian</code> attached to the output (e.g. <code>1731-02-11/Julian</code>, which may be split off using the [[mw:Help:Extension:ParserFunctions#.23titleparts|<nowiki>{{#titleparts}}</nowiki> parser function]]). If it is used with globe coordinate datatypes, then it replaces the various symbols with forward slashes in the returned value (e.g. <code>52/5/3/N/4/19/3/E</code>, which may be split into parts using the [[mw:Help:Extension:ParserFunctions#.23titleparts|<nowiki>{{#titleparts}}</nowiki> parser function]]). |- ! style="text-align:left;" | <code>linked</code> | Creates a link to the Wikipedia article that is connected to the property or qualifier if it exists. Also links units of measurement that may be appended to values. If this parameter is omitted, then the plain property or qualifier value will be returned. |- ! style="text-align:left;" | <code>short</code> | '''<code>{{لون|red|[EXPENSIVE]}}</code>''' Returns the {{خاصية|P1813}} of any entity returned if they have one attached. If that is not the case, then the default behaviour of returning the entity's label will occur. |- ! style="text-align:left;" | <code>multilanguage</code> | Returns monolingual text values in any available language, not just the current wiki's language. |- ! style="text-align:left;" | <code>unit</code> | Returns only the unit of measurement for quantity datatypes. |} === Configuration flags === These flags (<code>{{لون الخلفية|#c1debf|flag0*}}</code>) are general configuration flags and can be given anywhere after the first {{لون الخلفية|#cddae3|command}} (but before the {{لون الخلفية|#ffdfc4|positional arguments}}). {| class="wikitable" |- ! ! Flag ! Description ! Command class |- | rowspan="4" style="text-align:right;" | {{بدون لف|Combination of:}} ! style="text-align:left;" | <code>preferred</code> | rowspan="4" | Sets a rank constraint for the selected claim(s). The first three set the ranks for which claim(s) will be selected. They can optionally be followed by a <code>+</code> or a <code>-</code>, e.g. <code>normal+</code> or <code>preferred-</code>, where the first selects claims with a 'normal' rank ''or higher'' and the second selects claims with a 'preferred' rank ''or lower''. To get claims of all ranks, use <code>preferred-</code> or <code>deprecated+</code>. If the <code>best</code> flag is given additionally, then only the claims that have the highest rank amongst the selected claims will be returned. The default is <code>normal+|best</code> (so by default claims with a 'deprecated' rank are never returned). Output is always sorted from highest rank to lowest (regardless of any of these flags being set). | rowspan="4" | [[#Claim class|claim]] |- ! style="text-align:left;" | <code>normal</code> |- ! style="text-align:left;" | <code>deprecated</code> |- ! style="text-align:left;" | <code>best</code> |- | rowspan="3" style="text-align:right;" | {{بدون لف|Combination of:}} ! style="text-align:left;" | <code>future</code> | rowspan="3" | Sets a time constraint for the selected claim(s). Uses the claims' qualifiers of {{خاصية|P580}} and {{خاصية|P582}} to determine if the claim is valid for the selected time period(s). The default is <code>future|current|former</code> (so by default claims that are valid for any time period are returned), except when <code>date=</code> is given ([[#Named arguments|see below]]) in which case the default is <code>current</code>. | rowspan="3" | claim |- ! style="text-align:left;" | <code>current</code> |- ! style="text-align:left;" | <code>former</code> |- | ! style="text-align:left;" | <code>mdy</code> | Returns date values in month-day-year order instead of day-month-year order. | claim |- | ! style="text-align:left;" | <code>single</code> | Returns only a single claim instead of multiple (if multiple claims match). Has no effect if the <code>property</code>/<code>properties</code> command is given, in which case this flag would be redundant. | claim |- | ! style="text-align:left;" | <code>sourced</code> | Only returns claims that have at least one non-empty reference. (References having only [[#Ignored parameters|ignored parameters]] are considered empty.) | claim |- | rowspan="2" style="text-align:right;" | {{بدون لف|One of:}} ! style="text-align:left;" | <code>edit</code> | rowspan="2" | Adds a clickable icon after the output that may be used by readers to edit the returned claim on Wikidata. If <code>edit@end</code> is used, then the icon will be placed at the end of the line for neat alignment in infoboxes. | rowspan="2" | claim, [[#General class|general]] |- ! style="text-align:left;" | <code>edit@end</code> |- style="display:none;" | colspan="4" | <!-- non-displayed row to avoid breaking table with sticky headers gadget --> |} == Arguments == The arguments determine the sources from which all the returned values are fetched. === Positional arguments === The following table shows the available positional arguments (<code>{{لون الخلفية|#ffdfc4|arg*}}</code>) in their fixed order. For each command, the applicable set of arguments is marked. If multiple commands are given, then the applicable set is the union of the individual sets. For instance, if the commands <code>properties</code> and <code>qualifiers</code> have been given, then at least both the arguments <code>property_id</code> and <code>qualifier_id</code> should be given as well. More than one <code>qualifier</code>/<code>qualifiers</code> command can be given. The order in which these commands with their flags are given matches the order in which the respective <code>qualifier_id</code> arguments are given. {| class="wikitable" style="background:none;border:none;" |- style="text-align:center;" | rowspan="2" style="background:none;border:none;" | | colspan="2" | {{صغير|''(required)''}} | {{صغير|{{لون|#777|''(optional)''}}}} | {{صغير|{{لون|#777|(optional)}}}} | {{صغير|(required)}} | {{صغير|{{لون|#777|(optional)}}}} | {{صغير|(required)}} | {{صغير|(required)}} | rowspan="2" style="background:none;border:none;" | |- | colspan="2" | | | | | | | |- | style="border-right:2px solid #000;" | ''<code><nowiki>{{</nowiki>{{{prename|}}}{{lcfirst:{{ROOTPAGENAME}}}}</code>'' | colspan="2" style="border-right:2px solid #000;" | ''<code>commands</code>'' | style="border-right:2px solid #000;" | ''<code style="color:#777;">flags</code>'' ! style="border-right:2px solid #000;background-color:#ffdfc4;" | <code style="color:#777;">entity_id</code> ! style="border-right:2px solid #000;background-color:#ffdfc4;" | <code>property_id</code> ! style="border-right:2px solid #000;background-color:#ffdfc4;" | <code style="color:#777;">raw_value</code> ! style="border-right:2px solid #000;background-color:#ffdfc4;" | <code>qualifier_id</code> ! style="background-color:#ffdfc4;" | <code>qualifier_id</code> | ''<code><nowiki>}}</nowiki></code>'' |- | rowspan="12" colspan="2" style="background:none;border:none;" | | rowspan="2" colspan="2" style="border-style:dashed;border-left-color:blue;border-bottom-color:blue;" | | | | | | | rowspan="12" style="background:none;border:none;" | |- style="text-align:center;" | rowspan="2" | <code>label</code>, <code>title</code>,<br /><code>description</code>,<br /><code>alias</code>/<code>aliases</code>,<br /><code>badge</code>/<code>badges</code> | rowspan="2" style="border-top:none;border-bottom:none;" | | rowspan="2" style="border-top:none;border-bottom:none;" | | rowspan="2" style="border-top:none;border-bottom:none;" | | rowspan="2" style="border-top:none;border-bottom:none;" | |- | rowspan="2" colspan="2" style="border-style:dashed;border-left-color:blue;border-bottom-color:blue;" | |- style="text-align:center;" | rowspan="2" colspan="2" style="border-top:none;" | <code>property</code>/<code>properties</code> | rowspan="2" style="border-top:none;border-bottom:none;" | | rowspan="2" style="border-top:none;border-bottom:none;" | | rowspan="2" style="border-top:none;border-bottom:none;" | |- | rowspan="2" colspan="2" style="border-style:dashed;border-left-color:blue;border-bottom-color:blue;" | |- style="text-align:center;" | rowspan="2" colspan="3" style="border-top:none;" | <code>reference</code>/<code>references</code> | rowspan="2" style="border-top:none;border-bottom:none;" | | rowspan="2" style="border-top:none;border-bottom:none;" | |- | rowspan="2" colspan="2" style="border-style:dashed;border-left-color:blue;border-bottom-color:blue;" | |- style="text-align:center;" | rowspan="2" colspan="4" style="border-top:none;" | <code>qualifier</code>/<code>qualifiers</code> | rowspan="2" style="border-top:none;border-bottom:none;" | |- | rowspan="2" colspan="2" style="border-style:dashed;border-left-color:blue;border-bottom-color:blue;" | |- style="text-align:center;" | rowspan="2" colspan="5" style="border-top:none;" | <code>qualifier</code>/<code>qualifiers</code> ''(optional 2<sup>nd</sup>, 3<sup>rd</sup>, etc.)'' |- | rowspan="2" colspan="2" style="border:none;" | |- | colspan="5" style="border:none;" | |} Below follows a description of all positional arguments. {| class="wikitable" |- ! Argument ! Description |- ! style="text-align:left;" | <code style="color:#777;">entity_id</code> {{صغير|{{لاغليظ|(optional)}}}} | '''<code>{{لون|red|[EXPENSIVE]}}</code>''' '''Q-identifier''' of the item-entity to be accessed (e.g. <code>Q55</code>), '''P-identifier''' (or an available '''[[#Property aliases|alias]]''') of the property-entity to be accessed preceded by the <code>Property:</code> prefix (e.g. <code>Property:P38</code>), or '''page title''' of the Wikipedia article whose connected item-entity is to be accessed preceded by <code>:</code>, a prefixed colon (e.g. <code>:Netherlands</code>). In case of the [[#General class|general class commands]], the <code>Property:</code> prefix may be omitted for P-identifiers (e.g. <code>P38</code>). If this parameter is omitted, then the item-entity connected to the current page will be used (except when <code>eid=</code> or <code>page=</code> is given, [[#Named arguments|see below]]). If this parameter is given, but empty (i.e. <code>&#124;&#124;</code>), then due to its position it will be interpreted as an [[#Flags|empty flag]] and thus be ignored, giving the same result as if it were omitted. See also the [[#Named arguments|named arguments <code>eid=</code> and <code>page=</code>]] below that can be used to give an entity-ID or page title too, but without the item-entity connected to the current page being used as a default. |- ! style="text-align:left;" | <code>property_id</code> | '''P-identifier''' (or an available '''[[#Property aliases|alias]]''') of the property within the entity to be accessed, without the <code>Property:</code> prefix (e.g. <code>P35</code>). |- ! style="text-align:left;" | <code style="color:#777;">raw_value</code> {{صغير|{{لاغليظ|(optional)}}}} | Either the '''Q-identifier''' equal to the property value (e.g. <code>Q29574</code>) or a '''literal value''' (i.e. string or quantity etc., ''no entity label'') equal to the raw property value of the particular claim to be accessed. Dates as literal values must be formatted <code>yyyy-mm-dd</code> (e.g. <code>1731-02-11</code>) for dates with a precision of days, <code>yyyy-mm</code> (e.g. <code>1731-02</code>) for dates with a precision of months, and <code>yyyy</code> (e.g. <code>1731</code>) for dates of lesser precision. Dates BCE require a minus sign in front of the year (e.g. <code>-2950-01-31</code>). Dates stored in the Julian calendar must have <code>/Julian</code> attached to the end (e.g. <code>1731-02-11/Julian</code>). Decades like the 2010s must be given as <code>2010</code> (but the 2010s BCE as <code>-2019</code>), centuries like the 20th century as <code>1901</code> (but the 20th century BCE as <code>-2000</code>), and millenniums like the 3rd millennium as <code>2001</code> (but the 3rd millennium BCE as <code>-3000</code>). Globe coordinates as literal values must be formatted with forward slashes (i.e. <code>/</code>) between the parts and no symbols (e.g. <code>52/5/3/N/4/19/3/E</code>) ''without any spaces or leading zeros''. The special type &#39;'''no value'''&#39; can be given by entering the empty string (i.e. <code>&#124;&#124;</code>) and the special type &#39;'''unknown value'''&#39; can be given by entering a single underscore (i.e. <code>&#124;_&#124;</code>). To get a literal underscore, escape it by placing a backslash <code>\</code> directly in front of it (i.e. <code>\_</code>); the same holds for a literal backslash (i.e. <code>\\</code>). To get a literal vertical bar <code>|</code>, use <code>{{وصلة قالب|!}}</code> or <code>&amp;#124;</code>. If this parameter is omitted, then all claims (matching any other constraints) within the property will be accessed. |- ! style="text-align:left;" | <code>qualifier_id</code> | '''P-identifier''' (or an available '''[[#Property aliases|alias]]''') of the qualifier within the entity to be accessed, without the <code>Property:</code> prefix (e.g. <code>P580</code>). |} === Named arguments === Below follows a description of all named arguments, which are name-value pairs (i.e. <code>|name=value</code>). These are all optional and can be given anywhere {{وحدة أخرى|after the first command|inside the call}}. {| class="wikitable" |- ! Argument ! Description ! Command class |- ! style="text-align:right;" | <code>eid=</code> | '''<code>{{لون|red|[EXPENSIVE]}}</code>''' This argument can be used to give the '''Q-identifier''' (e.g. <code>&#124;eid=Q55</code>) or '''P-identifier''' (or an available '''[[#Property aliases|alias]]''') of the entity to be accessed. It offers the same functionality as the [[#Positional arguments|positional argument <code>entity_id</code>]], with one difference: if the argument is given but its value is left empty (i.e. <code>&#124;eid=</code>), then no entity is accessed at all instead of the item-entity connected to the current page. This is useful in some cases where a variable entity-ID is expected, but where the item-entity connected to the current page should not be accessed as the default. Also, the <code>Property:</code> prefix may be omitted for P-identifiers (e.g. <code>&#124;eid=P38</code>) for all commands. This argument only has effect if the positional argument <code>entity_id</code> is omitted. | [[#Claim class|claim]]، [[#General class|general]] |- ! style="text-align:right;" | <code>page=</code> | '''<code>{{لون|red|[EXPENSIVE]}}</code>''' This argument can be used to give the '''page title''' (e.g. <code>&#124;page=Netherlands</code>) of the Wikipedia article whose connected item-entity is to be accessed. It behaves similar to the named argument <code>eid=</code> and can be used instead of the [[#Positional arguments|positional argument <code>entity_id</code>]] (note that no prefixed colon, <code>:</code>, is required). If the argument is given but its value is left empty (i.e. <code>&#124;page=</code>), then no entity is accessed at all instead of the item-entity connected to the current page. This argument only has effect if the positional argument <code>entity_id</code> and the named argument <code>eid=</code> are omitted. | claim, general |- ! style="text-align:right;" | <code>date=</code> | This argument can be used to set a particular date (e.g. <code>&#124;date=1731-02-11</code>) relative to which claim matching using the [[#Configuration flags|<code>future</code>, <code>current</code> and <code>former</code> flags]] is done, instead of relative to today. It overrides the default of these flags to <code>current</code> so that by default only claims that were valid at the given date are returned (based on the claims' qualifiers of {{خاصية|P580}} and {{خاصية|P582}}). The date value must be formatted <code>yyyy-mm-dd</code> (e.g. <code>1731-02-11</code>), <code>yyyy-mm</code> (e.g. <code>1731-02</code>) or <code>yyyy</code> (e.g. <code>1731</code>). | claim |- ! style="text-align:right;" | <code>''<qualifier>''=</code> | The <code>''<qualifier>''</code> is a placeholder for a set of arguments that determine which claims should be accessed based on qualifier value, analogous to the pair of [[#Positional arguments|positional arguments <code>property_id</code> and <code>raw_value</code>]] (that determine access based on property value). As such, <code>''<qualifier>''</code> is any qualifier's '''P-identifier''' (or an available '''[[#Property aliases|alias]]''') without the <code>Property:</code> prefix (e.g. <code>P518</code>). Its value is either the '''Q-identifier''' equal to one of the qualifier values (e.g. <code>Q27561</code>) or a '''literal value''' (i.e. string or quantity etc., ''no entity label'') equal to one of the raw qualifier values of the particular claim to be accessed. The value format is the same as for the positional argument <code>raw_value</code>. The special type &#39;'''no value'''&#39; given by the empty string also matches the total absence within the claim of the particular qualifier. Example: <code>|P518=Q27561</code> Multiple arguments of this type can be given to match multiple qualifier values simultaneously for each claim. | claim |} === أسماء الخصائص المستعارة === '''الخصائص المستعارة''' هي أسماء أخرى يمكن استخدامها بدلاً من معرفات الخواص. الخصائص المستعارة التالية (والتي تكون [[حساسية حالة الأحرف|حساسة لحالة الأحرف]]) متاحة حاليًا: {| class="wikitable" |- ! P-identifier ! <sub>يترجم<br /></sub><sup>إلى</sup> ! الاسم المستعار ! بالانجليزية |- <!-- property aliases purely for convenience --> |- | ! | | |- <!-- property aliases used by the module itself --> |- | {{خاصية|50}} || style="text-align: center;" | ← || المؤلف || author |- | {{خاصية|2093}} || style="text-align: center;" | ← || اسم المؤلف || authorNameString |- | {{خاصية|123}} || style="text-align: center;" | ← || الناشر || publisher |- | {{خاصية|143}} || style="text-align: center;" | ← || مستورد من || importedFrom |- | {{خاصية|4656}} || style="text-align: center;" | ← || وصلة استيراد ويكيميديا || wikimediaImportURL |- | {{خاصية|248}} || style="text-align: center;" | ← || مذكور في || statedIn |- | {{خاصية|304}} || style="text-align: center;" | ← || الصفحات || pages |- | {{خاصية|407}} || style="text-align: center;" | ← || اللغة || language |- | {{خاصية|527}} || style="text-align: center;" | ← ||لديه جزء || hasPart |- | {{خاصية|577}} || style="text-align: center;" | ← || تاريخ النشر || publicationDate |- | {{خاصية|580}} || style="text-align: center;" | ← || وقت البدء || startTime |- | {{خاصية|582}} || style="text-align: center;" | ← || وقت الانتهاء || endTime |- | {{خاصية|792}} || style="text-align: center;" | ← || الفصل || chapter |- | {{خاصية|813}} || style="text-align: center;" | ← || مُسترد || retrieved |- | {{خاصية|854}} || style="text-align: center;" | ← || وصلة المرجع || referenceURL |- | {{خاصية|958}} || style="text-align: center;" | ← || القسم أو الآية أو الفقرة || sectionVerseOrParagraph |- | {{خاصية|1065}} || style="text-align: center;" | ← || مسار الأرشيف || archiveURL |- | {{خاصية|1476}} || style="text-align: center;" | ← || العنوان || title |- | {{خاصية|1630}} || style="text-align: center;" | ← || المسار المنسق || formatterURL |- | {{خاصية|1683}} || style="text-align: center;" | ← || الاقتباس || quote |- | {{خاصية|1813}} || style="text-align: center;" | ← || الاسم المختصر || shortName |- | {{خاصية|2534}} || style="text-align: center;" | ← || تعريف الصيغة || definingFormula |- | {{خاصية|2960}} || style="text-align: center;" | ← || تاريخ الأرشيف || archiveDate |- | {{خاصية|3452}} || style="text-align: center;" | ← || مستنتج من || inferredFrom |- | {{خاصية|3865}} || style="text-align: center;" | ← || نوع المرجع || typeOfReference |- | {{خاصية|3903}} || style="text-align: center;" | ← || العمود || column |- | {{خاصية|1810}} || style="text-align: center;" | ← || الموضوع باسم || subjectNamedAs |- | {{خاصية|1687}} || style="text-align: center;" | ← || خاصية ويكي بيانات || wikidataProperty |} == مراجع == When either the <code>reference</code> or the <code>references</code> command is used and a reference is encountered (in Wikidata), the module checks if the reference contains an {{خاصية|P143}}, {{خاصية|P3452}} or {{خاصية|P4656}} property. In the case one of these properties is present, the whole reference is ignored (i.e. it is treated as if it wasn't present). Else, the module attempts to display the reference using the {{وصلة قالب|Cite web}} template. The reference has to have a {{خاصية|P854}} property. The below table shows the mapping of Wikidata properties to parameters of Cite web. <!-- The information in the table is from Module:wd/i18n. --> {| class="wikitable" |+ !Wikidata property !Parameter of Cite web !Notes |- |{{خاصية|P2960}} |archive-date | |- |{{خاصية|P1065}} |archive-url | |- |{{خاصية|P50}} | rowspan="2" |author/authorN | rowspan="2" |N can be 1, 2, 3... |- |{{خاصية|P2093}} |- |{{خاصية|P407}} |language |Ignored when the same as the local language. |- |{{خاصية|P304}} |pages | |- |{{خاصية|P577}} |date | |- |{{خاصية|P123}} |publisher | |- |{{خاصية|P1683}} |quote | |- |{{خاصية|P854}} |url | |- |{{خاصية|P813}} |access-date | |- |{{خاصية|P958}} |at | |- |{{خاصية|P248}} |website | |- |{{خاصية|P1810}} |title |Used only when {{خاصية|P1476}} is not present, but a URL (either from {{خاصية|P854}} or from an external identifier, as described below) is, otherwise ignored. |- |{{خاصية|P1476}} |title | |} {{علامة موقع|Ignored parameters}}The following properties are ignored: {{خاصية|P18}}, {{خاصية|P3865}}. If there is no {{خاصية|P854}} property present in the reference, but a property of the "External identifier" [[d:Help:Data type|data type]] is present both in the reference and in the {{خاصية|1687}} of the item in {{خاصية|P248}}, a URL is generated from its content and is used in the same manner as a URL given in {{خاصية|P854}}. If there is no {{خاصية|P854}} property, or the reference has unknown properties, the module attempts to display it using the {{وصلة قالب|Cite Q}} template. The {{خاصية|P248}} property is mandatory. The below table shows the mapping of properties to Cite Q parameters. {| class="wikitable" |+ !Wikidata property !Parameter of Cite Q !Notes |- |{{خاصية|P248}} |1 |Value supplied to the parameter is ''raw'', i.e. it is just the plain QID. |- |{{خاصية|P792}} |chapter | |- |{{خاصية|P3903}} |at | |- |{{خاصية|P304}} |pages | |- |{{خاصية|P577}} |date | |- |{{خاصية|P813}} |access-date | |- |{{خاصية|P958}} |section | |- |{{خاصية|P1476}} |title | |- |any property of the "External identifier" data type |id |The label ("name") of the property is prepended before its content. |} The properties listed ''under'' the first table (in this section) are also ignored when using Cite Q. A reference could be displayed using Cite Q only if the reference has a {{خاصية|P248}} property and has only properties listed in the table above. If neither Cite web nor Cite Q could be used to display a reference, the following error is returned: <blockquote> <span style="color: #d33"> Error: Unable to display the reference properly. See [[وحدة:wd/doc#References|the documentation]] for details. </span> </blockquote> To fix this error, check if the reference has the required properties and doesn't have any unknown properties, as described above. The [[d:Help:Sources|Wikidata help page on references]] can also be helpful when sourcing statements. == Advanced usage == The layout of the output from (a combination of) commands that have both a singular and a plural form (e.g. <code>property</code>/<code>properties</code>) can be customized by using a number of named flags, which are name-value pairs (i.e. <code>|flag=value</code>), that can be given anywhere {{وحدة أخرى|after the first command|inside the call}}. The table below shows the available named flags. To insert a space at the beginning or end of a <code>value</code>, use an underscore <code>_</code>. To get a literal underscore, escape it by placing a backslash <code>\</code> directly in front of it (i.e. <code>\_</code>); the same holds for a literal backslash (i.e. <code>\\</code>). To get a literal vertical bar <code>|</code>, use <code>{{وصلة قالب|!}}</code> or <code>&amp;#124;</code>. {| class="wikitable" |- ! Named flag ! Default value ! Default condition ! Description |- ! rowspan="6" style="text-align:right;" | <code>format=</code> | <code>%p[%s][%r]</code> | if the <code>property</code>/<code>properties</code> command '''was''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was not''' given | rowspan="6" | The format of a single claim. The available parameters are as follows. {| class="wikitable" |- ! Parameter ! Description |- | <code>%p</code> | The claim's property value applied by the <code>property</code>/<code>properties</code> command. |- | <code>%q1</code>, <code>%q2</code>, <code>%q3</code>, ... | The claim's qualifier value or list of qualifier values applied by the corresponding <code>qualifier</code>/<code>qualifiers</code> command. |- | <code>%q</code> | The collection of the qualifier values applied by each <code>qualifier</code>/<code>qualifiers</code> command (i.e. <code>%q1</code> + <code>%q2</code> + <code>%q3</code> + ...). If only one <code>qualifier</code>/<code>qualifiers</code> command was given, then this parameter is equivalent to <code>%q1</code>. |- | <code>%r</code> | The claim's reference value or list of reference values applied by the <code>reference</code>/<code>references</code> command. |- | <code>%a</code> | The entity's alias applied by the <code>alias</code>/<code>aliases</code> command. |- | <code>%b</code> | The entity's page badge applied by the <code>badge</code>/<code>badges</code> command. |- | <code>%s</code> | The movable separator placeholder. This is a special parameter that is not applied by a command, but instead is filled automatically between each pair of claims, aliases or badges (if a list of claims, aliases or badges is returned). This is particularly handy in case a claim's reference is returned as well, since it allows the reference to be placed after the punctuation mark as prescribed by [[ويكيبيديا:دليل الأسلوب]]. The default value is a comma (<code>,</code>) and can be overridden with the <code>sep%s</code> flag (see below). |} Optional parameters can be given by encapsulating them between square brackets: <code>[...]</code>. All content between the square brackets is only displayed if a value for each optional parameter that has been defined between the same brackets has been found. Optional content can also be nested. To use two opening square brackets that directly follow each other (i.e. <code>{{Open wikilink}}</code>), use <code>{{وصلة قالب|!((}}</code>. At least one parameter must be given that is not optional, while the <code>%s</code> parameter must always be defined as optional. To get a literal <code>[</code>, <code>]</code>, <code>%</code> or <code>\</code>, escape the character by placing a backslash <code>\</code> directly in front of it (e.g. <code>\%</code>). See also the description directly above this table for more. |- | <code>%q[%s][%r]</code> | if the <code>property</code>/<code>properties</code> command '''was not''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was''' given |- | <code>%r</code> | if '''only''' the <code>reference</code>/<code>references</code> command was given |- | <syntaxhighlight lang="wikitext">%p[ <span style="font-size:85\%">(%q)</span>][%s][%r]</syntaxhighlight> | if the <code>property</code>/<code>properties</code> command '''was''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was''' given |- | <code>%a[%s]</code> | if the <code>alias</code>/<code>aliases</code> command was given |- | <code>%b[%s]</code> | if the <code>badge</code>/<code>badges</code> command was given |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep=</code> | <code>{{Dfn|_|title=space}}</code> | <span style="color:#777;">''default''</span> | rowspan="2" | The fixed separator between each pair of claims, aliases or badges. |- | {{Dfn|<code>{{0|&ensp;}}</code>|title=empty}} | if '''only''' the <code>reference</code>/<code>references</code> command was given '''without''' the <code>raw</code> flag |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep%s=</code> | <code>,</code> | <span style="color:#777;">''default''</span> | rowspan="2" | The movable separator between each pair of claims, aliases or badges. This will be the value of the <code>%s</code> parameter applied to all claims, aliases or badges, except for the last in the list (which can be set with the <code>punc</code> flag). |- | <code>;</code> | if the <code>property</code>/<code>properties</code> command '''was not''' given and the <code>qualifier</code>/<code>qualifiers</code> command '''was''' given |- | colspan="4" | |- ! style="text-align:right;" | <code>sep%q1=</code>, <code>sep%q2=</code>, <code>sep%q3=</code>, ... | <code>{{Dfn|,_|title=comma space}}</code> | <span style="color:#777;">''default''</span> | The separator between each pair of qualifiers of a single claim. These are the value separators for the <code>%q1</code>, <code>%q2</code>, <code>%q3</code>, ... parameters. If only one <code>qualifier</code>/<code>qualifiers</code> command was given, then the <code>sep%q1</code> flag is equivalent to <code>sep%q</code>. |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep%q=</code> | <code>{{Dfn|,_|title=comma space}}</code> | if '''exactly one''' <code>qualifier</code>/<code>qualifiers</code> command was given | rowspan="2" | The separator between each set of qualifiers of a single claim. This is the value separator for the <code>%q</code> parameter. If only one <code>qualifier</code>/<code>qualifiers</code> command was given, then this flag is equivalent to <code>sep%q1</code>. |- | <code>{{Dfn|{{;}}_|title=semicolon space}}</code> | if '''more than one''' <code>qualifier</code>/<code>qualifiers</code> command was given |- | colspan="4" | |- ! rowspan="2" style="text-align:right;" | <code>sep%r=</code> | {{Dfn|<code>{{0|&ensp;}}</code>|title=empty}} | <span style="color:#777;">''default''</span> | rowspan="2" | The separator between each pair of references of a single claim. This is the value separator for the <code>%r</code> parameter. |- | <code>{{Dfn|_|title=space}}</code> | if the <code>raw</code> flag '''was''' given for the <code>reference</code>/<code>references</code> command |- | colspan="4" | |- ! style="text-align:right;" | <code>punc=</code> | {{Dfn|<code>{{0|&ensp;}}</code>|title=empty}} | <span style="color:#777;">''default''</span> | A punctuation mark placed at the end of the output. This will be placed on the <code>%s</code> parameter applied to the last claim (or alias or badge) in the list. This allows the last claim's references to be placed after the punctuation mark when the output is used as part of a sentence. |} == أمثلة == <!-- TO UPDATE EXAMPLE RESULTS at [[Template:Wikidata/doc]], replace all the contents of the 'Examples' section with: {{subst:Template:Wikidata/doc/examples}} (This makes the example results static for performance reasons.) Changes to examples and additions of new examples should be made at [[Template:Wikidata/doc/examples]] after which the contents of the 'Examples' section at [[Template:Wikidata/doc]] should be substituted as described above. The examples section is a bit bloated, though... For a bit of convenience, the following table row can be used as a basic template for any new example (note the 'xxx' that need to be replaced): |- | style="color:#777;font-size:small;" | Pxxx = "{{{{{|safesubst:}}}#invoke:wd|label|Pxxx}}"<br /> :↓<br /> [{{Sc|xxx}}] | {{Tnull|{{{{{|safesubst:}}}(((}}prename|{{{{{|safesubst:}}})))}}{{lcfirst:{{BASEPAGENAME}}}}|property|Pxxx|{{{{{|safesubst:}}}(((}}extraparams|{{{{{|safesubst:}}})))}}}}<br /> :↓<br /> :{{{{{|safesubst:}}}#invoke:wd|property|Pxxx}} | Description... --> {| class="wikitable" |- ! Parameters and output types ! Example ! style="width:20%"|Description |- | style="color:#777;font-size:small;" | [[d:Q55|Q55]] = "Netherlands", [[d:Property:P395|P395]] = "licence plate code"<br /> :↓<br /> [{{Sc|string}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|Q55|P395|{{{extraparams|}}}}}<br /> :↓<br /> :NL | Gets a literal string value. |- | style="color:#777;font-size:small;" | P395 = "licence plate code"<br /> :↓<br /> [{{Sc|string}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|P395|{{{extraparams|}}}}}<br /> :↓<br /> :NL | If the {{lcfirst:{{NAMESPACE}}}} is transcluded on the [[هولندا]] page (which is linked to Q55), then the <code>Q55</code> can be omitted. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P395 = "NL"<br /> :↓<br /> [{{Sc|string}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''eid{{=}}Q55'''|P395|{{{extraparams|}}}}}<br /> :↓<br /> :NL | An entity-ID can also be given using the <code>eid=</code> argument. |- | style="color:#777;font-size:small;" | P395 = "NL"<br /> :↓<br /> [{{Sc|string}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''page{{=}}Netherlands'''|P395|{{{extraparams|}}}}}<br /> :↓<br /> :NL | A page title can be given instead of an entity-ID using the <code>page=</code> argument. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P395 = "licence plate code"<br /> :↓<br /> [{{Sc|string}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''edit'''|Q55|P395|{{{extraparams|}}}}}<br /> :↓<br /> :NL&nbsp;[[ملف:OOjs UI icon edit-ltr-progressive.svg|لاإطار|نص_أعلى|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q55?uselang=en#P395|Edit this on Wikidata]] | Adds a clickable icon that may be used to edit the returned value on Wikidata. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P395 = "licence plate code"<br /> :↓<br /> [{{Sc|string}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''edit@end'''|Q55|P395|{{{extraparams|}}}}}<br /> :↓<br /> :NL<span style="float:right">[[ملف:OOjs UI icon edit-ltr-progressive.svg|لاإطار|نص_أعلى|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q55?uselang=en#P395|Edit this on Wikidata]]</span> | Places the edit icon at the end of the line. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P1082|P1082]] = "population"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''property'''|'''normal+'''|Q55|P1082|{{{extraparams|}}}}}<br /> :↓<br /> :17,590,672 | Gets a single property value from claims with a 'normal' rank or higher. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''properties'''|normal+|Q55|P1082|{{{extraparams|}}}}}<br /> :↓<br /> :17,590,672, 10,026,773, 16,779,575, 16,829,289, 17,000,000, 17,081,507, 17,181,084, 17,282,163, 17,407,585 | Gets multiple property values from claims with a 'normal' rank or higher. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", [[d:Property:P585|P585]] = "point in time"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|'''qualifier'''|normal+|Q55|P1082|'''P585'''|{{{extraparams|}}}}}<br /> :↓<br /> :17,590,672 <span style="font-size:85%">(1 January 2022)</span>, 10,026,773 <span style="font-size:85%">(1950)</span>, 16,779,575 <span style="font-size:85%">(2013)</span>, 16,829,289 <span style="font-size:85%">(26 August 2014)</span>, 17,000,000 <span style="font-size:85%">(21 March 2016)</span>, 17,081,507 <span style="font-size:85%">(1 January 2017)</span>, 17,181,084 <span style="font-size:85%">(1 January 2018)</span>, 17,282,163 <span style="font-size:85%">(1 January 2019)</span>, 17,407,585 <span style="font-size:85%">(1 January 2020)</span> | Gets a single qualifier value for each claim, additional to the property value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|time}}], [{{Sc|reference}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|'''references'''|normal+|Q55|P1082|P585|{{{extraparams|}}}}}<br /> :↓<br /> :17,590,672 <span style="font-size:85%">(1 January 2022)</span>,<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref> 10,026,773 <span style="font-size:85%">(1950)</span>,<ref name="wikidata-cb4c9d92a7876cfdfafdaf4b92634cba9063dac1-v5">{{استشهاد بويب|ناشر=Statistics Netherlands|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=22 August 2015|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T|تاريخ أرشيف=27 August 2015|مسار أرشيف=https://web.archive.org/web/20150827042738/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T}}</ref> 16,779,575 <span style="font-size:85%">(2013)</span>,<ref name="wikidata-cb4c9d92a7876cfdfafdaf4b92634cba9063dac1-v5">{{استشهاد بويب|ناشر=Statistics Netherlands|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=22 August 2015|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T|تاريخ أرشيف=27 August 2015|مسار أرشيف=https://web.archive.org/web/20150827042738/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T}}</ref> 16,829,289 <span style="font-size:85%">(26 August 2014)</span>,<ref name="wikidata-475c2999c451e2e418b275ef9b087583a2db7228-v5">{{استشهاد بويب|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=26 August 2014|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&LA=NL|مسار أرشيف=https://web.archive.org/web/20140903082344/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&LA=NL|تاريخ أرشيف=3 September 2014}}</ref> 17,000,000 <span style="font-size:85%">(21 March 2016)</span>,<ref name="wikidata-08fbc9797078849d8dc7b4754ad2109020d16f96-v5">{{استشهاد بويب|تاريخ=21 March 2016|مسار=http://www.cbs.nl/nl-NL/menu/themas/bevolking/publicaties/artikelen/archief/2016/nederland-telt-17-miljoen-inwoners.htm|عنوان=Nederland telt 17 miljoen inwoners}}</ref> 17,081,507 <span style="font-size:85%">(1 January 2017)</span>,<ref name="wikidata-4f58fc69480f96aaec74e771792854a11428895e-v5">{{استشهاد بويب|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049|عنوان=Bevolking; kerncijfers, 1950-2022|تاريخ الوصول=18 March 2023}}</ref> 17,181,084 <span style="font-size:85%">(1 January 2018)</span>,<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref> 17,282,163 <span style="font-size:85%">(1 January 2019)</span>,<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref> 17,407,585 <span style="font-size:85%">(1 January 2020)</span><ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref> | Gets references for each claim. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|reference}}] | <code>A total of {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|references|Q55|P1082|{{{extraparams|}}}}} people live in the Netherlands.</code><br /> :↓<br /> :A total of 17,590,672<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref> people live in the Netherlands. | Gets a property with its references. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|reference}}] | <code>The Netherlands has a population of {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|references|Q55|P1082|'''punc{{=}}.'''|{{{extraparams|}}}}}</code> :↓<br /> :The Netherlands has a population of 17,590,672.<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref> | Adds a punctuation mark at the end of the output, in front of the references. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|time}}], [{{Sc|reference}}] | <code>'''<nowiki><ul></nowiki>'''{{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|references|normal+|Q55|P1082|P585|'''<nowiki>format=<li>%p[%r][<ul><li>%q</li></ul>]</li></nowiki>'''|{{{extraparams|}}}}}'''<nowiki></ul></nowiki>'''</code><br /> :↓<br /> <ul><li>17,590,672<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref><ul><li>1 January 2022</li></ul></li> <li>10,026,773<ref name="wikidata-cb4c9d92a7876cfdfafdaf4b92634cba9063dac1-v5">{{استشهاد بويب|ناشر=Statistics Netherlands|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=22 August 2015|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T|تاريخ أرشيف=27 August 2015|مسار أرشيف=https://web.archive.org/web/20150827042738/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T}}</ref><ul><li>1950</li></ul></li> <li>16,779,575<ref name="wikidata-cb4c9d92a7876cfdfafdaf4b92634cba9063dac1-v5">{{استشهاد بويب|ناشر=Statistics Netherlands|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=22 August 2015|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T|تاريخ أرشيف=27 August 2015|مسار أرشيف=https://web.archive.org/web/20150827042738/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T}}</ref><ul><li>2013</li></ul></li> <li>16,829,289<ref name="wikidata-475c2999c451e2e418b275ef9b087583a2db7228-v5">{{استشهاد بويب|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=26 August 2014|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&LA=NL|مسار أرشيف=https://web.archive.org/web/20140903082344/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&LA=NL|تاريخ أرشيف=3 September 2014}}</ref><ul><li>26 August 2014</li></ul></li> <li>17,000,000<ref name="wikidata-08fbc9797078849d8dc7b4754ad2109020d16f96-v5">{{استشهاد بويب|تاريخ=21 March 2016|مسار=http://www.cbs.nl/nl-NL/menu/themas/bevolking/publicaties/artikelen/archief/2016/nederland-telt-17-miljoen-inwoners.htm|عنوان=Nederland telt 17 miljoen inwoners}}</ref><ul><li>21 March 2016</li></ul></li> <li>17,081,507<ref name="wikidata-4f58fc69480f96aaec74e771792854a11428895e-v5">{{استشهاد بويب|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049|عنوان=Bevolking; kerncijfers, 1950-2022|تاريخ الوصول=18 March 2023}}</ref><ul><li>1 January 2017</li></ul></li> <li>17,181,084<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref><ul><li>1 January 2018</li></ul></li> <li>17,282,163<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref><ul><li>1 January 2019</li></ul></li> <li>17,407,585<ref name="wikidata-3abcb661cd2d0629bbc49088fa86f8b016fa3525-v5">{{استشهاد بويب|عنوان=Bevolking; kerncijfers, 1950-2022|مسار=https://opendata.cbs.nl/statline/#/CBS/nl/dataset/37296ned/table?ts=1560596956049}}</ref><ul><li>1 January 2020</li></ul></li></ul> | Returns the output in a custom format. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''qualifier'''|normal+|Q55|P1082|P585|{{{extraparams|}}}}}<br /> :↓<br /> :1 January 2022; 1950; 2013; 26 August 2014; 21 March 2016; 1 January 2017; 1 January 2018; 1 January 2019; 1 January 2020 | Gets a single qualifier per claim, by default for multiple matching claims. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|qualifier|normal+|'''single'''|Q55|P1082|P585|{{{extraparams|}}}}}<br /> :↓<br /> :1 January 2022 | To get a single qualifier for only a single claim, give the <code>single</code> flag too so that only a single claim will be accessed. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|qualifier|Q55|P1082|'''10026773'''|P585|{{{extraparams|}}}}}<br /> :↓<br /> :1950 | Gets a qualifier from claims for which the (raw) property value matches a given literal value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|qualifier|'''mdy'''|Q55|P1082|10026773|P585|{{{extraparams|}}}}}<br /> :↓<br /> :1950 | Gets dates in month-day-year order. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population", P585 = "point in time"<br /> :↓<br /> [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|qualifier|'''raw'''|Q55|P1082|10026773|P585|{{{extraparams|}}}}}<br /> :↓<br /> :1950 | Gets a raw date value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population"<br /> :↓<br /> [{{Sc|reference}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''references'''|Q55|P1082|'''10026773'''|{{{extraparams|}}}}}<br /> :↓<br /> :<ref name="wikidata-cb4c9d92a7876cfdfafdaf4b92634cba9063dac1-v5">{{استشهاد بويب|ناشر=Statistics Netherlands|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=22 August 2015|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T|تاريخ أرشيف=27 August 2015|مسار أرشيف=https://web.archive.org/web/20150827042738/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T}}</ref> | Gets the references from a particular claim. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1082 = "population"<br /> :↓<br /> [{{Sc|reference}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''references'''|'''raw'''|Q55|P1082|'''10026773'''|{{{extraparams|}}}}}<br /> :↓<br /> :{{استشهاد بويب|ناشر=Statistics Netherlands|عنوان=CBS StatLine - Bevolking; kerncijfers|تاريخ الوصول=22 August 2015|مسار=http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T|تاريخ أرشيف=27 August 2015|مسار أرشيف=https://web.archive.org/web/20150827042738/http://statline.cbs.nl/StatWeb/publication/?VW=T&DM=SLNL&PA=37296ned&D1=a&D2=0,10,20,30,40,50,60,(l-1),l&HD=130605-0924&HDR=G1&STB=T}} | Gets references from a particular claim in their raw form. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P1081|P1081]] = "Human Development Index"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|reference}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|'''references'''|normal+|Q55|P1081|{{{extraparams|}}}}}<br /> :↓<br /> :0.931,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.787, 0.799, 0.829,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref><ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.861,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.877,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.891,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.909,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.919,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.920,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.920,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.922,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.834,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.835,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.839,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.864,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.866,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.865,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.867,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.870,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.876,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.879,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.878,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.883,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.886,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.897,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.904,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.906,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.906,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.910,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.921,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.921,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.923,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.924,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.926,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.928<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> | Gets properties from each claim with any references they have. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1081 = "Human Development Index"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|reference}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|references|normal+|'''sourced'''|Q55|P1081|{{{extraparams|}}}}}<br /> :↓<br /> :0.931,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.829,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref><ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.861,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.877,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.891,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.909,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.919,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.920,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.920,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.922,<ref name="wikidata-9775e828e0f16e6a1b32ff4b6293321469548907-v5">{{استشهاد بويب|مسار أرشيف=https://web.archive.org/web/20170202193023/http://hdr.undp.org/en/countries/profiles/NLD|مسار=http://hdr.undp.org/en/countries/profiles/NLD|تاريخ أرشيف=2 February 2017|عنوان=Netherlands}}</ref> 0.834,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.835,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.839,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.864,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.866,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.865,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.867,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.870,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.876,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.879,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.878,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.883,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.886,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.897,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.904,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.906,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.906,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.910,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.921,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.921,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.923,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.924,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.926,<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> 0.928<ref name="wikidata-f5c4249c74a1deaf99aa1ce9def008283983d0a1-v5">{{استشهاد بويب|عنوان=Human Development Data (1990-2017)|موقع=[[تقرير التنمية البشرية]]|مسار=http://hdr.undp.org/en/data|تاريخ أرشيف=30 December 2018|مسار أرشيف=https://web.archive.org/web/20181230181123/http://hdr.undp.org/en/data}}</ref> | Only gets properties from claims that have at least one reference. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P2855|P2855]] = "VAT rate", [[d:Property:P518|P518]] = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''qualifier'''|Q55|P2855|P518|{{{extraparams|}}}}}<br /> :↓<br /> :food | Gets a single qualifier value (for each matching claim). |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2855 = "VAT rate", P518 = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''qualifiers'''|Q55|P2855|P518|{{{extraparams|}}}}}<br /> :↓<br /> :food, medication, assistive technology, magazine, book, art, antique, hairdresser, hotel, campsite, recreation, sport, water | Gets multiple qualifier values (for each matching claim). |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2855 = "VAT rate", P518 = "applies to part"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''properties'''|qualifiers|Q55|P2855|P518|{{{extraparams|}}}}}<br /> :↓<br /> :21%, 6% <span style="font-size:85%">(food, medication, assistive technology, magazine, book, art, antique, hairdresser, hotel, campsite, recreation, sport, water)</span> | Gets multiple property values along with multiple qualifier values. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2855 = "VAT rate", P518 = "applies to part"<br /> :↓<br /> [{{Sc|quantity}}], [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifiers|Q55|P2855|P518|'''sep{{=}}_+_'''|'''sep%s{{=}}'''|'''sep%q{{=}}_/_'''|{{{extraparams|}}}}}<br /> :↓<br /> :21% + 6% <span style="font-size:85%">(food / medication / assistive technology / magazine / book / art / antique / hairdresser / hotel / campsite / recreation / sport / water)</span> | Returns the output with custom separators. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P35|P35]] = "head of state", [[d:Property:P580|P580]] = "start time", [[d:Property:P582|P582]] = "end time"<br /> :↓<br /> [{{Sc|entity label}}], [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|'''qualifier'''|'''qualifier'''|normal+|Q55|P35|'''P580'''|'''P582'''|{{{extraparams|}}}}}<br /> :↓<br /> :Willem-Alexander of the Netherlands <span style="font-size:85%">(30 April 2013)</span>, Beatrix of the Netherlands <span style="font-size:85%">(30 April 1980; 30 April 2013)</span>, Juliana of the Netherlands <span style="font-size:85%">(4 September 1948; 30 April 1980)</span>, Wilhelmina of the Netherlands <span style="font-size:85%">(23 November 1890; 4 September 1948)</span>, Willem III of the Netherlands <span style="font-size:85%">(17 March 1849; 23 November 1890)</span>, Willem II of the Netherlands <span style="font-size:85%">(7 October 1840; 17 March 1849)</span>, William I of the Netherlands <span style="font-size:85%">(16 March 1815; 7 October 1840)</span> | Gets two different qualifier values for each claim. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P35 = "head of state", P580 = "start time", P582 = "end time"<br /> :↓<br /> [{{Sc|entity label}}], [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|qualifier|normal+|Q55|P35|P580|P582|'''sep%q{{=}}_–_'''|{{{extraparams|}}}}}<br /> :↓<br /> :Willem-Alexander of the Netherlands <span style="font-size:85%">(30 April 2013)</span>, Beatrix of the Netherlands <span style="font-size:85%">(30 April 1980 – 30 April 2013)</span>, Juliana of the Netherlands <span style="font-size:85%">(4 September 1948 – 30 April 1980)</span>, Wilhelmina of the Netherlands <span style="font-size:85%">(23 November 1890 – 4 September 1948)</span>, Willem III of the Netherlands <span style="font-size:85%">(17 March 1849 – 23 November 1890)</span>, Willem II of the Netherlands <span style="font-size:85%">(7 October 1840 – 17 March 1849)</span>, William I of the Netherlands <span style="font-size:85%">(16 March 1815 – 7 October 1840)</span> | Returns the output with a custom separator. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P35 = "head of state", P580 = "start time", P582 = "end time"<br /> :↓<br /> [{{Sc|entity label}}], [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|qualifier|normal+|Q55|P35|P580|P582|'''<nowiki>format=%p[ <span style="font-size:85\%">(%q1[ – %q2])</span>][%s][%r]</nowiki>'''|{{{extraparams|}}}}}<br /> :↓<br /> :Willem-Alexander of the Netherlands <span style="font-size:85%">(30 April 2013)</span>, Beatrix of the Netherlands <span style="font-size:85%">(30 April 1980 – 30 April 2013)</span>, Juliana of the Netherlands <span style="font-size:85%">(4 September 1948 – 30 April 1980)</span>, Wilhelmina of the Netherlands <span style="font-size:85%">(23 November 1890 – 4 September 1948)</span>, Willem III of the Netherlands <span style="font-size:85%">(17 March 1849 – 23 November 1890)</span>, Willem II of the Netherlands <span style="font-size:85%">(7 October 1840 – 17 March 1849)</span>, William I of the Netherlands <span style="font-size:85%">(16 March 1815 – 7 October 1840)</span> | Returns the output in a custom format instead of with a custom separator. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P35 = "head of state", P580 = "start time", P582 = "end time"<br /> :↓<br /> [{{Sc|entity label}}], [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|qualifier|normal+|Q55|P35|P580|P582|<nowiki>format=%p[ <span style="font-size:85\%">(</nowiki>'''<nowiki>[<![]--%q2]since [%q2--[]>]</nowiki>'''<nowiki>%q1[ – %q2])</span>][%s][%r]</nowiki>|{{{extraparams|}}}}}<br /> :↓<br /> :Willem-Alexander of the Netherlands <span style="font-size:85%">(since 30 April 2013)</span>, Beatrix of the Netherlands <span style="font-size:85%">(<!--30 April 2013since 30 April 2013-->30 April 1980 – 30 April 2013)</span>, Juliana of the Netherlands <span style="font-size:85%">(<!--30 April 1980since 30 April 1980-->4 September 1948 – 30 April 1980)</span>, Wilhelmina of the Netherlands <span style="font-size:85%">(<!--4 September 1948since 4 September 1948-->23 November 1890 – 4 September 1948)</span>, Willem III of the Netherlands <span style="font-size:85%">(<!--23 November 1890since 23 November 1890-->17 March 1849 – 23 November 1890)</span>, Willem II of the Netherlands <span style="font-size:85%">(<!--17 March 1849since 17 March 1849-->7 October 1840 – 17 March 1849)</span>, William I of the Netherlands <span style="font-size:85%">(<!--7 October 1840since 7 October 1840-->16 March 1815 – 7 October 1840)</span> | To add text only when a certain value is not present, like adding the word ''since'' if there is no end time, wrap it in between two optional blocks containing HTML comment tags and the relevant parameter (this also prevents the text from being added to the page source). |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P35 = "head of state", [[d:Q29574|Q29574]] = "Beatrix of the Netherlands", P580 = "start time", P582 = "end time"<br /> :↓<br /> [{{Sc|entity label}}], [{{Sc|time}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|'''raw'''|qualifier|normal+|Q55|P35|'''Q29574'''|P580|P582|<nowiki>format=%p[ <span style="font-size:85\%">(%q1[ – %q2])</span>][%s][%r]</nowiki>|{{{extraparams|}}}}}<br /> :↓<br /> :Beatrix of the Netherlands <span style="font-size:85%">(1980-04-30 – 30 April 2013)</span> | Gets a property with qualifiers from claims for which the property matches a given Q-identifier, with one of the qualifier values in its raw form. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P38|P38]] = "currency", P518 = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifiers|normal+|'''current'''|Q55|P38|P518|{{{extraparams|}}}}}<br /> :↓<br /> :euro <span style="font-size:85%">(European Netherlands)</span>, United States dollar <span style="font-size:85%">(Caribbean Netherlands)</span> | Gets claims that are currently valid. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency", P518 = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|'''linked'''|qualifiers|normal+|current|Q55|P38|P518|{{{extraparams|}}}}}<br /> :↓<br /> :[[يورو]] <span style="font-size:85%">(European Netherlands)</span>, [[دولار أمريكي]] <span style="font-size:85%">(Caribbean Netherlands)</span> | Gets claims with linked property values. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency", P518 = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifiers|'''linked'''|normal+|current|Q55|P38|P518|{{{extraparams|}}}}}<br /> :↓<br /> :euro <span style="font-size:85%">(European Netherlands)</span>, United States dollar <span style="font-size:85%">([[الجزر الكاريبية الهولندية]])</span> | Gets claims with linked qualifier values. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency", P518 = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|'''linked'''|'''short'''|qualifiers|'''linked'''|normal+|current|Q55|P38|P518|{{{extraparams|}}}}}<br /> :↓<br /> :[[يورو]] <span style="font-size:85%">(European Netherlands)</span>, [[دولار أمريكي]] <span style="font-size:85%">([[الجزر الكاريبية الهولندية]])</span> | Gets claims with linked property and qualifier values, with short property values wherever available. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency", [[d:Q4917|Q4917]] = "United States dollar", P518 = "applies to part"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|qualifiers|normal+|current|Q55|P38|'''Q4917'''|P518|{{{extraparams|}}}}}<br /> :↓<br /> :Caribbean Netherlands | Gets qualifiers from claims for which the (raw) property value matches a given Q-identifier. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency", P518 = "applies to part", [[d:Q27561|Q27561]] = "Caribbean Netherlands"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|normal+|current|Q55|P38|'''P518{{=}}Q27561'''|{{{extraparams|}}}}}<br /> :↓<br /> :United States dollar | Gets properties from claims for which a (raw) qualifier value matches a given Q-identifier. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|normal+|'''former'''|Q55|P38|{{{extraparams|}}}}}<br /> :↓<br /> :Dutch guilder | Gets claims that were valid in the past. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|'''raw'''|normal+|former|Q55|P38|{{{extraparams|}}}}}<br /> :↓<br /> :Q788472 | Gets raw property values. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P38 = currency"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|raw|'''linked'''|normal+|former|Q55|P38|{{{extraparams|}}}}}<br /> :↓<br /> :[[d:Special:EntityPage/Q788472|Q788472]] | Gets raw property values that are linked to Wikidata. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P1549|P1549]] = "demonym"<br /> :↓<br /> [{{Sc|monolingual text}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|Q55|P1549|{{{extraparams|}}}}}<br /> :↓<br /> :Dutch | Gets a monolingual text value in the current wiki's language. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P1549 = "demonym", [[d:Property:P407|P407]] = "language of work or name", [[d:Q36846|Q36846]] = "Toki Pona"<br /> :↓<br /> [{{Sc|monolingual text}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''multilanguage'''|Q55|P1549|P407{{=}}Q36846|{{{extraparams|}}}}}<br /> :↓<br /> : | Gets a monolingual text value in any available language. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P2884|P2884]] = "mains voltage"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|Q55|P2884|{{{extraparams|}}}}}<br /> :↓<br /> :230 volt | Gets a quantity value with its associated unit of measurement. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2884 = "mains voltage"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''linked'''|Q55|P2884|{{{extraparams|}}}}}<br /> :↓<br /> :230 [[فولت]] | Gets a quantity value with a linked unit of measurement. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2884 = "mains voltage"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''raw'''|Q55|P2884|{{{extraparams|}}}}}<br /> :↓<br /> :230 | Gets a raw quantity value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2884 = "mains voltage"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''unit'''|Q55|P2884|{{{extraparams|}}}}}<br /> :↓<br /> :volt | Gets only the unit of measurement. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P2884 = "mains voltage"<br /> :↓<br /> [{{Sc|quantity}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|unit|'''raw'''|Q55|P2884|{{{extraparams|}}}}}<br /> :↓<br /> :Q25250 | Gets the raw unit of measurement. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P625|P625]] = "coordinate location"<br /> :↓<br /> [{{Sc|globe coordinate}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|Q55|P625|{{{extraparams|}}}}}<br /> :↓<br /> :52°19'N, 5°33'E | Gets a globe coordinate value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P625 = "coordinate location"<br /> :↓<br /> [{{Sc|globe coordinate}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''linked'''|Q55|P625|{{{extraparams|}}}}}<br /> :↓<br /> :[https://tools.wmflabs.org/geohack/geohack.php?language=en&params=52_19_N_5_33_E_globe:earth 52°19'N, 5°33'E] | Gets a linked globe coordinate value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P625 = "coordinate location"<br /> :↓<br /> [{{Sc|globe coordinate}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''raw'''|Q55|P625|{{{extraparams|}}}}}<br /> :↓<br /> :52/19/N/5/33/E | Gets a raw globe coordinate value. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P625 = "coordinate location"<br /> :↓<br /> [{{Sc|globe coordinate}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|Q55|'''coord'''|{{{extraparams|}}}}}<br /> :↓<br /> :52°19'N, 5°33'E | A property alias can be used instead of the P-identifier. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", [[d:Property:P41|P41]] = "flag image"<br /> :↓<br /> [{{Sc|commons media}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''linked'''|Q55|P41|{{{extraparams|}}}}}<br /> :↓<br /> :[[c:File:Flag of the Netherlands.svg|Flag of the Netherlands.svg]] | Gets a media file name and links to it on Commons. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P41 = "flag image"<br /> :↓<br /> [{{Sc|commons media}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''raw'''|Q55|P41|'''<nowiki>format=\[\[File:%p {{!}} thumb {{!}} left\]\]</nowiki>'''|{{{extraparams|}}}}}<br /> :↓<br /> :[[ملف:Flag of the Netherlands.svg{{!}} thumb {{!}} left]] | A Commons media file can be included on the page as-is by omitting the <code>linked</code> and <code>raw</code> flags, but by using the <code>raw</code> flag it can be freely formatted. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P41 = "flag image"<br /> :↓<br /> [{{Sc|commons media}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|raw|'''date{{=}}1700-05-06'''|Q55|P41|<nowiki>format=\[\[File:%p {{!}} thumb {{!}} left\]\]</nowiki>|{{{extraparams|}}}}}<br /> :↓<br /> :[[ملف:Statenvlag.svg{{!}} thumb {{!}} left]] | To get the value of a property that was valid at a given time, the <code>date=</code> argument can be used. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands", P41 = "flag image"<br /> :↓<br /> [{{Sc|commons media}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|raw|date{{=}}1700-05-06|'''former'''|Q55|P41|<nowiki>format=\[\[File:%p {{!}} thumb {{!}} left\]\]</nowiki>|{{{extraparams|}}}}}<br /> :↓<br /> :[[ملف:Prinsenvlag.svg{{!}} thumb {{!}} left]] | The time constraint flags work relatively to the date value given for the <code>date=</code> argument. |- | style="color:#777;font-size:small;" | [[d:Q915684|Q915684]] = "Lorentz–Lorenz equation", [[d:Property:P2534|P2534]] = "defining formula"<br /> :↓<br /> [{{Sc|math}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|Q915684|P2534|{{{extraparams|}}}}}<br /> :↓<br /> :<math qid="Q915684">\frac{n^2 - 1}{n^2 + 2} = \frac{4 \pi}{3} N \alpha</math> | Gets a mathematical expression. |- | style="color:#777;font-size:small;" | Q915684 = "Lorentz–Lorenz equation", [[d:Property:P7235|P7235]] = "in defining formula", [[d:Property:P9758|P9758]] = "symbol represents"<br /> :↓<br /> [{{Sc|entity label}}], [{{Sc|math}}] | <code><nowiki><ul></nowiki>{{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|properties|qualifier|linked|Q915684|P7235|P9758|<nowiki>format=<li>%q[ (%p)]</li></nowiki>|{{{extraparams|}}}}}<nowiki></ul></nowiki></code><br /> :↓<br /> :<ul><li>[[معامل الانكسار]] (<math>n</math>)</li> <li>[[قابلية استقطاب]] (<math>\alpha</math>)</li> <li>[[كثافة عددية|volumetric number density]] (<math>N</math>)</li> <li>[[ط (رياضيات)]] (<math>\pi</math>)</li></ul> | Mathematical expressions can be combined with regular text as usual. |- | style="color:#777;font-size:small;" | [[d:Q6256|Q6256]] = "country", [[d:Property:P3896|P3896]] = "geoshape"<br /> :↓<br /> [{{Sc|geographic shape}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|'''linked'''|Q6256|P3896|{{{extraparams|}}}}}<br /> :↓<br /> :[[c:Data:Naturalearthdata.com/admin-0-countries-no-antarctica.map|Data:Naturalearthdata.com/admin-0-countries-no-antarctica.map]] | Gets a geographic shape data file name and links to it on Commons. |- | style="color:#777;font-size:small;" | Q4917 = "United States dollar"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''label'''|Q4917|{{{extraparams|}}}}}<br /> :↓<br /> :United States dollar | Gets an item's label. |- | style="color:#777;font-size:small;" | Q4917 = "United States dollar"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|'''short'''|'''linked'''|Q4917|{{{extraparams|}}}}}<br /> :↓<br /> :[[دولار أمريكي]] | Gets an item's short and linked label. |- | style="color:#777;font-size:small;" | P38 = currency"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|P38|{{{extraparams|}}}}}<br /> :↓<br /> :currency | Gets a property's label. |- | style="color:#777;font-size:small;" | P38 = currency"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|'''linked'''|P38|{{{extraparams|}}}}}<br /> :↓<br /> :[[d:Special:EntityPage/P38|currency]] | Gets a property's label that is linked to Wikidata. |- | style="color:#777;font-size:small;" | [[d:Q776|Q776]] = "Utrecht"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|Q776|{{{extraparams|}}}}}<br /> :↓<br /> :Utrecht | Gets an item's label. |- | style="color:#777;font-size:small;" | Q776 = "Utrecht"<br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|'''linked'''|Q776|{{{extraparams|}}}}}<br /> :↓<br /> :[[مقاطعة أترخت]] | Gets an item's linked label. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|{{{extraparams|}}}}}<br /> :↓<br /> :Utrecht | If the {{lcfirst:{{NAMESPACE}}}} is transcluded on the [[مقاطعة أترخت]] page (which is linked to Q776), then the <code>Q776</code> can be omitted. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|'''raw'''|{{{extraparams|}}}}}<br /> :↓<br /> :Q776 | If just the <code>label</code> command with the <code>raw</code> flag is given, then the Q-identifier of the item connected to the current page is returned. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|entity label}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|label|raw|'''linked'''|{{{extraparams|}}}}}<br /> :↓<br /> :[[d:Special:EntityPage/Q776|Q776]] | If additionally the <code>linked</code> flag is given, then the Q-identifier of the item connected to the current page is linked to Wikidata. |- | style="color:#777;font-size:small;" | Q776 = "Utrecht"<br /> :↓<br /> [{{Sc|page title}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''title'''|Q776|{{{extraparams|}}}}}<br /> :↓<br /> :Utrecht (province) | Gets the title of the page on the current wiki that is linked to the given item. |- | style="color:#777;font-size:small;" | Q776 = "Utrecht"<br /> :↓<br /> [{{Sc|page title}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|title|'''linked'''|Q776|{{{extraparams|}}}}}<br /> :↓<br /> :[[مقاطعة أترخت]] | Gets the linked title of the page on the current wiki that is linked to the given item. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|page title}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|title|{{{extraparams|}}}}}<br /> :↓<br /> :Utrecht (province) | If the {{lcfirst:{{NAMESPACE}}}} is transcluded on the [[مقاطعة أترخت]] page (which is linked to Q776), then the <code>Q776</code> can be omitted. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands"<br /> :↓<br /> [{{Sc|entity description}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''description'''|Q55|{{{extraparams|}}}}}<br /> :↓<br /> :country in Northwestern Europe with territories in the Caribbean | Gets an item's description. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|entity description}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|description|{{{extraparams|}}}}}<br /> :↓<br /> :country in Northwestern Europe with territories in the Caribbean | If the {{lcfirst:{{NAMESPACE}}}} is transcluded on the [[هولندا]] page (which is linked to Q55), then the <code>Q55</code> can be omitted. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands"<br /> :↓<br /> [{{Sc|entity alias}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''alias'''|Q55|{{{extraparams|}}}}}<br /> :↓<br /> :Holland | Gets one of an item's aliases. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands"<br /> :↓<br /> [{{Sc|entity alias}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''aliases'''|Q55|{{{extraparams|}}}}}<br /> :↓<br /> :Holland, the Netherlands, NL, NED, Nederland, nl, 🇳🇱, Netherlands (after 1945) | Gets all of an item's aliases. |- | style="color:#777;font-size:small;" | Q55 = "Netherlands"<br /> :↓<br /> [{{Sc|entity alias}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|alias|'''linked'''|Q55|{{{extraparams|}}}}}<br /> :↓<br /> :[[هولندا]] | Gets a linked alias from an item. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|entity alias}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|alias|{{{extraparams|}}}}}<br /> :↓<br /> :Holland | If the {{lcfirst:{{NAMESPACE}}}} is transcluded on the [[هولندا]] page (which is linked to Q55), then the <code>Q55</code> can be omitted. |- | style="color:#777;font-size:small;" | [[d:Q2|Q2]] = "Earth"<br /> :↓<br /> [{{Sc|page badge}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|'''badges'''|Q2|{{{extraparams|}}}}}<br /> :↓<br /> :featured article badge | Gets the badges for the page on the current wiki that is linked to the given item. |- | style="color:#777;font-size:small;" | Q2 = "Earth"<br /> :↓<br /> [{{Sc|page badge}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|badges|'''raw'''|Q2|{{{extraparams|}}}}}<br /> :↓<br /> :Q17437796 | Gets the raw badges for the page on the current wiki that is linked to the given item. |- | style="color:#777;font-size:small;" | <br /> :↓<br /> [{{Sc|page badge}}] | {{Tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|badges|{{{extraparams|}}}}}<br /> :↓<br /> :featured article badge | If the {{lcfirst:{{NAMESPACE}}}} is transcluded on the [[الأرض]] page (which is linked to Q2), then the <code>Q2</code> can be omitted. |- | style="color:#777;font-size:small;" | [[d:Q28865|Q28865]] = "Python", [[d:P548|P548]] = "version type", [[d:P348|P348]] = "software version identifier",<br /> :↓<br /> [{{Sc|version}}], [{{Sc|reference}}] | {{tnull|{{{prename|}}}{{lcfirst:{{BASEPAGENAME}}}}|property|reference|edit|Q28865|'''P548{{=}}Q2804309'''|P348|{{{extraparams|}}}}}<br /> :↓<br /> :3.11.3<ref name="wikidata-47b0d8952e763dae8105c1e70220fc5d387af155-v5">{{استشهاد بويب|تاريخ=5 April 2023|مسار=https://blog.python.org/2023/04/its-time-for-another-set-of-python.html|عنوان=It's time for another set of Python releases! Python 3.11.3, 3.10.11 and 3.12 alpha 7 are now available.|تاريخ الوصول=6 April 2023}}</ref>&nbsp;[[ملف:OOjs UI icon edit-ltr-progressive.svg|لاإطار|نص_أعلى|10px|alt=Edit this on Wikidata|link=https://www.wikidata.org/wiki/Q28865?uselang=en#P348|Edit this on Wikidata]] | Get [[بايثون (لغة برمجة)]]'s latest stable release version with its references. You may want to use '''P548{{=}}Q2122918''' to get the latest preview release version. |} === Example references === {{مراجع}} == بيانات القالب == <templatedata> { "params": {}, "description": "This template fetches data from the centralized knowledge base Wikidata. To edit the data, click on \"Wikidata item\" in the left sidebar." } </templatedata> == طالع أيضاً == {{وحدة أخرى|*{{وصلة قالب|Wikidata}}, a user-friendly wrapper template for this module. *{{وصلة قالب|WikidataOI}}, a wrapper template for this module that adds an opt-in toggle.|{{{seealso|}}} *[[وحدة:Wd]], the source module that is called by this template *{{وصلة قالب|Wdib}}, a wrapper template for the getValue call in [[وحدة:WikidataIB]] *{{وصلة قالب|وصلة ويكي بيانات}} or redirect {{وصلة قالب|وصلة ويكي بيانات}}), to add a Wikidata entity link to a Wikipedia page *{{وصلة قالب|خاصية}} or redirect {{وصلة قالب|خاصية}}, to add a Wikidata property link to a Wikipedia page *{{وصلة قالب|خاصية ويكي بيانات}}, to add a Wikidata property {{وصلة قالب|صندوق جانبي}} to a Wikipedia page or template documentation *{{وصلة قالب|يستخدم ويكي بيانات}}, to add a Wikidata property box to the documentation of a template or module *{{وصلة قالب|تتبع ويكي بيانات}}, to add a Wikidata property box to the documentation of a template, module, or category *{{وصلة قالب|Wikidata editnotice}}, an editnotice for articles that make extensive use of this template }} *{{وصلة قالب|Pageid to title}}, to get a page title using its local page id, rather than Wikidata <includeonly><!-- /doc page is transcluded on these two root pages: -->{{#switch:{{NAMESPACE}}:{{اسم_الصفحة}} |Module:Wd = [[تصنيف:وحدات ويكي بيانات]][[تصنيف:وحدات تستخدم بيانات من ويكي بيانات]] |Template:WikidataOI |Template:Wikidata = [[تصنيف:قوالب ويكي بيانات]] }}</includeonly> ha44rbxn29gghwvzez5z8d45q6bbzcn ميدياويكي:Gadget-LoadJS.js 8 237563 1089699 2026-04-28T15:58:00Z حبيشان 31560 لتحميل جافاسكربت وإضافات من سطر العنوان 1089699 javascript text/javascript /** * @source https://www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL#Load_multiple_files * @revision 2023-09-24 */ (function () { var files = mw.util.getParamValue( 'use' ), user, FileRE, ExtRE, path; if ( !files ) { return; } user = mw.util.escapeRegExp( mw.config.get( 'wgUserName', '' ) ); FileRE = new RegExp( '^(?:MediaWiki:' + ( user ? '|User:' + user + '/' : '' ) + ')[^&<>=%#]*\\.(js|css)$' ); ExtRE = new RegExp( '^ext\\.[^,]+$' ); path = mw.config.get('wgServer') + mw.config.get('wgScript') + '?action=raw&ctype=text/'; $.each( files.split( '|' ), function(k, v) { var f = $.trim( v ), what = FileRE.exec( f ) || ['', '']; switch ( what[1] ) { case 'js': mw.loader.load( path + 'javascript&title=' + encodeURIComponent( f ) ); break; case 'css': mw.loader.load( path + 'css&title=' + encodeURIComponent( f ) ); break; default: if ( ExtRE.exec( f ) ) { mw.loader.load(f); } } }); })(); 7jo0of1ixi4t4fhr16uwtn55rs3867c ميدياويكي:Gadget-libJQuery.js 8 237564 1089702 2026-04-28T16:22:59Z حبيشان 31560 مكون مطلوب من بعض الإضافات 1089702 javascript text/javascript /** * [[:commons:MediaWiki:libJQuery-ui.js]] * jQuery UI additions that can be useful to Wikimedia Commons, and other Wikis. * * This pages has automated jsHint-validation on save. Interested? See [[:commons:MediaWiki:JSValidator.js]], [[:commons:Help:JSValidator.js]]. * * @rev 1 (2012-07-26) * @author Rillke, 2012 * * <nowiki> */ /*global jQuery:false, mediaWiki:false*/ /*jshint smarttabs: true*/ (function ($, mw) { "use strict"; // Extending jQuery-object // You can call the new methods like this: $.method() $.extend({ /** * Create * * @example * $.createIcon('ui-icon-alert').appendTo( document.body ); * * @param {String} iconClass jQuery UI icon class name. * * @context {jQuery} * @return {Object} jQuery-wrapped DOM-object: The icon that has been created */ createIcon: function (iconClass) { return $('<span>', { 'class': 'ui-icon ' + iconClass + ' jquery-inline-icon', text: ' ' }); }, /** * Create a notify-area (area with a background and an icon dependent on the state passed-in) * More about possible arguments: Look at http://jqueryui.com/ and subpages * * @example * var $area = $.createNotifyArea( $('<span>').text('Hello World'), 'ui-icon-alert', 'ui-state-error' ); * $area.appendTo( document.body ); * * @param {String|DOM-object|jQuery-wrapped DOM-object} textNode Message-string, HTML or DOM-node that will be used in the area. * @param {String} icon jQuery UI icon class name. * @param {String} state class(es) that indicate(s) the state of the area. E.g. ui-state-highlight, ui-state-disabled, ui-state-error, ... * * @context {jQuery} * @return {Object} jQuery-wrapped DOM-object: The area that has been created */ createNotifyArea: function (textNode, icon, state) { return $('<div>', { 'class': 'ui-widget' }).append( $('<div>', { 'class': state + ' ui-corner-all', style: 'margin-top:20px; padding:0.7em;' }).append($('<p>').append( $.createIcon(icon).css('margin-right', '.3em'), textNode))); }, /* @deprecated since 1.26 */ ucFirst: function (str) { return str.charAt(0).toUpperCase() + str.slice(1); } }); // i18n and configuration for the buttons mw.messages.set({ 'libjq-cancel-title': "Close this dialog [Esc]", 'libjq-proceed-title': "Proceed [Enter] in single-line text fields", 'libjq-report-title': "Reporting errors helps improving the application" }); var buttonConfig = { proceed: { 'icon': 'ui-icon-circle-check', 'class': 'ui-button-green', 'title': 'libjq-proceed-title' }, cancel: { 'icon': 'ui-icon-circle-close', 'class': 'ui-button-red', 'title': 'libjq-cancel-title' }, report: { 'icon': 'ui-icon-circle-check', 'class': '', 'title': 'libjq-report-title' } }; // Extending jQuery's prototype // You can call the new methods like this: $('selector').method() $.extend($.fn, { /** * Style a button like a proceed, cancel, ... button * * @example * $('#MySelector').children('button').specialButton('proceed').hide(); * * @param {String} which name of the special-button type * * @context {jQuery-wrapped DOM-object} * @return {jQuery-wrapped DOM-object} returns the same jQuery-wrapped DOM-object so you can perform further actions on it */ specialButton: function (which) { return (function ($btn, cfg) { return $btn.button({ icons: { primary: cfg.icon } }).addClass(cfg['class']).attr('title', mw.msg(cfg.title)); } (this, buttonConfig[which])); }, /** * Add event/state classes to a node if they are in that state * * @example * $('#MyButton')._jqInteraction().show(); * * @context {Object} jQuery instance (jQuery DOM node list) * @return {Object} jQuery instance (jQuery DOM node list) */ _jqInteraction: function () { var $el = this; return $el.hover(function () { $el.addClass('ui-state-hover'); }, function () { $el.removeClass('ui-state-hover').removeClass('ui-state-active'); }).focusin(function () { $el.addClass('ui-state-focus'); }).focusout(function () { $el.removeClass('ui-state-focus'); }).mousedown(function (e) { if (1 === e.which) $el.addClass('ui-state-active'); }).mouseup(function () { $el.removeClass('ui-state-active'); }); } }); } (jQuery, mediaWiki)); // </nowiki> dt2yp1se1oymueqnh6vd1zxlne9f998 ميدياويكي:Gadget-libJQuery.css 8 237565 1089703 2026-04-28T16:29:18Z حبيشان 31560 إضافة تحتاجها بعض اضافات 1089703 css text/css .jquery-inline-icon { display:inline-block !important; position:relative; top:2px; } 4gq6yqc42g7wwqfshxk6j6hlvcyare4 وحدة:Key 828 237566 1089705 2026-04-28T18:09:30Z حبيشان 31560 استيراد من ar.wikipedia.org 1089705 Scribunto text/plain -- This module implements {{key press}}. local kbdPrefix = '<kbd class="keyboard-key nowrap" dir="ltr">' local kbdSuffix = '</kbd>' local keyText = { ['caps lock'] = '⇪ Caps Lock', ['[[caps lock]]'] = '⇪ [[Caps Lock]]', ['shift'] = '⇧ Shift', ['[[shift key|shift]]'] = '⇧ [[Shift key|Shift]]', ['enter'] = '↵ Enter', ['[[enter key|enter]]'] = '↵ [[Enter key|Enter]]', ['cmd'] = '⌘ Cmd', ['[[command key|cmd]]'] = '⌘ [[Command key|Cmd]]', ['command'] = '⌘ Command', ['[[command key|command]]'] = '⌘ [[Command key|Command]]', ['opt'] = '⌥ Opt', ['[[option key|opt]]'] = '⌥ [[Option key|Opt]]', ['option'] = '⌥ Option', ['[[option key|option]]'] = '⌥ [[Option key|Option]]', ['tab'] = 'Tab ↹', ['[[tab key|tab]]'] = '[[Tab key|Tab]] ↹', ['backspace'] = '← Backspace', ['[[backspace]]'] = '← [[Backspace]]', ['win'] = '⊞ Win', ['[[windows key|win]]'] = '⊞ [[Windows key|Win]]', ['menu'] = '≣ Menu', ['[[menu key|menu]]'] = '≣ [[Menu key|Menu]]', ['up'] = '↑', ['[[arrow keys|up]]'] = '[[Arrow keys|↑]]', ['down'] = '↓', ['[[arrow keys|down]]'] = '[[Arrow keys|↓]]', ['left'] = '←', ['[[arrow keys|left]]'] = '[[Arrow keys|←]]', ['right'] = '→', ['[[arrow keys|right]]'] = '[[Arrow keys|→]]', ['asterisk'] = '&#42;', ['hash'] = '&#35;', ['[[#]]'] = '[[Number sign|#]]', ['colon'] = '&#58;', ['[[:]]'] = '[[Colon (punctuation)|:]]', ['pipe'] = '&#124;', ['[[|]]'] = '[[Pipe symbol|&#124;]]', ['semicolon'] = '&#59;', ['[[;]]'] = '[[Semi-colon|&#59;]]', ['equals'] = '&#61;', -- Left & right analog sticks. ['l up'] = 'L↑', ['l down'] = 'L↓', ['l left'] = 'L←', ['l right'] = 'L→', ['l ne'] = 'L↗', ['l se'] = 'L↘', ['l nw'] = 'L↖', ['l sw'] = 'L↙', ['r up'] = 'R↑', ['r down'] = 'R↓', ['r left'] = 'R←', ['r right'] = 'R→', ['r ne'] = 'R↗', ['r se'] = 'R↘', ['r nw'] = 'R↖', ['r sw'] = 'R↙', -- PlayStation. ['ex'] = '×', ['circle'] = '○', ['square'] = '□', ['triangle'] = '△', -- Nintendo 64 and GameCube. ['c up'] = 'C↑', ['c down'] = 'C↓', ['c left'] = 'C←', ['c right'] = 'C→', ['c ne'] = 'C↗', ['c se'] = 'C↘', ['c nw'] = 'C↖', ['c sw'] = 'C↙', } local keyAlias = { -- ['alternate name for key (alias)'] = 'name for key used in key table' ['[[cmd key|cmd]]'] = '[[command key|cmd]]', ['[[cmd key|command]]'] = '[[command key|command]]', ['[[opt key|opt]]'] = '[[option key|opt]]', ['[[option key]]'] = '[[option key|option]]', ['[[opt key|option]]'] = '[[option key|option]]', ['[[win key|win]]'] = '[[windows key|win]]', ['*'] = 'asterisk', ['#'] = 'hash', [':'] = 'colon', [';'] = 'semicolon', ['l-up'] = 'l up', ['l-down'] = 'l down', ['l-left'] = 'l left', ['l-right'] = 'l right', ['l-ne'] = 'l ne', ['l-se'] = 'l se', ['l-nw'] = 'l nw', ['l-sw'] = 'l sw', ['r-up'] = 'r up', ['r-down'] = 'r down', ['r-left'] = 'r left', ['r-right'] = 'r right', ['r-ne'] = 'r ne', ['r-se'] = 'r se', ['r-nw'] = 'r nw', ['r-sw'] = 'r sw', ['ps x'] = 'ex', ['ps c'] = 'circle', ['ps s'] = 'square', ['ps t'] = 'triangle', ['c-up'] = 'c up', ['c-down'] = 'c down', ['c-left'] = 'c left', ['c-right'] = 'c right', ['c-ne'] = 'c ne', ['c-se'] = 'c se', ['c-nw'] = 'c nw', ['c-sw'] = 'c sw', } local Collection = {} Collection.__index = Collection do function Collection:add(item) if item ~= nil then self.n = self.n + 1 self[self.n] = item end end function Collection:join(sep) return table.concat(self, sep) end function Collection:sort(comp) table.sort(self, comp) end function Collection.new() return setmetatable({n = 0}, Collection) end end local function keyPress(args) local chainNames = { 'chain first', 'chain second', 'chain third', 'chain fourth', 'chain fifth', 'chain sixth', 'chain seventh', 'chain eighth', 'chain ninth', } local result = Collection.new() local chainDefault = args.chain or '+' for i, id in ipairs(args) do if i > 1 then result:add(args[chainNames[i - 1]] or chainDefault) end local lc = id:lower() local text = keyText[lc] or keyText[keyAlias[lc]] or id result:add(kbdPrefix .. text .. kbdSuffix) end return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Template:ضغط زر/styles.css'} } .. result:join() end local function keypress(frame) -- Called by "{{key press|...}}". -- Using the template doubles the post‐expand include size. return keyPress(frame:getParent().args) end local function press(frame) -- Called by "{{#invoke:key|press|...}}". return keyPress(frame.args) end return { keypress = keypress, press = press, } lhhjbyamo17sauvhg9yc6zw7e968yti قالب:ضغط زر 10 237567 1089706 2026-04-28T18:10:01Z حبيشان 31560 استيراد من ar.wikipedia.org 1089706 wikitext text/x-wiki {{#invoke:key|keypress}}<noinclude> {{توثيق}}</noinclude> j2m7wtoc60p21db4nb4xlqaam4u0t3g 1089711 1089706 2026-04-28T18:15:39Z حبيشان 31560 1089711 wikitext text/x-wiki {{#invoke:Key|keypress}}<noinclude> {{توثيق}}</noinclude> e97diko44wcnfa9xtfduqa875ntyxxz قالب:ضغط زر/styles.css 10 237568 1089707 2026-04-28T18:10:03Z حبيشان 31560 استيراد من ar.wikipedia.org 1089707 sanitized-css text/css .keyboard-key { border: 1px solid #aaa; border-radius: 0.2em; box-shadow: 0.1em 0.1em 0.2em rgba(0, 0, 0, 0.1); background-color: var(--background-color-neutral-subtle, #f8f9fa); background-image: linear-gradient(to bottom, var(--background-color-neutral, #eaecf0), var(--background-color-neutral-subtle, #f8f9fa), var(--background-color-neutral, #eaecf0)); color: var(--color-base, #202122); padding: 0.1em 0.3em; font-family: inherit; font-size: 0.85em; } 6qy50y7q0xwio85zudjm6ginymq894y قالب:ضغط زر/شرح 10 237569 1089708 2026-04-28T18:10:05Z حبيشان 31560 استيراد من ar.wikipedia.org 1089708 wikitext text/x-wiki {{صفحة توثيق فرعية}} <!-- التصنيفات والإنترويكيات تأتي في أسفل هذه الصفحة--> === استعمال === أمثلة: {{قا|ضغط زر|A}} يُنتج {{ضغط زر|A}} {{قا|ضغط زر||Alt|P}} يُنتج {{ضغط زر|Alt|P}} {{قا|ضغط زر|Ctrl|Alt|Del}} يُنتج {{ضغط زر|Ctrl|Alt|Del}} === انظر أيضا === * [[قالب:زر]] <includeonly> <!-- التصنيفات والإنترويكيات تأتي هنا --> [[تصنيف:قوالب تنسيق المحتوى]] </includeonly> 74ppsy89qp7way4lnq306fiazb22bqs قالب:ضغط زر/لب 10 237570 1089709 2026-04-28T18:10:08Z حبيشان 31560 استيراد من ar.wikipedia.org 1089709 wikitext text/x-wiki <kbd class="keyboard-key" style="border: 1px solid; border-color: #ddd #bbb #bbb #ddd; border-bottom-width: 2px; {{border-radius|3px}} background-color: {{{2|#f9f9f9}}}; padding: 1px 3px; font-family: inherit; font-size: 0.85em; white-space: nowrap;" dir="ltr">{{#switch:{{lc:{{{1}}}}} | caps lock = {{يونيكود|⇪}} Caps Lock | [[كابس لوك]] = {{يونيكود|⇪}} [[كابس لوك]] | shift = {{يونيكود|⇧}} Shift | [[shift key|shift]] = {{يونيكود|⇧}} [[Shift key|Shift]] | enter = {{يونيكود|↵}} Enter | [[مفتاح الدخول|enter]] = {{يونيكود|↵}} [[مفتاح الدخول]] | cmd = {{يونيكود|⌘}} Cmd | [[cmd key|cmd]] | [[command key|cmd]] = {{يونيكود|⌘}} [[Command key|Cmd]] | opt = {{يونيكود|⌥}} Opt | [[opt key|opt]] | [[option key|opt]] = {{يونيكود|⌥}} [[Option key|Opt]] | tab = Tab {{يونيكود|⇆}} | [[tab key|tab]] = [[Tab key|Tab]] {{يونيكود|⇆}} | backspace = ← Backspace | [[backspace]] = ← [[Backspace]] | win = {{يونيكود|⊞}} Win | [[win key|win]] | [[windows key|win]] = {{يونيكود|⊞}} [[Windows key|Win]] | menu = {{يونيكود|≣}} Menu | [[menu key|menu]] = {{يونيكود|≣}} [[Menu key|Menu]] | up = ↑ | [[arrow keys|up]] = [[Arrow keys|↑]] | down = ↓ | [[arrow keys|down]] = [[Arrow keys|↓]] | left = ← | [[arrow keys|left]] = [[Arrow keys|←]] | right = → | [[arrow keys|right]]= [[Arrow keys|→]] | * = <nowiki>*</nowiki> | # = <nowiki>#</nowiki> | [[#]] = [[رمز الرقم|#]] | : = <nowiki>:</nowiki> | [[:]] = [[نقطتان رأسيتان|:]] | [[]] = [[قائم (ترقيم)|{{!}}]] | #default = {{{1}}} }}</kbd><noinclude> {{توثيق}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> mx5a6q7xfarkkvsprwn0vy69ll87z8u قالب:ضغط زر/لب/شرح 10 237571 1089710 2026-04-28T18:10:10Z حبيشان 31560 استيراد من ar.wikipedia.org 1089710 wikitext text/x-wiki {{صفحة توثيق فرعية}} <!-- التصنيفات والإنترويكيات تأتي في أسفل هذه الصفحة--> === انظر أيضا === <includeonly> <!-- التصنيفات والإنترويكيات تأتي هنا --> </includeonly> 13jpg5jyiq47sjglins4jm75n1hf6gf نقاش المستخدم:Aelrhman2007 3 237572 1089716 2026-04-28T19:07:10Z Dr-Taher 12861 نقل Dr-Taher صفحة [[نقاش المستخدم:Aelrhman2007]] إلى [[نقاش المستخدم:عبدالرحمن]]: نُقِلت الصفحة آليا عند إعادة تسمية المستخدم «[[Special:CentralAuth/Aelrhman2007|Aelrhman2007]]» إلى «[[Special:CentralAuth/عبدالرحمن|عبدالرحمن]]». 1089716 wikitext text/x-wiki #تحويل [[نقاش المستخدم:عبدالرحمن]] 2snfqondd6em0humg8rp23jkay7hfar