Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A simple Python object-triple mapping. ....

Project description

Object-triple Mapping

1. Requirements

This module requires the rdflib package installation:

$ pip install rdflib

2. How to Install

For install this package execute the command in your environment:

$ pip install simpot

or:

$ pip install -i https://test.pypi.org/simple/ simpot

3. How to use

import simpot

from rdflib import Namespace, Literal, URIRef,RDF
from simpot import RdfsClass, BNamespace, graph
from rdflib.namespace import DC, FOAF


# exemplo do rdflib
class Person:
    nick = FOAF.nick
    name = FOAF.name
    email = FOAF.mbox

    @RdfsClass(FOAF.Person, None) # blank node
    @BNamespace("dc", DC)
    @BNamespace("foaf", FOAF)
    def __init__ (self, name, nick, email):
        self.nick = Literal(nick, lang="foo")
        self.name = Literal (name)
        self.email = URIRef(email) 

p = Person ("Donna Fales","donna", "mailto:donna@example.org")
print (graph(p).serialize())

https://docs.python-guide.org/writing/structure/#test-suite

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for simpot, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size simpot-0.0.1.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page