Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


odmtp-tpf is a Triple Pattern Fragment server using Python, Django and ODMTP.

ODMTP (On Demand Mapper with Triple pattern matching) enables triple pattern matching over non-RDF datasources.

ODMTP support inference (see Semantic Reasoner (Inference) section)

Online demo

ODMTP's implemented for Twitter API, Github API and Linkedin API are available online. You can run SPARQL queries using the online TPF client demo: Here for Twitter, Here for Github (limited to 60 request per hour) and Here for your Linkedin profile (you will need to login to access your personal LI profile).

ODMTP approach is already used on OpenDataSoft Plateform and can be tested Here.




You need to install Homebrew.

and then install Python 2.7:

brew install python


sudo apt-get install python-dev python-setuptools


You need to install dependencies with pip:

pip install -r requirements.txt

Running The Platform

macOS & Ubuntu

From ~/odmtp-tpf run the comand:

python runserver

The TPF server should run at:

Semantic Reasoner (Inference)

RDF data contains explicit and implicit triples that can be inferred using rules described in ontologies. To support inference, ODMTP use ontologies to materialize implicit triples of mappings (extended mappings). Each API can be queried using extended mappings at:{api}/extended Example:

However, mappings only contains schema of the corresponding RDF dataset. Thus, rules that apply on RDF instances cannot be applied on mappings.

Supported rules

All rules that apply to schema (class and properties) are supported by ODMTP Semantic Reasoner.

Implemented rules

Rule Name if dataset contains ... ... then add
rdfs2 (domain) aaa rdfs:domain xxx .
uuu aaa yyy .
uuu rdf:type xxx .
rdfs3 (range) aaa rdfs:range xxx .
uuu aaa vvv .
vvv rdf:type xxx .
rdfs5 (subProperty transitivity) uuu rdfs:subPropertyOf vvv .
vvv rdfs:subPropertyOf xxx .
uuu rdfs:subPropertyOf xxx .
rdfs7 (subProperty) aaa rdfs:subPropertyOf bbb .
uuu aaa yyy .
uuu bbb yyy .
rdfs9 (subClassOf) uuu rdfs:subClassOf xxx .
vvv rdf:type uuu .
vvv rdf:type xxx .
rdfs11 (subClassOf transitivity) uuu rdfs:subClassOf vvv .
vvv rdfs:subClassOf xxx .
uuu rdfs:subClassOf xxx .
owl sameAs Class uuu owl:sameAs xxx .
vvv rdf:type uuu .
vvv rdf:type xxx .
owl sameAs Property aaa owl:sameAs bbb .
uuu aaa yyy .
uuu bbb yyy .
owl equivalentClass uuu owl:equivalentClass xxx .
vvv rdf:type uuu .
vvv rdf:type xxx .
owl equivalentProperty aaa owl:equivalentProperty bbb .
uuu aaa yyy .
uuu bbb yyy .

Not implemented rules

Not all supported rules are yet implemented. Complete list of RDFS and OWL-LD rules.

Not supported rules

Rules that applies on instances are not supported by ODMTP Semantic Reasoner. examples:

Rule Name if data contains ... ... then add Comment
owl-ld eq-rep-subject subj1 owl:sameAs subj2 .
subj1 aaa obj1 .
subj2 aaa obj1 . Not supported if one of the two subject
is not defined in ontology or mapping
owl-ld eq-rep-object obj1 owl:sameAs obj2 .
subj1 aaa obj1 .
subj1 aaa obj2 . Not supported if subject or objects are
not defined in ontology or mapping


Mappings are accessible at:{api}/mapping Example:

Extended mapping are accessible at{api}/mapping/extended Example:

Examples of Simple Queries

You can use any Triple Pattern Fragment client: to run SPARQL queries over twitter API and github Repo API V3

SPARQL queries over Twitter API

You can run this SPARQL query over to retrieve tweets using #iswc2017 hashtag.

PREFIX it: <>

 ?s it:includedHashtag "SemanticWeb".

Retrieve tweets from a specific user.

PREFIX schema: <>

 ?s schema:author "NantesTech".

SPO query to browse tweets

SELECT ?s ?p ?o WHERE {
 ?s ?p ?o

To retrieve a specific tweet by ID

 <> ?p ?o

SPARQL queries over Github API

You can run this SPARQL query over to retrieve repositories using Java programming language.

PREFIX schema: <>

SELECT ?repo
?repo schema:language "Java"

SPO query to browse repositories

SELECT ?s ?p ?o WHERE {
 ?s ?p ?o


To understand how ODTMP approach is working, the ISWC 2017 poster is available here.

This is just a prototype, feel free to optimize it, improve mapping files, work on new api's etc.


Triple pattern matching over non-RDF datasources with inference





No releases published


No packages published


You can’t perform that action at this time.