MLOD4CON - Making Multilingual Linked Open Data Sources Accessible for Content Architects & Content Creators

  1. Overview
  2. Usage
  3. Installation
  4. Configuration
  5. Additional hints
  6. Development roadmap
  7. Acknowledgements

Overview

MLOD4CON (for "Multilingual Linked Open Data for Content Enrichment") is a JavaScript library that assists in enriching HTML5-based content - thus, increasing the content's value.

MLOD4CON is open source and developed on GitHub.

MLOD4CON is customizable.

MLOD4CON operates as follows:

One example usage of MLOD4CON is the generation of so-called schema.org markup that is an important ingredient to Search Engine Optimization (SEO).

Example usages

Basic usage

In order to use MLOD4CON without customization, you simply need to attach the run() method to an element

Welcome to Berlin, the home of Marlene Dietrich!

Source code:

<span
 its-ta-ident-ref="http://dbpedia.org/resource/Berlin"
 onclick="$.mlod4con.run(this);">Berlin</span>
<span
 its-ta-ident-ref="http://dbpedia.org/resource/Marlene_Dietrich"
 onclick="$.mlod4con.run(this);">Marlene Dietrich</span>

Advanced usage I: Richer markup templates

In order to generally customize the annotation that is generated, you use the setMarkupTemplates method. The order of templates given as an option is significant. The first template that completely matches to the query will be used. Example:

Welcome to Berlin, the home of Marlene Dietrich!

Source code:

<span
 its-ta-ident-ref="http://dbpedia.org/resource/Berlin"
 onclick="
  $.mlod4con.setMarkupTemplates('Place-specific,Place-general');
  $.mlod4con.run(this);">Berlin</span>
<span
 its-ta-ident-ref="http://dbpedia.org/resource/Marlene_Dietrich"
 onclick="
  $.mlod4con.setMarkupTemplates('Person-specific,Person-general');
  $.mlod4con.run(this);">Marlene_Dietrich</span>

The setParameters option allows to pass arbitrary parameters to a query. Example:

A query of Marlene Dietrich!

The parameter somePredicate is replaced in the SPAQRL query string with the value
http://dbpedia.org/property/birthPlace. A list of parameters can be separated via |.

Source code:

<span its-ta-ident-ref="http://dbpedia.org/resource/Marlene_Dietrich" onclick="
 $.mlod4con.setQuery('dbpedia-person-query-with-parameters');
 $.mlod4con.setParameters('somePredicate=http://dbpedia.org/property/birthPlace');
 $.mlod4con.run(this);">Marlene Dietrich</span>

Advanced usage II: Multilingual templates and different output formats

In order to customize the annotation that is generated with regards to language, you use the setLanguage method to set language tag tests in queries and to set language specific templates.

In order to customize the annotation that is generated with regards to format, you use the setOutputMarkupType method.

Three output formats are supported

Example:

Willkommen in Berlin, der Heimat von Marlene Dietrich!

Source code:

<span
 its-ta-ident-ref="http://dbpedia.org/resource/Berlin"
 onclick="
  $.mlod4con.setLanguage('de');
  $.mlod4con.setMarkupTemplates('Place-specific,Place-general');
  $.mlod4con.setOutputMarkupType('1');
  $.mlod4con.run(this);">Berlin</span>
<span
 its-ta-ident-ref="http://dbpedia.org/resource/Marlene_Dietrich"
 onclick="
  $.mlod4con.setLanguage('de');
  $.mlod4con.setMarkupTemplates('Person-specific,Person-general');
  $.mlod4con.setOutputMarkupType('1');
  $.mlod4con.run(this);">Marlene Dietrich</span>

Installation

Download the MLOD4CON files and add the following to your HTML document:

<script src="jquery-1.11.1.min.js"></script>
<script src="mlod4consettings.json"></script>
<script src="mlod4con.js"></script>

If you simply want to create a page for demonstration purposes, also add the following textarea element. The generated markup will appear here:

<textarea name="myfield" id="myfield" rows="20" cols="40">
 Generated markup will appear here.</textarea>

Add entity identifiers as values for the its-ta-ident-ref attribute (see simple usage). The attribute is quite interesting (see details).

For all annotated entities, click on the highlighted words to generate the markup.

Configuration

The queries and the markup templates are configured in mlod4consettings.json. Click here to generate an HTML table (at the bottom of this page) that lists all options. Click here to generate XML (in the textarea to the right) that lists all options.

Anatomy of a query:

Anatomy of a markup template:

Additional Hints

Setting options values without JavaScript

All options for calling MLOD4CON can be set without JavaScript. The content author can also add a data-mlod4con attribute. It holds the options separated by semicolon. Example:

Willkommen in Berlin, der Heimat von Marlene Dietrich!

Source code:

<span
 its-ta-ident-ref="http://dbpedia.org/resource/Berlin"
 data-mlod4con=
  "language='de';
  markupTemplates='Place-specific,Place-general';
  outputMarkupType='1';">Berlin</span>
<span
 its-ta-ident-ref="http://dbpedia.org/resource/Marlene_Dietrich"
 data-mlod4con=
  "language='de';
  markupTemplates='Person-specific,Person-general';
  outputMarkupType='1';">Marlene Dietrich</span>

Getting identifiers for entities

The getEntityID method can be used generate identifiers. It takes an element as input and generates markup for its content. Example:

Welcome to Berlin, the home of Marlene Dietrich!

Source code:

<span
 onclick="$.mlod4con.getEntityID(this);">Berlin</span>
<span
 onclick="$.mlod4con.getEntityID(this);">Marlene Dietrich</span>

A form can be used to enter a string and look up the entity + generate markup. Example:

Type some stuff and then click here!:

Source code:

<span
 onclick="
 $.mlod4con.form2Markup($('#inputtext'));">click here</span> ...
 <input id="inputtext">...

Development Roadmap

This is the first version of MLOD4CON. It provides only a small set of templates and relies on DBpedia as sole SPARQL endpoint. Future versions of MLOD4CON may include:

Acknowledgements

MLOD4CON is being developed with support from the LIDER project. A special thanks goes to Christian Lieske (SAP SE) for commenting on early prototypes.


Contact

For questions, comments etc. contact Felix Sasaki.

Generated markup will appear here.
Click here to hide & show the textarea.