Triple pattern matching over non-RDF datasources
Switch branches/tags
Nothing to show
Clone or download
Latest commit 51faf95 Sep 18, 2018

README.md

ODMTP TPF Server

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.

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.

Instructions

Prelude

macOS

You need to install Homebrew.

and then install Python 2.7:

brew install python

Ubuntu

sudo apt-get install python-dev python-setuptools

Dependencies

You need to install dependencies with pip:

pip install -r requirements.txt

Running The Platform

macOS & Ubuntu

From ~/odmtp-tpf run the comand:

python manage.py runserver

The TPF server should run at: http://127.0.0.1:8000/

Examples of Simple Queries

You can use any Triple Pattern Fragment client: http://linkeddatafragments.org/software/ to run SPARQL queries over twitter API and github Repo API V3

SPARQL queries over Twitter API

You can run this SPARQL query over http://127.0.0.1:8000/twitter/ to retrieve tweets using #iswc2017 hashtag.

PREFIX it: <http://www.influencetracker.com/ontology#>

SELECT ?s WHERE {
 {?s it:includedHashtag "ISWC2018".} UNION {?s it:includedHashtag "iswc2018".}
}

Retrieve tweets from a specific user.

PREFIX schema: <http://schema.org/>

SELECT ?s WHERE {
 ?s schema:author "NantesTech".
}

SPO query to browse tweets

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

To retrieve a specific tweet by ID

SELECT ?p ?o WHERE {
 <https://twitter.com/statuses/889775221452005377> ?p ?o
}

SPARQL queries over Github API

You can run this SPARQL query over http://127.0.0.1:8000/github/ to retrieve repositories using Java programming language.

PREFIX schema: <http://schema.org/>

SELECT ?repo
WHERE {
?repo schema:language "Java"
}

SPO query to browse repositories

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

Extras

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.