SuRF – Object RDF mapper¶
SuRF is an Object - RDF Mapper based on the popular rdflib python library. It exposes the RDF triple sets as sets of resources and seamlessly integrates them into the Object Oriented paradigm of python in a similar manner as ActiveRDF does for ruby.
Quick start:
from surf import * store = Store(reader='rdflib', writer='rdflib', rdflib_store='IOMemory') session = Session(store) print 'Load RDF data' store.load_triples(source='http://www.w3.org/People/Berners-Lee/card.rdf') Person = session.get_class(ns.FOAF['Person']) all_persons = Person.all() print 'Found %d persons that Tim Berners-Lee knows'%(len(all_persons)) for person in all_persons: print person.foaf_name.first # Create a person object somebody = Person() somebody_else = Person() somebody.foaf_knows = somebody_else
Documentation¶
API reference¶
- The
surf.exceptionsModule - The
surf.namespaceModule - The
surf.rdfmodule - The
surf.logmodule - The
surf.pluginModule - The
surf.queryModule - The
surf.resourceModule - The
surf.resourcebase Module - The
surf.restModule - The
surf.serializerModule - The
surf.sessionModule - The
surf.storeModule - The
surf.utilModule