Semantic Web and RDF library for Python
Project description
Quick Start
>>> from pymantic.rdf import * >>> from pymantic.parsers import turtle_parser >>> from urllib2 import urlopen >>> Resource.prefixes['foaf'] = Prefix('http://xmlns.com/foaf/0.1/') >>> graph = turtle_parser.parse(urlopen('https://raw.github.com/norcalrdf/pymantic/master/examples/foaf-bond.ttl')) >>> bond_james = Resource(graph, 'http://example.org/stuff/Bond') >>> print "%s knows:" % (bond_james.get_scalar('foaf:name'),) >>> for person in bond_james['foaf:knows']: print person.get_scalar('foaf:name')
Requirements
Pymantic requires Python 2.7 or higher. Lepl is used for the Turtle and NTriples parser. Python requests library is used for HTTP requests and the SPARQL client. lxml and rdflib are required by the SPARQL client as well.
Install
$ python setup.py install
This will install Pymantic and all its dependencies.
Documentation
Generating a local copy of the documentation requires Sphinx:
$ easy_install Sphinx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymantic-0.1.1.tar.gz
(41.6 kB
view details)
Built Distribution
File details
Details for the file pymantic-0.1.1.tar.gz
.
File metadata
- Download URL: pymantic-0.1.1.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63c46d4eaeb6ad0c1740751d49a1e5c7449764c1b8e8315a5b2e15c1419c2ef7 |
|
MD5 | 8b4fc8809a61e076318b77c5eba18545 |
|
BLAKE2b-256 | fcf2f2fdee5e208950d603423ec065373023ecee471b1c791ab7bd04e2e6d90c |
File details
Details for the file pymantic-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: pymantic-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ea97cd81c536b45cd4559f3a581486902bf60da208b355daa20dcc4ffb56897 |
|
MD5 | 76c556205f4b03bb01254f1271c1bafd |
|
BLAKE2b-256 | 8f32c8817f966082f0bfe1dbac25f4bf7d2c9bf566201f192bede22cd8d8e591 |