A simple Python object-triple mapping. ....
Project description
Simple 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())
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
simpot-0.4.0.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file simpot-0.4.0.tar.gz
.
File metadata
- Download URL: simpot-0.4.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf58d9262ee84d639e2d1833d53bcd56f88fd28aa0b32e9d26927e0d8e9d78c2 |
|
MD5 | 9c06d2e8f5cdbfdb0c79f73eea34ae65 |
|
BLAKE2b-256 | d7a57208a0d6f450faa9e67bc0619ca8055e9149788f8f3a148d1193df1c951e |
File details
Details for the file simpot-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: simpot-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d261918fea79defc2cd3533dde041c9a87a3b209091b99cdfa0ae48a834c965 |
|
MD5 | 55e18d64b0128af37c5b25555275f3ed |
|
BLAKE2b-256 | dc4d87b10f440a974644352a0f8cc5278e50e1f8c22436b4c66eb562b5aba5f1 |