Skip to main content

Semantic Web and RDF library for Python

Project description

Quick Start

>>> from __future__ import print_function
>>> from pymantic.rdf import *
>>> from pymantic.parsers import turtle_parser
>>> import requests
>>> Resource.prefixes['foaf'] = Prefix('http://xmlns.com/foaf/0.1/')
>>> graph = turtle_parser.parse(requests.get('https://raw.github.com/norcalrdf/pymantic/master/examples/foaf-bond.ttl').text)
>>> 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. lark is used for the Turtle and NTriples parser. The requests library is used for HTTP requests and the SPARQL client. lxml and rdflib are required by the SPARQL client as well.

Install

$ pip install pymantic

This will install pymantic and all its dependencies.

Documentation

Generating a local copy of the documentation requires Sphinx:

$ pip install Sphinx

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

pymantic-0.2.6.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

pymantic-0.2.6-py2.py3-none-any.whl (60.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pymantic-0.2.6.tar.gz.

File metadata

  • Download URL: pymantic-0.2.6.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for pymantic-0.2.6.tar.gz
Algorithm Hash digest
SHA256 1e0275b6911a66f556d73bba06edad54643cedcfe18a49382de91102c0478603
MD5 d055936930d8f876829a6b34eb2fd512
BLAKE2b-256 18e4dc849a6ed5c7383429c42b89cf984bcad8bbb6173de0c3c96bff545dba80

See more details on using hashes here.

File details

Details for the file pymantic-0.2.6-py2.py3-none-any.whl.

File metadata

  • Download URL: pymantic-0.2.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for pymantic-0.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c748ee0533410cfc03d67cde4c517308a714c768a3bd6b558fadca53a05cb05d
MD5 6640acb0b53d3c464b5ef936573d5de6
BLAKE2b-256 8d3cbb886623dcbd547e31a9998974c94db0fbd1bc370a5cf64fb5031fe14ac4

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