GithubHelp home page GithubHelp logo

sparql-streamline's Introduction

SPARQL streamline

A jena-wrapper for using SPARQL out of the box in your code.

Maven install

Import in your pom.xml the following dependency

<dependency>
    <groupId>io.github.andreacimminoarriaga</groupId>
    <artifactId>sparql-streamline</artifactId>
    <version>0.1.5</version>
</dependency>

Quick start

For interacting with a SPARQL endpoint first it has to be configured. Next excerpt shows how to set up a Graph DB with a repo named test and with security enabled (username is rootand password is toor):

SparqlEndpointConfiguration configuration = new SparqlEndpointConfiguration();
configuration.setEndpointQuery("http://localhost:7200/repositories/test");
// Set update endpoint when you need to write data in the triple store
configuration.setEndpointUpdate("http://localhost:7200/repositories/test/statements");
// Set credentials only when the triple store has security enabled, leave as null oterwhise.
configuration.setUsername("root");
configuration.setPassword("toor"); 

Once the SPARQl endpoint is configured, it can be accessed for either query or write.

SparqlEndpoint endpoint = **new** SparqlEndpoint(sec);

// Querying the endpoint
String query = "SELECT * { ?s a ?t }"; // SELECT, ASK, CONSTRUCT, or DESCRIBE queries
// The ResultsFormat class is an enum containing all the possible result serialisations
ByteArrayOutputStream result = endpoint.query(query, ResultsFormat.FMT_RS_CSV) ;
// method query() can also receive a base namespace as third argument

// Updating the endpoint
String update = "CLEAR ALL" // UPDATE queries
endpoint.update(update);

sparql-streamline's People

Contributors

andreacimminoarriaga avatar jucanbe 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.