npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quartz-tpf

v1.1.1

Published

Quartz: Parallel SPARQL query processing over replicated Triple Pattern Fragments

Downloads

14

Readme

Quartz

Build Status

Quartz is Triple Pattern Fragment client that enables parallel SPARQL query processing over replicated Triple Pattern Fragments.

Table of contents

Abstract

Although Linked Data datasets made available billions of triples, data availability is still an issue. While replicating datasets over different linked data providers improves data availability, balancing the load of query processing across replicas has not been considered yet in the context of Linked Data.

In the context of the Triple Pattern Fragment [1] (TPF) approach, we tackle the problem of query optimization under presence of replicated RDF data and propose a cost-based query optimizer named Quartz, which is able to generate plans that minimize execution time while maximize load balancing. Quartz is able to exploit meta-data about TPFs to produce parallelized query execution plans against replicated TPFs servers. Moreover, a cost model is utilized by the Quartz optimizer to estimate the computation capability of replicated TPF servers. Experimentations demonstrate that Quartz significantly improves not only execution time of SPARQL queries, but also load-balancing between replicated TPF servers.

Installation

Requirements: Node.js v6.x or higher

using npm

npm i --save quartz-tpf

using git

git clone htpps://github.com/Callidon/virtual-decomposer.git
cd virtual-decomposer/
npm i --production

in the browser

<script src="node_modules/quartz-tpf/quartz-tpf.bundle.js" type="text/javascript" />

Experiments

Datasets and queries

We use one instance of the Waterloo SPARQL Diversity Test Suite (WatDiv) synthetic dataset[2,3] with 10^5 triples, encoded in the HDT[4] format. We generate 50,000 queries from 500 templates.

Next, we eliminate all duplicated queries and then pick 100 random queries to be executed against our dataset. Generated queries are STAR, PATH and SNOWFLAKE shaped queries, all using the DISTINCT modifier.

Queries used during the experiments are available here.

Execution time

We compare the average execution time with the reference TPF client (TPF), TPF with PeNeLoop operator[5] (TPF+PeN), TPF with query optimization using virtual triple patterns (TPF+VTP) and the QUaRTz client itself.

  • Configuration using equivalent servers (PDF version): execution time eq
  • Configuration using non equivalent servers (PDF version): execution time neq

We also run experiments for the ten most expensive queries to evaluate, using 1, 2, 3 and 4 equivalents servers (PDF version) execution time top10

Load balancing

PDF version

We compare the number of HTTP calls done to each server per query for TPF+PeN, TPF+VTP and QUaRTz, with both configurations (equivalent and non equivalent servers). We use two servers in each configuration.

  • Configuration using equivalent servers (PDF version): load balancing eq
  • Configuration using non equivalent servers (PDF version): load balancing neq

Answer completeness

PDF version

We compare the answer completeness with TPF, TPF+PeN, TPF+VTP and QUaRTz, with both configurations (equivalent and non equivalent servers)

answer completeness

Wilcoxon ranking test

Results from all the Wilcoxon ranking tests[6] performed are available here.

Command line usage

Quartz can be used through command line if installed globally with npm i -g quartz-tpf:

Usage: quartz <servers...> [options]

  execute a SPARQL query against several endpoints

  Options:

    -h, --help              output usage information
    -p, --peneloop          use peneloop to process joins
    -q, --query <query>     evaluates the given SPARQL query
    -f, --file <file>       evaluates the SPARQL query in the given file
    -l, --limit <limit>     limit the number of triples to localize per BGP in the query (default to 1)
    -t, --type <mime-type>  determines the MIME type of the output (e.g., application/json)
    -m, --measure <output>  measure the query execution time (in seconds) & append it to a file
    -s, --silent            do not perform any measurement (silent mode)

Library usage

Quartz can also be used as a library

'use strict';
const QuartzClient = require('quartz-tpf');

const query = `
  PREFIX dbo: <http://dbpedia.org/ontology/>
  SELECT ?actor ?city
  WHERE {
    ?actor a dbo:Actor.                      
    ?actor dbo:birthPlace ?city.
    ?city dbo:country dbpedia:United_States.
  } LIMIT 3000
`

// all the TPF servers must replicate the same version of the same dataset !
const servers = [
  'http://exampleA.fragments.org/dbpedia',
  'http://exampleB.fragments.org/dbpedia'
]

// provide any TPF servers to calibrate the cost model
const client = new QuartzClient(servers[0]);

client.execute(query, servers)
.then(mappings => console.log(mappings))
.catch(error => console.error(error));

See more details by generating the documentation.

Documentation

Generate the documentation by running npm run doc.

References

  1. Verborgh, R., Vander Sande, M., Hartig, O., Van Herwegen, J., De Vocht, L., De Meester, B., Haesendonck, G., Colpaert, P.: Triple pattern fragments: A low-cost knowledge graph interface for the web. Web Semantics: Science, Services and Agents on the World Wide Web 37, 184–206 (2016)
  2. Aluc, G., Hartig, O., Ozsu, M.T., Daudjee, K.: Diversified stress testing of rdf data management systems. In: International Semantic Web Conference. pp. 197–212. Springer (2014)
  3. Aluç, G., Ozsu, M., Daudjee, K., Hartig, O.: chameleon-db: a workload-aware robust rdf data management system. University of waterloo. Tech. rep., Tech. Rep. CS-2013-10 (2013)
  4. Fernández, J.D., Martínez-Prieto, M.A., Gutiérrez, C., Polleres, A., Arias, M.: Binary rdf representation for publication and exchange (hdt). Web Semantics: Science, Services and Agents on the World Wide Web 19, 22–41 (2013)
  5. Minier, T., Montoya, G., Skaf-Molli, H., Molli, P.: PeNeLoop: Parallelizing federated SPARQL queries in presence of replicated fragments. In: QuWeDa 2017: Querying the Web of Data at ESWC 2017, Portorož, Slovenia, May 28 - June 1, 2017 (2017)
  6. Wilcoxon, F.: Individual comparisons by ranking methods. In: Breakthroughs in Statistics, pp. 196–202. Springer (1992)