Skip to content

Commit

Permalink
Update README with new usage, after it writes separate template and p…
Browse files Browse the repository at this point in the history
…roperties files
  • Loading branch information
samuell committed Aug 17, 2016
1 parent 659efbb commit 673e460
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
RDF2SMW
rdf2smw
=======

A (commandline) tool to convert from RDF triples to Semantic MediaWiki facts
(in MediaWiki XML export format).
A commandline tool to convert from RDF triples to [Semantic MediaWiki](http://semantic-mediawiki.org) facts
in MediaWiki XML export format to be used with [MediaWiki](https://www.mediawiki.org)'s built-in
[XML import feature](https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps).

It allows you too import RDF data into a [Semantic MediaWiki](http://semantic-mediawiki.org), via [MediaWiki](https://www.mediawiki.org)'s
robust built-in [XML import feature](https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps).
This allows you to quickly and simply populate a Semantic MediaWiki page
structure, from an RDF data file.

It is written in Go for better performance (than PHP). The latest version
It is written in Go for better performance than PHP. The latest version
processes triples into pages in the order of ~55K triples/sec converted into
~13K pages/sec on an 2014 i5 Haswell, dual core processor (max 2.1GHz I think)
running Xubuntu, although these numbers probably depend a lot on the structure
of the dataset.
~13K pages/sec on an 2014 i5 Haswell dual core processor, to give an idea.

RDF2SMW is very similar to the RDF import function in the
rdf2smw is very similar to the RDF import function in the
[RDFIO](https://github.com/rdfio/RDFIO) Semantic MediaWiki extension, but takes
another approach: Whereas RDFIO converts RDF to wiki pages and imports them in
the same go, RDF2SMW first converts RDF to an XML file outside of PHP (for
the same go, rdf2smw first converts RDF to an XML file outside of PHP (for
better performance), and then importing using MediaWiki's built-in import
function.

**Status:** The tool is now feature complete, including ability to write facts
via template calls, if a categorization (via owl:Class) of the subject can be
done. What is lacking is more options to fine-tune things. Right now you'll
have to modify the source code yourself if you need any customization. Hope to
address this in the near future.

For more detailed status, see [TODO.md](https://github.com/samuell/rdf2smw/blob/master/TODO.md)
**Status:** The tool is pretty much feature complete, including ability to
write facts via template calls if a categorization (via owl:Class or rdf:type)
of the subject can be done. What is lacking is more options to fine-tune
things. Right now you'll have to modify the source code yourself if you need
any customization. Hope to address this in the near future.

Installation
------------
Expand All @@ -37,7 +34,6 @@ For linux 64 bit:
2. Unpack it with: `gunzip rdf2smw_linux64.gz`
3. Call it, on the commandline (see the usage section below).


Usage
-----

Expand All @@ -49,21 +45,31 @@ format, with the `--in` flag, and an output file in XML format with the
./rdf2smw --in triples.nt --out semantic_mediawiki_pages.xml
```

The resulting XML file, can then be imported into MediaWiki / Semantic
MediaWiki, via the `importDump.php` maintenance script, located in the
`maintenance` folder under the main mediawiki folder:
In addition to the specified output file, there will be separate files for
templates and properties, named similar to the main output file, but replacing
`.xml` with `_templates.xml` and `_properties.xml` respectively.

These XML files can then be imported into MediaWiki / Semantic MediaWiki, via
the `importDump.php` maintenance script, located in the `maintenance` folder
under the main mediawiki folder.

```bash
php <wikidir>/maintenance/importDump.php semantic_mediawiki_pages_templates.xml
php <wikidir>/maintenance/importDump.php semantic_mediawiki_pages_properties.xml
php <wikidir>/maintenance/importDump.php semantic_mediawiki_pages.xml
```

Note that the order above is highly recommended (templates, then properties,
then the rest), so as to avoid unnecessary re-computing of semantic data after
the import is done.

Technical notes
---------------

RDF2SMW is based on the [FlowBase](https://github.com/flowbase/flowbase)
rdf2smw is based on the [FlowBase](https://github.com/flowbase/flowbase)
flow-based programming micro-framework.

Acknowledgements
----------------

RDF2SMW makes heavy use of [Petter Goksøyr Åsen](https://github.com/boutros)'s awesome [RDF parsing library](https://github.com/knakk/rdf).
rdf2smw makes heavy use of [Petter Goksøyr Åsen](https://github.com/boutros)'s awesome [RDF parsing library](https://github.com/knakk/rdf).

0 comments on commit 673e460

Please sign in to comment.