Skip to main content

No project description provided

Project description

The Simpsons in RDF

This is an example file modeling the Simpsons Family in RDF. It was originally taken from

http://sws.ifi.uio.no/inf3580/v15/oblig/3/simpsons.ttl

where it is part of an assignment:

https://www.uio.no/studier/emner/matnat/ifi/INF3580/v17/undervisningsmateriale/oblig_4.pdf

I have slightly adopted it and moved it to the <https://simpsons.example.org/> namespace.

The simpsons graph is also included in the JekyllRDF tutorial: https://github.com/white-gecko/JekyllRDF-Tutorial/blob/master/_data/graph.ttl (JekyllRDF)

Usage in Python

To use it in python do:

pip install simpsons-rdf

or

poetry add simpsons-rdf

use it like any other RDFLib Graph object.

from simpsons import simpsons, SIM, FAM

print({p: o for _, p, o in simpsons.graph.triples((SIM.Homer, None, None))})
print([spouse for _, _, spouse in simpsons.graph.triples((SIM.Homer, FAM.hasSpouse, None))])
print(simpsons.graph.serialize(format="turtle"))

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

simpsons_rdf-0.1.1.tar.gz (1.5 kB view details)

Uploaded Source

Built Distribution

simpsons_rdf-0.1.1-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

File details

Details for the file simpsons_rdf-0.1.1.tar.gz.

File metadata

  • Download URL: simpsons_rdf-0.1.1.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.11.5-200.fc40.x86_64

File hashes

Hashes for simpsons_rdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 faa5f70b206bcbd5061c2ee3edc70674bfc34db8398c535c53014be127cdb712
MD5 d74d9e6a4c106f8a8084584eee37912e
BLAKE2b-256 cf99b984c2cdf7ccc12e173b36df5563a208a7c7429abfae35cb9c394a89fe60

See more details on using hashes here.

File details

Details for the file simpsons_rdf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simpsons_rdf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.11.5-200.fc40.x86_64

File hashes

Hashes for simpsons_rdf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2038118884f173c701f9b26dc0fc73ee8c9d4e23acd6bc1641683ca7e22f350
MD5 d954c6e48d49397ab18cd9be5c2334dd
BLAKE2b-256 12454a6782513f5d445cb079835eb19e40fb230e0e33a0fe5e0ae2b885f8afcf

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