PHPackages                             mediawiki/semantic-data-import - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. mediawiki/semantic-data-import

ActiveMediawiki-extension[PDF &amp; Document Generation](/categories/documents)

mediawiki/semantic-data-import
==============================

0.4.0(7y ago)31981[2 issues](https://github.com/toniher/SemanticDataImport/issues)GPL-3.0-or-laterJavaScriptPHP &gt;=5.6.0CI failing

Since Mar 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/toniher/SemanticDataImport)[ Packagist](https://packagist.org/packages/mediawiki/semantic-data-import)[ Docs](https://github.com/toniher/SemanticDataImport)[ RSS](/packages/mediawiki-semantic-data-import/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

SemanticDataImport
==================

[](#semanticdataimport)

[![Build Status](https://camo.githubusercontent.com/ceb013e5ea2cf307aeb9aff8d8d9c8272b21e5985cb61497d9b02f1f7887796b/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f746f6e696865722f53656d616e74696344617461496d706f72742e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/toniher/SemanticDataImport)[![Code Coverage](https://camo.githubusercontent.com/27e5e4ae7f36cf8dd15ff286f832751c449a481de98e1b6ec2a26e59d313d2f1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746f6e696865722f53656d616e74696344617461496d706f72742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/toniher/SemanticDataImport/?branch=master)

Extension for importing CSV-like structured data into MediaWiki pages using [Semantic MediaWiki](https://www.semantic-mediawiki.org).

It basically turns CSV rows into [Semantic Subobjects](https://www.semantic-mediawiki.org/wiki/Subobject).

Basic Usage
-----------

[](#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
-----------------------

[](#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
------------------

[](#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
-----------

[](#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
-----------------

[](#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:

- [WikiEditor](https://www.mediawiki.org/wiki/Extension:WikiEditor)
- [CodeEditor](https://www.mediawiki.org/wiki/Extension:CodeEditor)

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

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~14 days

Total

6

Last Release

2830d ago

PHP version history (2 changes)0.2.0PHP &gt;=5.3.0

0.4.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5218ca0754245ef120fb4ebc1c520616cb8339e5e4f81301e4906893859d5404?d=identicon)[toniher](/maintainers/toniher)

---

Top Contributors

[![toniher](https://avatars.githubusercontent.com/u/535539?v=4)](https://github.com/toniher "toniher (153 commits)")[![yassin98](https://avatars.githubusercontent.com/u/32881352?v=4)](https://github.com/yassin98 "yassin98 (16 commits)")

---

Tags

mediawikicsvtsvSMWSemantic MediaWiki

### Embed Badge

![Health badge](/badges/mediawiki-semantic-data-import/health.svg)

```
[![Health](https://phpackages.com/badges/mediawiki-semantic-data-import/health.svg)](https://phpackages.com/packages/mediawiki-semantic-data-import)
```

###  Alternatives

[faisalman/simple-excel-php

Easily parse / convert / write between Microsoft Excel XML / CSV / TSV / HTML / JSON / etc formats

578610.1k1](/packages/faisalman-simple-excel-php)[mediawiki/semantic-cite

A Semantic MediaWiki extension to manage citation resources.

2510.4k1](/packages/mediawiki-semantic-cite)[luchaninov/csv-file-loader

Load CSV &amp; TSV files and strings. Using generators to minimize memory usage

1140.5k](/packages/luchaninov-csv-file-loader)[initred/laravel-tabula

laravel-tabula is a tool for liberating data tables trapped inside PDF files for the Laravel framework.

1418.6k](/packages/initred-laravel-tabula)[mediawiki/semantic-interlanguage-links

A Semantic Mediawiki extension to create and manage interlanguage links.

136.0k](/packages/mediawiki-semantic-interlanguage-links)[mediawiki/semantic-watchlist

A Semantic MediaWiki extension that allows users to use a watchlist for semantic properties.

105.8k](/packages/mediawiki-semantic-watchlist)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
