Giter Club home page Giter Club logo

blazegraph-python's Introduction

blazegraph-python

Python client library for Blazegraph (Pymantic fork)

Semantic Web and RDF library for Python

#Features Support Matrix

REST Endpoint

Call / parameters

Pyton client (Pymantic)

QUERY

GET Request-URI ?query=...

+

POST Request-URI ?query=...

+

parameters

timestamp

-

explain

-

analytic

-

default-graph-uri

+

named-graph-uri

+

format

-

baseURI

-

includeInferred

-

timeout

-

${var}=Value

-

headers

X-BIGDATA-MAX-QUERY-MILLIS

+

INSERT

INSERT RDF (POST with Body)

POST Request-URI
...
Content-Type:
...
BODY

-

INSERT RDF (POST with URLs)

POST Request-URI ?uri=URI

-

DELETE

DELETE with Query

DELETE Request-URI ?query=...

-

DELETE with Body (using POST)

POST Request-URI ?delete
...
Content-Type
...
BODY

-

UPDATE

UPDATE
(SPARQL 1.1 UPDATE)

POST Request-URI ?update=...

+

parameters

using-graph-uri

+

using-named-graph-uri

+

UPDATE (DELETE + INSERT)
(DELETE statements
selected by a QUERY plus
INSERT statements from
Request Body using PUT)

PUT Request-URI ?query=...
...
Content-Type
...
BODY

-

UPDATE
(POST with Multi-Part
Request Body)

POST Request-URI ?updatePost
...
Content-Type: multipart/form-data; boundary=...
...
form-data; name="remove"
Content-Type: ...
Content-Body
...
form-data; name="add"
Content-Type: ...
Content-Body
...
BODY

-

Multi-Tenancy API

DESCRIBE DATA SETS

GET /bigdata/namespace

-

CREATE DATA SET

POST /bigdata/namespace
...
Content-Type
...
BODY

-

DESTROY DATA SET

DELETE /bigdata/namespace/NAMESPACE

-

Transaction Management API

POST /bigdata/tx => txId

-

COMMIT-TX

POST /bigdata/tx/txid?COMMIT

-

LIST-TX

GET /bigdata/tx

-

CREATE-TX

POST /bigdata/tx(?timestamp=TIMESTAMP)

-

STATUS-TX

POST /bigdata/tx/txId?STATUS

-

ABORT-TX

POST /bigdata/tx/txId?ABORT

-

PREPARE-TX

POST /bigdata/tx/txId?PREPARE

-

Access Path Operations

FAST RANGE COUNTS

GET Request-URI ?ESTCARD&([s|p|o|c]=(uri|literal))[&exact=(true|false)+

-

HASSTMT

GET Request-URI ?HASSTMT&([s|p|o|c]=(uri|literal))[&includeInferred=(true|false)+

-

GETSTMTS

GET Request-URI ?GETSTMTS
...
Content-Type
...

-

POST Request-URI ?GETSTMTS
...
Content-Type
โ€ฆ

-

DELETE with Access Path

DELETE Request-URI ?([s|p|o|c]=(uri|literal))+

-

STATUS

GET /status

-

CANCEL

POST /bigdata/sparql/?cancelQuery&queryId=....

-

Quick Start

from pymantic import sparql

server = sparql.SPARQLServer('http://127.0.0.1:9999/bigdata/sparql')

# Loading data to Blazegraph
server.update('load <file:///tmp/data.n3>')

# Executing query
result = server.query('select * where { <http://blazegraph.com/blazegraph> ?p ?o }')
for b in result['results']['bindings']:
    print "%s %s" (b['p']['value'], b['o']['value']

Requirements

Pymantic requires Python 2.6 or higher. Lepl is used for the Turtle and NTriples parser. httplib2 is used for HTTP requests and the SPARQL client. simplejson and lxml are required by the SPARQL client as well.

Install

$ python setup.py install

This will install Pymantic and all its dependencies.

Documentation

Generating a local copy of the documentation requires Sphinx:

$ easy_install Sphinx

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.