mediawiki/semantic-data-import 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mediawiki/semantic-data-import

最新稳定版本:0.4.0

Composer 安装命令:

composer require mediawiki/semantic-data-import

包简介

README 文档

README

Build Status Code Coverage

Extension for importing CSV-like structured data into MediaWiki pages using Semantic MediaWiki.

It basically turns CSV rows into Semantic Subobjects.

Basic Usage

Content can be saved straight into wikitext pages (only option for older wikis) or also as pure JSON pages (only via SpecialPage interface Special:SDImport).

Namespace configuration

At the time of writting, mappings of CSV columns against Semantic MediaWiki properties can only be done by configuring (custom or not) namespaces in LocalSettings.php.

	# Example NS definition
	define("NS_SDImport", 2000);
	$GLOBALS["wgSDImportDataPage"][NS_SDImport] = array();
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["edit"] = false;
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["separator"] = "\t";
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["delimiter"] = '"';
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["rowobject"] = "SDImport";
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["rowfields"] = array("Page1", "Page2");
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["typefields"] = array("Page", "Page");
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["ref"] = array("ref" => "{{PAGENAME}}");
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["prefields"] = array( "", "" );
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["postfields"] = array( "", "" );
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["json"] = true; # Whether content is stored directly in JSON
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["single"] = false; #Whether to store straight properties-values, but not Subobject (rowobject is ignored)
	$GLOBALS["wgSDImportDataPage"][NS_SDImport]["form"] = false; #Whether to show a form instead of a spreadsheet (as far as single is true)
	$wgExtraNamespaces[NS_SDImport] = "SDImport";
	$GLOBALS['smwgNamespacesWithSemanticLinks'][NS_SDImport] = true;

SDImport interface

There is a preliminary SDImport Special Page (Special:SDImport) that simplifies uploading content (especially for JSON pages)

Properties need to be defined in namespace configuration.

At the time of writing:

  • First column: Page name (in selected namespace)
  • Rest of the columns, according to rowfields values...

JSON schema

Keys defined in JSON schema have precedence in front of what is defined in namespace configuration.

	{
		"meta": {
			"app": "SDI",
			"version": 0.1,
			"rowobject": "Entry",
			"rowfields": ["Relation1", "Relation2"]
		},
		"data": [
			[
				"2",
				"4"
			],
			[
				"2",
				"5"
			]
		]
	}

Useful extensions

If we enable $GLOBALS["wgSDImportDataPage"][NS_SDImport]["edit"] = true; in LocalSettings.php we allow content to be modified by a spreadsheet-like interface.

However we might be interested to edit in another way. For this we recommend to install 2 extensions:

$wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension

统计信息

  • 总下载量: 198
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2015-02-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固