Skip to main content
Status
======

.. image:: https://travis-ci.org/cosminbasca/surfrdf.svg?branch=master
:target: https://travis-ci.org/cosminbasca/surfrdf


Description
===========

*SuRF* is a Python library for working with RDF data in an Object-Oriented manner. In SuRF, RDF nodes (subjects and
objects) are represented as Python objects and RDF edges (predicates) as their attributes. *SuRF* is an Object RDF
Mapper (ORM), similar in concept to Object Relational Mappers like *SQLAlchemy*.


Documentation
=============

http://surf-rdf.readthedocs.io/en/latest/


Install
=======

Install SuRF:

.. code:: sh

$ pip install --upgrade surf


Starting with version **1.1.9** the *surf.rdflib* and *surf.sparql_protocol* plugins are bundled with *SuRF*.

You'll need one of the following plugins (also installable by `pip`):

- *surf.allegro_franz*, for the AllegroGraph RDFStore
- *surf.sesame2*, for stores with a Sesame2 HTTP API


Example
=======

The example below shows how to query a resource using the rdflib in-memory backend:

.. code:: python

>>> from surf import *
>>> store = Store(reader='rdflib',
... writer='rdflib',
... rdflib_store='IOMemory')
>>> session = Session(store)
>>> store.load_triples(source='http://www.w3.org/People/Berners-Lee/card.rdf')
True
>>> Person = session.get_class(ns.FOAF.Person)
>>> all_persons = Person.all()
>>> for person in all_persons:
... print person.foaf_name.first
...
Timothy Berners-Lee


Documentation
=============

You can read the documentation online at http://packages.python.org/SuRF/

To build the documentation yourself, install sphinx and run the build step:

.. code:: sh

$ pip install sphinx
$ python setup.py build_sphinx


Testing
=======

*SuRF* uses *tox* and *py.test* for testing:

.. code:: sh

$ tox

Metadata

Release files for SuRF 1.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SuRF 1.1.9
File Size Uploaded
SuRF-1.1.9.tar.gz 55.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SuRF 1.1.9
File Interpreter ABI Platform
SuRF-1.1.9-py2-none-any.whl Python 2 none any Details

Total release size: 136.1 kB

Release files / SuRF-1.1.9.tar.gz

Download URL SuRF-1.1.9.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9af110491a58d1575aba4c29488b31a84e70c6bebcc0135f32a5007f3dd3cefd
BLAKE2b-256 checksum
How to use checksums
914052e7c2e732372268f57ffd8767b677358486ce45d3517bee92c992368e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / SuRF-1.1.9-py2-none-any.whl

Download URL SuRF-1.1.9-py2-none-any.whl
Size 81.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
6cb284eb40b1f80549d17a1541f8d753bbc3b29a74f04bc53f9016c817579b7e
BLAKE2b-256 checksum
How to use checksums
baa21e4ccc3e4a2bfa2b64440b97ecc6facbd77b9bad3528cd2619a1ba855f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.9 This release

2 release files

0.5.0-r66

0.4.0

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page