Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

pymantic

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pymantic

Semantic Web and RDF library for Python

pipPyPI
Version
1.0.1
Maintainers
2

======== Pymantic

Semantic Web and RDF library for Python

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

Keywords

RDF N3 Turtle Semantics

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts