Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install sparql-client

How to install sparql-client

  1. Download and install ActivePython
  2. Buy and install the Business Edition license from account.activestate.com
  3. Open Command Prompt
  4. Type pypm install sparql-client

sparql-client contains builds that are only available via PyPM when you have a current ActivePython Business Edition subscription.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.11
0.11 Available View build log
0.9 Failed View build log
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
Windows (64-bit)
0.11
0.11 Available View build log
0.9 Failed View build log
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
Mac OS X (10.5+)
0.11
0.11 Available View build log
0.9 Failed View build log
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
Linux (32-bit)
0.11
0.11 Available View build log
0.9 Failed View build log
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
Linux (64-bit)
0.11
0.11 Available View build log
0.9 Failed View build log
0.8 Available View build log
0.7 Available View build log
0.6 Available View build log
 
Author
Dependencies
Imports

sparql-client is a library to query a SPARQL endpoint. It will automatically convert literals to the coresponding Python types.

Visit http://www.eionet.europa.eu/software/sparql-client/ for documentation and examples.

API

First you open a connection to the endpoint:

s = sparql.Service(endpoint)

Then you make the query:

result = s.query(statement)

If you have made a SELECT query, then you can read the result with fetchone() or fetchall():

for row in result.fetchone():

If you have made an ASK query, then you can read the result (a boolean value) with hasresult():

works = result.hasresult()

Conversion of data types

The library will automatically convert typed literals to a coresponding simple type in Python. Dates are also converted if the dateutil library is available.

Running the unit tests

If you have nose installed, just run nosetests in the top-level directory. Some tests require the python-dateutil (version 1.5) or mock libraries. Tested under Python 2.4 through 2.7.

License

The contents of this package are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this package except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The Original Code is SPARQL client version 1.0.

The Initial Owner of the Original Code is European Environment Agency (EEA). Portions created by Eau de Web for EEA are Copyright (C) European Environment Agency. All Rights Reserved.

Authors

  • Søren Roug, EEA
  • Alex Morega, Eau de Web
Changelog

1.3 - (2013-05-20)

  • Bug fix: fixed ReST merkup under HISTORY.txt [ghicaale refs #14554]

1.2 - (2013-05-20)

  • Upgrade step:
    • install system dependency libcurl3-dev (Debian/Ubuntu) / curl-devel (CentOS)
    • [szabozo0 refs #14349]
  • Change: Use pycurl2 instead of pycurl [szabozo0 refs #14349]

  • Bugfix: Use pycurl instead of urllib2, added timeout functionality [szabozo0 refs #14349]

1.1 - (2013-03-15)

  • Feature: Removed sparql error handling quickfix [szabozo0 refs #13705]

1.0 - (2013-01-28)

  • Feature: Handle sparql errors [szabozo0 #9608]

0.16 - (2013-01-15)

  • Bug fix: Strip the endpoint url [szabozo0]

0.15 - (2013-01-10)

  • Packaging fix: inline contents of version.txt [moregale]

0.14 - (2013-01-10)

  • Bug fix: updated History.txt [ghicaale]
  • Buf fix: unit test [moregale]

0.13 - (2012-09-11)

  • Change: changed from HTTP POST to GET [roug]

0.12 - (2012-09-11)

  • No changes

0.11 - (2012-04-15)

  • Feature: added copyright message to sparql.py [roug]

0.10 - (2012-03-05)

  • Feature: map the xsd:int type to Python's int [moregale]

0.9 - (2011-10-24)

  • Feature: new argument convert_type for unpack_row [moregale]

0.8 - (2011-08-29)

  • First version available on PyPI [roug, moregale]

Subscribe to package updates

Download Stats

Last month:12

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.