Jump to content

امتداد:Cargo

From mediawiki.org
This page is a translated version of the page Extension:Cargo and the translation is 43% complete.
Outdated translations are marked like this.
الدليل المرجعي لامتدادات ميدياويكي
Cargo
حالة الإصدار مستقر
تنفيذ صفحة خاصة , واجهة برمجة التطبيقات , دوال المحلل اللغوي
بيان هو امتداد يسمح بتخزين البيانات الموجودة داخل القوالب والاستفسار عنها.
المؤلف/المؤلفون Yaron Koren <yaron57@gmail.com> (Yaron Korenنقاش)
آخر إصدار 3.9.3 (يوليو 2026)
سياسة التوافق النسخة الرئيسية تحافظ على التوافق مع الإصدارات السابقة.
MediaWiki 1.42+
تغييرات قاعدة البيانات نعم
Composer mediawiki/cargo
  • $wgCargoFileDataColumns
  • $wgCargoDrilldownLargestFontSize
  • $wgCargoDecimalMark
  • $wgCargoDefaultStringBytes
  • $wgCargoAllowedSQLFunctions
  • $wgCargoHideNamespaceName
  • $wgCargoMaxVisibleHierarchyDrilldownValues
  • $wgCargoDrilldownSmallestFontSize
  • $wgCargoDBTableOptions
  • $wgCargoMaxQueryLimit
  • $wgCargoDefaultMapService
  • $wgCargoStoreUseTemplateArgsFallback
  • $wgCargoPageDataColumns
  • $wgCargoIgnoreBacklinks
  • $wgCargoDigitGroupingCharacter
  • $wgCargoDefaultQueryLimit
  • $wgCargoDrilldownNumRangesForNumbers
  • $wgCargo24HourTime
  • $wgCargoLegacyNullLuaFieldsAsEmptyString
  • $wgCargoTablesPrioritizeReplacements
  • $wgCargoRecurringEventMaxInstances
  • $wgCargoDrilldownUseTabs
  • $wgCargoDrilldownMinValuesForComboBox
  • $wgCargoMapClusteringMinimum
  • recreatecargodata
  • deletecargodata
  • runcargoqueries
Licence رخصة جنو العمومية 2.0 أو ما بعدها
التنزيل
مثال Wikimedia Australia's Cargo Tables
ترجم الامتداد Cargo
المسائل المهام المفتوحة · الإبلاغ عن عطل تقني

Cargo هو امتداد يضاف إلى ميدياويكي يوفر سبيل خفيف لتخزين البيانات والاستعلام عنها الموجودة في داخل طرق استدعاء القوالب، مثل صناديق المعلومات. هذا الامتداد يشبه في مفهومه امتداد Semantic MediaWiki إلا أنه يوفر عدد من الميزات تشمل سهولة التثبيت وسهولة الاستخدام.

يحفظ امتداد Cargo بياناته في جداول قواعد بيانات التي يمكن وضعها في قاعدة بيانات برمجيات ميدياويكي (الخيار الافتراضي) أو في قاعدة بيانات منفصلة. في أغلب الأحوال تخزن بيانات كل قالب في جدول قاعدة بيانات واحد ويخصص عمود لكل متغير من متغيرات القالب المعنية. توجد بضعة استثناءات لهذا الأمر، مثل التعامل مع حقول القوالب التي تحتوي على مصفوفات أو قوائم من القيم وكذا الحقول التي تحتوي على إحداثيات جغرافية أو أكثر تعقيدا بسبب سوء التعامل المحلي لأنواع البيانات هذه في أغلب أنظمة قواعد البيانات. يمكن ضبط عدد من القوالب كي تخزن جميعا بياناتها في جدول قاعدة بيانات واحد.

