Skip to main content

Semantic Web and RDF library for Python

Project description

Quick Start

>>> 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 3.9 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymantic-1.0.1-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file pymantic-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pymantic-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for pymantic-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c917cddd885ad5a09717dffc5a6f49659287c58109ba3062f5279488dcf05b71
MD5 73862e545a2d548f43a37007ed686374
BLAKE2b-256 3b400a5a0dba64ad3eea3925fdd509bcac440be35000e73d5729b50529b5a72c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page