Skip to content
Semantic Web Exercise: Reasoning and Visualization of the Genealogical Ontologies
HTML Python Shell
Branch: jph-nsp
Clone or download
Pull request Compare This branch is 13 commits ahead of blokhin:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Semantic Web Genealogical Trees



This is an example of logical reasoning applied to the graphs of genealogical trees. Defining the kinship types on top of genealogical trees seems to be the perfect use case for semantic technologies.

The source of data is the GEDCOM file format (.ged) common for exchange of genealogical information. With the aid of RDFLib and gedcom Python libraries GEDCOM files are converted into the OWL 2 ontologies (ABox) in Turtle syntax (.ttl file extension), adopting the TBox of the Family History Knowledge Base (FHKB, see data/header.ttl file). Note that the FHKB ontology is although very small but uses unusually complex role hierarchy and is rather hard for modern reasoners. After reasoning with the naive Python implementation of the OWL 2 RL Profile and inferring all possible triples the ontologies are finally converted to the JSON-formatted graphs for in-browser visualization. This is done inside the bundled index.html HTML5 web-app by means of D3.js JavaScript library.

Using this repository

The above is summarized in the script, which is used like this:

./ path/to/your/gedcom.ged path/to/entailed_graph.json

Resulting file entailed_graph.json is to be uploaded and visualized in the bundled HTML5 web-app index.html (no server scripting is used). Its copy is currently hosted at GitHub: Locally it should be served from a web-server (e.g. python -m SimpleHTTPServer or php -S localhost:8000).

Before processing, the required Python libraries listed in requirements.txt should be installed (virtualenv is highly recommended).

Blog tutorial

Remark on FHKB

Note however the following comment from FHKB authors:

We probably do not wish to drive a genealogical application using an FHKB in this form. Its purpose is educational. It touches most of OWL 2 and shows a lot of what it can do, but also a considerable amount of what it cannot do. As inference is maximised, the FHKB breaks most of the OWL 2 reasoners at the time of writing. However, it serves its role to teach about OWL 2. OWL 2 on its own and using it in this style, really does not work for family history.

Remark on reasoning

Reasoning with the naive Python implementation of the OWL 2 RL Profile is very slow and takes hours for relatively big family trees. Therefore use of the fast native reasoner (like Fact++) is very desirable. Wrapped in the owl-cpp Python bindings, Fact++ performs up to two orders of magnitude faster.

You can’t perform that action at this time.