Giter Site home page Giter Site logo

tioannid / tentris Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dice-group/tentris

0.0 0.0 0.0 9.34 MB

Tentris is a tensor-based RDF triple store with SPARQL support.

Home Page: https://tentris.dice-research.org/iswc2020/

License: GNU Affero General Public License v3.0

C++ 91.26% CMake 6.03% Dockerfile 2.71%

tentris's Introduction

Website Build Status Docker Cloud Build Status GitHub

Tᴇɴᴛʀɪs: A Tensor-based Triple Store

Tᴇɴᴛʀɪs Logo

Tᴇɴᴛʀɪs is a tensor-based RDF triple store with SPARQL support. It is introduced and described in:

Alexander Bigerl, Felix Conrads, Charlotte Behning, Mohamed Ahmed Sherif, Muhammad Saleem and Axel-Cyrille Ngonga Ngomo (2020) Tentris – A Tensor-Based Triple Store. In: The Semantic Web – ISWC 2020

https://tentris.dice-research.org/iswc2020/

@InProceedings{bigerl2020tentris,
  author = {Bigerl, Alexander and Conrads, Felix and Behning, Charlotte and Sherif, Mohamed Ahmed and Saleem, Muhammad and Ngonga Ngomo, Axel-Cyrille},
  booktitle = {The Semantic Web -- ISWC 2020},
  publisher = {Springer International Publishing},
  title = { {T}entris -- {A} {T}ensor-{B}ased {T}riple {S}tore},
  pages = {56--73},
  url = {https://papers.dice-research.org/2020/ISWC_Tentris/iswc2020_tentris_public.pdf},
  year = 2020,
  isbn = {978-3-030-62419-4}
}

Key Features

  • fast tensor-based in-memory storage and query processing
  • SPARQL Protocol conform HTTP interface
  • supports at the moment SPARQL queries with SELECT + opt. DISTINCT + basic graph pattern
  • available for Linux x86-64
Current limitations:
  • no persistance
  • SPARQL support limited to SELECT + opt. DISTINCT + basic graph pattern
  • data loading only possible at startup

Get It

running Tᴇɴᴛʀɪs

Tᴇɴᴛʀɪs provides two ways of running it. Either as a HTTP endpoint or as a interactive commandline tool. Make sure you build Tᴇɴᴛʀɪs successfully, before proceeding below.

HTTP endpoint

Start

To start Tᴇɴᴛʀɪs as a HTTP endpoint run

tentris_server -p 9080 -f my_nt_file.nt

to load the data from the provided .nt file and serve SPARQL endpoint at port 9080. For more options commandline options see tentris_server --help.

Query

The endpoint may now be queried locally at: 127.0.0.1:9080/sparql?query=*your query*.

Notice: the query string *your query* must be URL encoded. You can use any online URL encoder like https://meyerweb.com/eric/tools/dencoder.

An additional endpoint is provided at 127.0.0.1:9080/stream using chunk encoded HTTP response. This endpoint should be used for very large responses (>1mio results).

Usage Example

Consider the query below against a SP²Bench data set:

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bench: <http://localhost/vocabulary/bench/>

SELECT DISTINCT ?article
WHERE {
  ?article rdf:type bench:Article .
  ?article ?property ?value 
}

To run the query start Tᴇɴᴛʀɪs with:

tentris_server -p 3030 -f sp2b.nt 

You can find a populated sp2b.nt file in tests/dataset/sp2b.nt.

now, visit the follwing IRI in a browser to send the query to your Tᴇɴᴛʀɪs endpoint:

http://127.0.0.1:3030/sparql?query=PREFIX%20rdf%3A%20%20%20%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0APREFIX%20bench%3A%20%3Chttp%3A%2F%2Flocalhost%2Fvocabulary%2Fbench%2F%3E%0A%0ASELECT%20DISTINCT%20%3Farticle%0AWHERE%20%7B%0A%20%20%3Farticle%20rdf%3Atype%20bench%3AArticle%20.%0A%20%20%3Farticle%20%3Fproperty%20%3Fvalue%20%0A%7D

CLI Endpoint

For small experiments it is sometimes more convenient to use a commandline tool for querying an RDF graph. Therefore, Tᴇɴᴛʀɪs provides a commandline interface.

To start Tᴇɴᴛʀɪs as a interactive commandline tool, run:

tentris_terminal -f my_nt_file.nt

After the RDF data from my_nt_file.nt is loaded, you type your query and hit ENTER. After the result was printed, you can enter your next query.

For more commandline options see tentris_terminal --help.

Docker

Using the Tᴇɴᴛʀɪs docker image is really easy. Find necessary steps below.

  • A docker image is available on docker hub. Get it with
    docker pull dicegroup/tentris_server
  • To show the available commandline options, run
    docker run --rm dicegroup/tentris_server --help
  • Tᴇɴᴛʀɪs uses by default the port 9080, so make sure you forward it, e.g.
    docker run --publish=9080:9080 dicegroup/tentris_server
  • To load data, mount its enclosing directory to the container and tell Tᴇɴᴛʀɪs, to load it:
    docker run -v /localfolder:/datasets --publish=9080:9080 dicegroup/tentris_server -f /datasets/yourRDFfile.nt
  • By default, Tᴇɴᴛʀɪs writes logs to the /tentris in the container. To make logs available outside the container, you can mount them as well:
    docker run -v /local-log-dir:/tentris --publish=9080:9080 dicegroup/tentris_server
  • The other command-line tools tentris_terminal, ids2hypertrie and ids2hypertrie are also available in the container. Run them like:
    docker run -it  dicegroup/tentris_server tentris_terminal

Build It Yourself

To build Tᴇɴᴛʀɪs yourself, you need some experience with building C++ projects.

Build Tools

Tᴇɴᴛʀɪs is known to build successfully on Ubuntu 20.04 and newer. Building was tested with GCC 10 and clang 10.

The following packages are required to build Tᴇɴᴛʀɪs:

sudo apt install build-essential uuid-dev g++-10 git openjdk-8-jdk python3-pip python3-setuptools python3-wheel

Additionally, a recent version of conan is required:

pip3 install --user conan

Dependencies

Most required dependencies are installed via conan. Therefore, Add the respective remotes:

conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris

Additionally, a statically linked version of the Serd library is required. As the packages in the deb/rpm repositories include only a dynamic library, we need to compile it manually:

git clone --branch v0.30.2 https://gitlab.com/drobilla/serd.git
cd serd
git submodule update --init --recursive
./waf configure --static
sudo ./waf install
cd -

Pull & Build

After you installed all dependencies, you are ready to build Tᴇɴᴛʀɪs. Make sure you are connected to the internet as Tᴇɴᴛʀɪs downloads things at several points throughout the build processes.

If you did not so far, clone Tᴇɴᴛʀɪs:

git clone https://github.com/dice-group/tentris.git

Make sure you are in the cloned folder:

cd tentris

Now, make a build directory and enter it.

mkdir build 
cd build

Get and build the dependencies with conan:

conan install .. --build=missing --settings compiler.libcxx="libstdc++11"

Generate the build skripts with CMAKE and run the build:

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. 
make -j tentris_server tentris_terminal

Now is the time to get yourself a coffee. In about When you build Tᴇɴᴛʀɪs for the first time, it will take some time.

The binaries will be located at tentris/build/bin.

Debug & Test

To compile Tᴇɴᴛʀɪs with debugging symbols, proceed as above but change the cmake command to cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug .. .

To compile the tests, run cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DTENTRIS_BUILD_TESTS=True .. for debugging or cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DTENTRIS_BUILD_TESTS=True .. for release.

tentris's People

Contributors

bigerl avatar mnafshin avatar shaheen47 avatar saleem-muhammad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.