professional-wiki/wikibase-rdf
Composer 安装命令:
composer require professional-wiki/wikibase-rdf
包简介
Wikibase extension that allows defining RDF mappings for Wikibase Entities
关键字:
README 文档
README
Wikibase extension that allows defining RDF mappings for Wikibase Entities.
Professional Wiki created and maintains Wikibase RDF. We provide Wikibase hosting, Wikibase development, and Wikibase consulting.
The Wikibase Stakeholder Group conceived and funded the extension.
Table of Contents
Usage
When the extension is enabled, Item and Property pages show a "Mapping to other ontologies" section. This section is located between the "In more languages" and "Statements" sections.
Users with editing permissions can add, edit, or remove mappings.
A mapping consists of a predicate and a URL. The predicate can only be one out of a preconfigured set of values. The URL has to be valid.
Mapping predicates can be configured via the MediaWiki:MappingPredicates page by anyone with interface-admin permissions.
You can also configure mapping predicates via PHP Configuration.
REST API
This extension provides REST API endpoints for getting and setting the RDF mappings for a Wikibase entity.
For more information, refer to the REST API documentation.
Installation
Platform requirements:
- PHP 8.1 or later (tested up to 8.4)
- MediaWiki 1.43 or later (tested up to 1.43)
- Wikibase 1.43 or later (tested up to 1.43)
The recommended way to install Wikibase RDF is using Composer with MediaWiki's built-in support for Composer.
On the command line, go to your wiki's root directory. Then run these two commands:
COMPOSER=composer.local.json composer require --no-update professional-wiki/wikibase-rdf:~2.0
composer update professional-wiki/wikibase-rdf --no-dev -o
Then enable the extension by adding the following to the bottom of your wikis LocalSettings.php file:
wfLoadExtension( 'WikibaseRDF' );
You can verify the extension was enabled successfully by opening your wiki's Special:Version page in your browser.
PHP Configuration
Configuration can be changed via LocalSettings.php.
Allowed predicates
List of allowed predicates.
Variable: $wgWikibaseRdfPredicates
Default: []
Example:
$wgWikibaseRdfPredicates = [ 'owl:sameAs', 'owl:SymmetricProperty', 'rdfs:subClassOf', 'rdfs:subPropertyOf', ];
You can also configure what predicates are allowed via the MediaWiki:MappingPredicates page.
Development
To ensure the dev dependencies get installed, have this in your composer.local.json:
{
"require": {
"vimeo/psalm": "^4",
"phpstan/phpstan": "^1.4.9"
},
"extra": {
"merge-plugin": {
"include": [
"extensions/WikibaseRDF/composer.json"
]
}
}
}
Running tests and CI checks
You can use the Makefile by running make commands in the WikibaseRDF directory.
make ci: Run everythingmake test: Run all testsmake cs: Run all style checks and static analysis
Alternatively, you can execute commands from the MediaWiki root directory:
- PHPUnit:
php tests/phpunit/phpunit.php -c extensions/WikibaseRDF/ - Style checks:
vendor/bin/phpcs -p -s --standard=extensions/WikibaseRDF/phpcs.xml - PHPStan:
vendor/bin/phpstan analyse --configuration=extensions/WikibaseRDF/phpstan.neon --memory-limit=2G - Psalm:
php vendor/bin/psalm --config=extensions/WikibaseRDF/psalm.xml
Release notes
Version 2.0.0 - 2025-07-07
- Raised minimum MediaWiki version to 1.43
- Raised minimum PHP version to 8.1
- Translation updates for system messages (thanks @translatewiki and its translator community)
Version 1.1.0 - 2022-11-25
- Added notification about SPARQL store behavior that shows on first edit
- Translation updates for system messages (thanks @translatewiki and its translator community)
Version 1.0.0 - 2022-10-04
Initial release for Wikibase 1.37 with these features:
- Ability to add mappings to Items and Properties via an on-page UI
- Inclusion of mappings in the RDF output
- Configurable relationships (predicates), including configuration UI on
MediaWiki:MappingPredicates - API endpoint to retrieve or update the mappings for an Entity
- API endpoint to retrieve all mappings defined on the wiki
- TranslateWiki integration
- Support for PHP 8.0 and 8.1
professional-wiki/wikibase-rdf 适用场景与选型建议
professional-wiki/wikibase-rdf 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.17k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2022 年 07 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「RDF」 「mediawiki」 「wikibase」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 professional-wiki/wikibase-rdf 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 professional-wiki/wikibase-rdf 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 professional-wiki/wikibase-rdf 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This PHP library can easily parse xml files, especially RSS1.0, RSS2.0 and ATOM.
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
An extension to Semantic MediaWiki allowing to build breadcrumb links from an attributive property filter
Helper functions for the MediaWiki ExtensionRegistry
Adds the EDTF data type to Wikibase
Provides line-by-line readers and iterators for Wikibase/Wikidata JSON dumps
统计信息
- 总下载量: 10.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2022-07-20



