Skip to main content

An example rdflib graph with some simpsons.

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.2.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpsons_rdf-0.1.2.tar.gz
  • Upload date:
  • Size: 1.6 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.2.tar.gz
Algorithm Hash digest
SHA256 988da08c22614073f84260adbafb4f0df70825fd732def1e1d114c07f906c777
MD5 b3ce702669a6ae82788e5f31f20db88f
BLAKE2b-256 7e164677210e5e6ab27537f91052670aebac5f64a61fde79107aa539a03a6b21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpsons_rdf-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e481b96ebcdc0a6c51dc5dd36e8ea2371a7dcbb506dc8081312a049febe0737
MD5 48693dfa185355b5ad52d66a20da6844
BLAKE2b-256 fa42e7183382cea4aaa00d7fe7cee5ed174f453ebff160048386a10821f5aab2

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