Skip to main content

Object RDF Mapper

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SuRF-1.1.9.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

SuRF-1.1.9-py2-none-any.whl (81.0 kB view details)

Uploaded Python 2

File details

Details for the file SuRF-1.1.9.tar.gz.

File metadata

  • Download URL: SuRF-1.1.9.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for SuRF-1.1.9.tar.gz
Algorithm Hash digest
SHA256 9af110491a58d1575aba4c29488b31a84e70c6bebcc0135f32a5007f3dd3cefd
MD5 24c010c0a4902acd03ca3dca3634bc79
BLAKE2b-256 914052e7c2e732372268f57ffd8767b677358486ce45d3517bee92c992368e0a

See more details on using hashes here.

File details

Details for the file SuRF-1.1.9-py2-none-any.whl.

File metadata

File hashes

Hashes for SuRF-1.1.9-py2-none-any.whl
Algorithm Hash digest
SHA256 6cb284eb40b1f80549d17a1541f8d753bbc3b29a74f04bc53f9016c817579b7e
MD5 bb4284c0af9a810308229a2f4915033f
BLAKE2b-256 baa21e4ccc3e4a2bfa2b64440b97ecc6facbd77b9bad3528cd2619a1ba855f58

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page