Package: rdf-to-html
# RDF to HTML converterThe RDF to HTML converter aims to provide documentation for RDF files by generating
a more human readable version of the data.The converter currently supports splitting all subjects of an RDF file into separate paragraphs,
each with a title, type and description. Each paragraph can then be expanded to show all data
contained in the file.To further improve the readability, the converter also tries to download the specification
for all predicates in the file. This allows it to generate a more readable version of the predicates
as well.The HTML files output by the converter will be HTML files with a language suffix (.en, .sv, etc.)
to allow tools such as Apache mod_negotiation to serve different languages based on the users
preferences.## Setup
* Create a virtual environment and activate itvirtualenv venv; . venv/bin/activate* Runpython setup.py installyou will now have an executable namedrdf-to-htmlin your path
* Or install it via PyPipip install rdf-to-html## Runusage: rdf-to-html [-h] [–languages LANGUAGES] [–watch] [–verbose][–log-file LOG_FILE]
DCAT_FILE [DCAT_FILE …] OUTPUT_DIRRDF to HTML converter.positional arguments:DCAT_FILE             DCAT file
OUTPUT_DIR            Output directoryoptional arguments:-h,--helpshow this help message and exit--languagesLANGUAGESLanguages (on ISO-369-* format) to generate separated
by comma (,). If omitted all encountered languages are
generated.--watchWatch input files for changes and run the conversion
when a change occurs.--verboseOnly log critical events--log-fileLOG_FILEFile to log to. If omitted logging will be sent to
stdout### Examples
The easiest way to run the converter is to simply run in on a single file.
Which will create one HTML file for each language present in the DCAT file.rdf-to-html DCAT_FILE OUTPUT_DIRIf you only want to generate HTML for specific languages you can specify them as
flags to the application. If the languages specified aren’t exactly the same those encountered in the DCAT file, the program will exit.
This functionallity is mainly included to avoid to generate output for DCAT files containing typos in the language tags.rdf-to-html –languages en,sv DCAT_FILE OUTPUT_DIRThe typical use case is to setup the script to watch for changes in one or more RDF files.
This will enable you to always have an up to date human readable version of your datafile.
To do this setup the following code to be run when the server starts.rdf-to-html –watch DCAT_FILE [DCAT_FILE …] OUTPUT_DIRNoteThe watch is bound to a specific inode, not a filename, which means that the script
will still monitor the same file if you move/rename it.An example HTML page generated by the converter can be found [here](http://opennorth.se/datasets/dcat).## Develop
The generated files can of course be opened manually, but for convenience
a development web server is included atdevel/webserver.py.Just runpython webserver.pyin the folder where you have your
generated HTML-files and you can view them in your browserlocalhost:8080/YOUR_FILE.## CKAN extension
This repository includes code to upload data from an RDF file to CKAN in order to show metadata about datasets. The upload script will utilize the extras field in CKAN to store this data. To
display the data display these nicely you should install [this](https://github.com/openumea/ckanext-rdf-to-html) extension.For more information on how to use this extension please refer to the readme [here](https://github.com/openumea/ckanext-rdf-to-html)## AcknowledgementsThis application was developed by [Dohi Agency](http://dohi.se/agency) in cooperation with
[Umeå Kommun](http://umea.se) in a project financed by
[Internetfonden](https://www.iis.se/vad-vi-gor/internetfonden/).