يحدد الامتداد عدد من وظائف المعرب اللغوي وما يلي هي أهم ثلاث من هذه الوظائف:

  • #cargo_declare – توع في جزء ‎<noinclude> من القالب وهي تحدد مخطط أي جدول.
  • #cargo_store – تخزن صف واحد في جدول Cargo وهي توضع عادة داخل الجزء ‎<includeonly> من أي قالب.
  • #cargo_query – تستعلم في واحد من جداول بيانات Cargo أو أكثر من واحد باستخدام مكونات SQL.

وظائف المعرب اللغوي الأخرى المحددة هي كالتالي:

  • #cargo_attach – تحدد قالب ما على أنه يضيف صفوف إلى جدول معلن عنه في مكان آخر.
  • #cargo_compound_query – تعرض نتائج عدة استعلامات في مكان واحد.
  • #cargo_display_map – تعرض خريطة تبين نقطة واحدة.
  • #recurring_event – تطبع تواريخ حدث متكرر؛ تستخدم هذه الخاصية #cargo_store.

كما يحدد Cargo أيضا عدة واجهات لاستعراض البيانات والمخزنة والتنقيب فيها. ولهذا السبب، تضيف الصفحات الخاصة التالية:

  • Special:CargoQuery
  • Special:CargoTableDiagram
  • Special:CargoTables
  • Special:Drilldown

جرى على Cargo أعمال اختبار وهو يعمل مع أنظمة قواعد بيانات MySQL وPostgreSQL. يدعم الامتداد نظريا SQLite، إلا أنه لم يختبر كما ينبغي باستخدام SQLite وربما لا يعمل.

يتطلب هذا الإصدار من امتداد Cargo الإصدار MediaWiki 1.42+.

Below are links to the entire documentation.

  • Download and installation
    How to download Cargo via either Git, a standard download, or a software package; and how to install it.
  • Quick start guide
    A short guide to generate Cargo-based templates and Cargo tables, especially in conjunction with the Page Forms extension.
  • Other documentation
    Links to other forms of documentation
  • SMW migration guide
    A guide for modifying templates and queries that use Semantic MediaWiki to switch to Cargo instead.
  • Storing data
    Using #cargo_declare, #cargo_attach and #cargo_store to create and populate Cargo tables.
  • Querying data
    Querying Cargo data with #cargo_query, #cargo_compound_query and other tools.
  • Display formats
    The various display formats available, including lists, charts, maps and calendars.
  • Browsing data
    Browsing the Cargo data using the built-in tools: Special:Drilldown, Special:CargoQuery, Special:CargoTables
  • Exporting data
    Exporting Cargo data into output formats including: CSV, JSON, RSS
  • Other features
    Other features of Cargo, including displaying maps and making use of Lua .
  • Common problems
    Common issues that people have run into.
  • Known bugs and planned features
    Known bugs in the software, and potential workarounds for them; plus features that are planned in the current development roadmap.
  • Getting support
    Where to ask questions, submit bug reports, submit feature requests, submit fixes, and add new translations.
  • Authors and credits
    The main authors, others who have contributed to the code, and credits to other organizations and software projects.
  • Version history
    The release history of Cargo.
  • Sites that use Cargo
    A small sampling of the wikis that use Cargo.
  • Cargo and Semantic MediaWiki
    A comparison of Cargo to its main alternative, Semantic MediaWiki, in terms of both features and performance.
  • FAQ
    Frequently-asked questions.

الإعداد

التالي هي إعدادات ضبط Cargo العمومية وكذلك قيمها الافتراضية.

لضبط Cargo كي يستخدم قاعدة بيانات مستقلة بدلًا من قاعدة بيانات ميدياويكي، تقدم الإعدادات التالية:

إعدادات ضبط قاعدة بيانات منفصلة
إعدادات افتراضي بيان
$wgCargoDBtype null نوع قاعدة البيانات.
$wgCargoDBserver null اسم المضيف أو عنوان آي بي خادوم قاعدة البيانات.
$wgCargoDBname null اسم قاعدة البيانات.
$wgCargoDBuser null اسم مستخدم قاعدة البيانات.
$wgCargoDBpassword null كلمة المرور لأغراض $wgCargoDBuser.
$wgCargoDBprefix null سابقة اسم جدول قاعدة البيانات.
$wgCargoDBRowFormat null صيغة صف قاعدة البيانات.
$wgCargoDBTableOptions null Comma-separated options, analogous to $wgDBTableOptions.

