Package: sage-engine
Sage: a SPARQL query engine for public Linked Data providersRead the online documentationSaGe is a SPARQL query engine for public Linked Data providers that implementsWeb preemption. The SPARQL engine includes a smart Sage client
and a Sage SPARQL query server hosting RDF datasets (hosted usingHDT).
This repository contains thePython implementation of the SaGe SPARQL query server.SPARQL queries are suspended by the web server after a fixed quantum of time and resumed upon client request. Using Web preemption, Sage ensures stable response times for query execution and completeness of results under high load.The complete approach and experimental results are available in a Research paper accepted at The Web Conference 2019,available here.Thomas Minier, Hala Skaf-Molli and Pascal Molli. "SaGe: Web Preemption for Public SPARQL Query services" in Proceedings of the 2019 World Wide Web Conference (WWW'19), San Francisco, USA, May 13-17, 2019.We appreciate your feedback/comments/questions to be sent to ourmailing listorour issue tracker on github.Table of contentsInstallationGetting startedServer configurationStarting the serverSage Docker imageCommand line utilitiesDocumentationInstallationInstallation in avirtualenvisstrongly advised!Requirements:Python 3.7 (or higher)pipgcc/clangwithc++11 supportPython Development headersYou should have thePython.hheader available on your system.For example, for Python 3.6, install thepython3.6-devpackage on Debian/Ubuntu systems.Installation using pipThe core engine of the SaGe SPARQL query server withHDTas a backend can be installed as follows:pipinstallsage-engine[hdt,postgres]The SaGe query engine uses variousbackendsto load RDF datasets.
The various backends available are installed as extras dependencies. The above command install both the HDT and PostgreSQL backends.Manual Installation using poetryThe SaGe SPARQL query server can also be manually installed using thepoetrydependency manager.gitclonehttps://github.com/sage-org/sage-enginecdsage-engine
poetryinstall--extras"hdt postgres"As with pip, the various SaGe backends are installed as extras dependencies, using the--extrasflag.Getting startedServer configurationA Sage server is configured using a configuration file inYAML syntax.
You will find below a minimal working example of such configuration file.
A full example is availablein theconfig_examples/directoryname:SaGe Test servermaintainer:Chuck Norrisquota:75max_results:2000graphs:-name:dbpediauri:http://example.org/dbpediadescription:DBPediabackend:hdt-filefile:datasets/dbpedia.2016.hdtThequotaandmax_resultsfields are used to set the maximum time quantum and the maximum number of results
allowed per request, respectively.Each entry in thedatasetsfield declare a RDF dataset with a name, description, backend and options specific to this backend.
Currently,onlythehdt-filebackend is supported, which allow a Sage server to load RDF datasets fromHDT files. Sage usespyHDTto load and query HDT files.Starting the serverThesageexecutable, installed alongside the Sage server, allows to easily start a Sage server from a configuration file usingGunicorn, a Python WSGI HTTP Server.# launch Sage server with 4 workers on port 8000sagemy_config.yaml-w4-p8000The full usage of thesageexecutable is detailed below:Usage: sage [OPTIONS] CONFIG

  Launch the Sage server using the CONFIG configuration file

Options:
  -p, --port INTEGER              The port to bind  [default: 8000]
  -w, --workers INTEGER           The number of server workers  [default: 4]
  --log-level [debug|info|warning|error]
                                  The granularity of log outputs  [default:
                                  info]
  --help                          Show this message and exit.SaGe Docker imageThe Sage server is also available through aDocker image.
In order to use it, do not forget tomount in the containerthe directory that contains you configuration file and your datasets.dockerpullcallidon/sage
dockerrun-vpath/to/config-file:/opt/data/-p8000:8000callidon/sagesage/opt/data/config.yaml-w4-p8000DocumentationTo generate the documentation, navigate in thedocsdirectory and generate the documentationcddocs/
makehtml
openbuild/html/index.htmlCopyright 2017-2019 -GDD Team,LS2N,University of Nantes