Code Monkey home page Code Monkey logo

adhs's Introduction

adhs

Ad-hoc light weight SPARQL endpoint from a file, using Python Flask and RDFLib

Details

Sometimes one needs to set up a quick SPARQL endpoint for a local Turtle file without installing a triplestore. This is a quick demo how to use the Python 3 microframework Flask and RDFLib to provide an Ad-Hoc SPARQL endpoint based on a Turtle or RDF/XML file.

Usage

Example:

./adhs.py file.ttl -i turtle -p 5000

The -i parameter is optional but should be used to specify the format of the file. If it's missing, rdflib.util.guess_format() will be used.

The -p parameter is optional as well. If not provided, flask will be accessible on default port 5000. Navigate to

http://localhost:5000/sparql

to get a very basic form to enter and submit your queries (the form is just some icing on the cake).

Additionally, the SPARQL endpoint accepts GET requests:

http://localhost:5000/sparql?query=select distinct ?s where { ?s a ?c }

The answer format will always be JSON, there is no content negotiation at the moment but will probably be implemented in the future.

Use case

One use case behind the adhs was to provide a quick possibility to set up different ontologies to test them with the Visual SPARQL Builder (VSB) without having to load them into a triplestore like Virtuoso. Additionally, since the VSB needs SPARQL 1.1, it is a convenient alternative on systems don't have high enough version of Virtuoso installed.

Fun facts

ADHS is actually the German abbreviation for ADHD.

Future Work

moved to TODO.md

adhs's People

Contributors

nareike avatar

Watchers

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