Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.0%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: nvitucci
  • License: apache-2.0
  • Language: Java
  • Default Branch: main
  • Size: 60.5 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created about 5 years ago · Last pushed about 4 years ago
Metadata Files
Readme Changelog License Citation

README.md

Calcite SPARQL adapter

This adapter can be used to execute SQL queries over a SPARQL endpoint via Apache Calcite and Apache Jena. The project is a work in progress and it is not meant to be run in production.

Description

The adapter can be used in several modes to expose the RDF data in a SPARQL endpoint as data:

  • the property mode, which exposes every RDF property (the ?p of a ?s ?p ?o pattern) as a table with two columns s (subject) and o (object);
  • the class mode, which exposes every RDF class (the ?cl of a ?s rdf:type ?cl pattern) as a table whose columns are all the properties that link items of such class (the ?s of the same pattern) to objects;
  • the mapping mode, where selected properties are directly mapped to columns of a specified table.

Example of the model file

The SPARQL endpoint in the following examples is a Jena in-memory endpoint created from a local file. Replace with e.g. "jdbc:jena:remote:query=https://dbpedia.org/sparql" to use a remote endpoint.

  1. Using the property mode: json { "version": "1.0", "defaultSchema": "sparql", "schemas": [ { "name": "sparql", "type": "custom", "factory": "com.datagrafting.sql2sparql.calcite.SparqlSchemaFactory", "operand": { "endpoint": "jdbc:jena:mem:dataset=data.nq", "tableMode": "property" } } ] }

  2. Using the class mode:

json { "version": "1.0", "defaultSchema": "sparql", "schemas": [ { "name": "sparql", "type": "custom", "factory": "com.datagrafting.sql2sparql.calcite.SparqlSchemaFactory", "operand": { "endpoint": "jdbc:jena:mem:dataset=data.nq", "tableMode": "class" } } ] }

  1. Using the mapping mode:

json { "version": "1.0", "defaultSchema": "sparql", "schemas": [ { "name": "sparql", "type": "custom", "factory": "com.datagrafting.sql2sparql.calcite.SparqlSchemaFactory", "operand": { "endpoint": "jdbc:jena:mem:dataset=data.nq", "tableMode": "mapping", "tableMappings": [ { "name": "Person", "columns": [ { "name": "name", "property": "http://xmlns.com/foaf/0.1/name" }, { "name": "age", "property": "http://xmlns.com/foaf/0.1/age" } ] } ] } } ] }

Basic Usage

Running the examples

Compile the main library using Java 11:

shell cd core mvn clean package -DskipTests cd ..

or using Java 8:

shell cd core mvn clean package -P java1.8 -DskipTests cd ..

Please note that compiling with Java 8 forces Jena version to 3.17.0 (last version before switching to Java 11).

For the Java examples:

shell cd example mv clean package /path/to/java -cp target/classes:../../core/target/calcite-sparql-core-0.0.1-SNAPSHOT.jar com.datagrafting.sql2sparql.examples.SparqlClassTableRemote

For the Python examples, Python 3 and Jupyter Notebook need to be installed first. Then, the notebooks can be run from the examples/python directory.

Pushed-down SQL constructs

  • SELECT * and SELECT with any number of columns
  • WHERE (with =, <>, <, >, <=, >=)
  • ORDER BY
  • LIMIT

Releasing

When releasing, please make sure to update both the changelog and the citation file.

Citing the project

If you use this project in an article, please cite it as specified in the CITATION.cff file.

Acknowledgements

Many thanks to:

  • Paul Jackson for interesting discussions on the mapping from RDF to SQL schema.

Owner

  • Name: Nicola Vitucci
  • Login: nvitucci
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
title: calcite-sparql
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Nicola
    family-names: Vitucci
    email: nicola.vitucci@gmail.com
repository-code: "https://github.com/nvitucci/calcite-sparql"
version: 0.0.1
date-released: 2022-01-23

GitHub Events

Total
Last Year

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 8
  • Total Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
nvitucci n****i@g****m 8

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

core/pom.xml maven
  • com.google.guava:guava 31.0.1-jre
  • org.apache.arrow:arrow-jdbc 6.0.1
  • org.apache.arrow:arrow-memory 6.0.1
  • org.apache.calcite:calcite-core 1.29.0
  • org.apache.jena:jena-jdbc-driver-remote 4.4.0
  • org.apache.jena:jena-jdbc-driver-mem 4.4.0 test
  • org.assertj:assertj-core 3.22.0 test
  • org.junit.jupiter:junit-jupiter-api 5.8.2 test
  • org.junit.jupiter:junit-jupiter-engine 5.8.2 test