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.4.tar.gz (46.7 kB view details)

Uploaded Source

Built Distribution

pymantic-0.2.4-py2.py3-none-any.whl (59.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pymantic-0.2.4.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for pymantic-0.2.4.tar.gz
Algorithm Hash digest
SHA256 ea89df1605c3f19ef6d5477e5fbdcc7ac767b963c8457b79a8ea37025bdd9512
MD5 b54368474ae08c0b1a47ba7a760190d2
BLAKE2b-256 80aa5c183f96db33791161702d5816c22e8458f3b4a0a0fed75f8c60da8ecac8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymantic-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 59.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.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for pymantic-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5e0ba56a9c38be350bdefbc7244b4e4eb45546216060b89874b231217ef2a4ee
MD5 d408eeb3d5cd7010274e6db7b61504b8
BLAKE2b-256 7f54e24657ad18e3878f04b46e1648073f5296b54b40ec1aa51211be5a9aeaf2

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