Semantic Web and RDF library for Python
Python HTML
Pull request Compare This branch is 177 commits ahead of npilon:master.
Latest commit c0bc9f4 Sep 6, 2015 @gcarothers gcarothers Merge pull request #5 from syapse/master
Support for named-graph-uri and default-graph-uri parameters
Failed to load latest commit information.
docs The NOT is rather key Jul 12, 2011
examples Adding foaf bond Jul 5, 2011
pymantic Merge pull request #5 from syapse/master Sep 6, 2015
.gitignore Ignore build directory too. Dec 1, 2011
.hgignore Ignore egg-info directory. Oct 24, 2010
LICENSE Updated documentation, updated copyright info, updated version Mar 29, 2011
pymantic.wpr Bringing up to date with RDF Interfaces from W3C May 10, 2011
setup.cfg First commit Sep 1, 2010



Semantic Web and RDF library for Python

Quick Start

>>> from pymantic.rdf import *
>>> from pymantic.parsers import turtle_parser
>>> from urllib2 import urlopen
>>> Resource.prefixes['foaf'] = Prefix('')
>>> graph = turtle_parser.parse(urlopen(''))
>>> bond_james = Resource(graph, '')
>>> print "%s knows:" % (bond_james.get_scalar('foaf:name'),)
>>> for person in bond_james['foaf:knows']:
        print person.get_scalar('foaf:name')


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.


$ python install

This will install Pymantic and all its dependencies.


Generating a local copy of the documentation requires Sphinx:

$ easy_install Sphinx