لأغراض ضبط المحارف حينما يتعلق الأمر بالأرقام، تقدم إعدادات الضبط التالية:

إعدادات ضبط المحارف
إعدادات افتراضي بيان
$wgCargoDecimalMark . الرمز العشري للأرقام.
$wgCargoDigitGroupingCharacter , رمز الفاصل للأرقام الزائدة عن الألف.

وإعدادات الضبط العمومية المتبقية هي كما يلي:

إعدادات افتراضي بيان
$wgCargoAllowedSQLFunctions [1] تحدد وظائف SQL المسموح بها.
$wgCargoRecurringEventMaxInstances 100 The number of max instances to store for recurring events with no set end date.
$wgCargoDefaultStringBytes 300 The default number of characters for fields of type Page, String, Wikitext string, File, URL, Email
$wgCargoDefaultQueryLimit 100 Number of results to show for #cargo_query if no limit is set
$wgCargoMaxQueryLimit 5000 The maximum allowed number of results for #cargo_query
$wgCargoQueryMaxExecutionTime null The maximum amount of time (in milliseconds) that Cargo queries can run before they are stopped (MySQL/MariaDB only)
$wgCargo24HourTime false If true uses 24-hour time for Datetime field types.
$wgCargoDefaultMapService OpenLayers Sets the default map service to Google Maps, if set to googlemaps, to Leaflet if set to leaflet, and to OpenLayers if set to openlayers.
$wgCargoGoogleMapsKey null API key for Google Maps, for the googlemaps display format.
$wgCargoMapClusteringMinimum 80 If the number of map points displayed is greater than the value of $wgCargoMapClusteringMinimum, the map displays the locations in "clusters" instead of individual points, for readability. If set to a very high number, does not display clustering.
$wgCargoDrilldownUseTabs true Displays Special:Drilldown table names as tabs at the top instead of a vertical list at the side.
$wgCargoDrilldownSmallestFontSize -1 If set to a positive number, sets the smallest font size, in pixels, for a tag-cloud-style display of filter values.
$wgCargoDrilldownLargestFontSize -1 If set to a positive number, sets the largest font size, in pixels, for a tag-cloud-style display of filter values.
$wgCargoDrilldownMinValuesForComboBox 40 Sets the minimum number of values before their display is converted to a combo box, instead of individual links.
$wgCargoDrilldownNumRangesForNumbers 5 For fields/filters of type Integer or Float, specifies the number of "buckets" into which values are divided.
$wgCargoMaxVisibleHierarchyDrilldownValues 30 If set to a positive integer, specifies the maximum number of values shown at a time for any hierarchy field (All the top-level values are shown irrespective of this value). The values are hidden beyond a certain depth of the hierarchy such that the count of total visible values is at most this number.
$wgCargoTablesPrioritizeReplacements false If true, all tables having a replacement appear at the top of the Special:CargoTables page, instead displaying them in alphabetical order.
$wgCargoPageDataColumns [] The set of fields to store in the _pageData Cargo table. See Storing page data .
$wgCargoFileDataColumns [] The set of fields to store in the _fileData Cargo table. See Storing file data .
$wgCargoHideNamespaceName [6] Array of namespaces to hide from query results.
$wgCargoLegacyNullLuaFieldsAsEmptyString false Null results to the Lua Cargo query function should return as string rather than nil. This allows you to rollback a breaking change from early 2022. New wikis created after this time should not enable this.
$wgCargoStoreUseTemplateArgsFallback true Enable the behavior that looks for template arguments that match the template's declared table to fill columns.

أنظر أيضا

  1. طالع استخدام وظائف SQL للتعرف على القيم الافتراضية.