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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simpsons_rdf-0.2.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpsons_rdf-0.2.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.11-300.fc42.x86_64

File hashes

Hashes for simpsons_rdf-0.2.1.tar.gz
Algorithm Hash digest
SHA256 39806c20e6e59732cb614fb7847fe4b751c03a84a076814c0ee65b1f7970953c
MD5 9972179fd78c5d4bb7fcc14e4dfd10ab
BLAKE2b-256 f9d5546a3de63c569711b028d28baebdf45bac58a4c50f705416f49e9d0eb88f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpsons_rdf-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.11-300.fc42.x86_64

File hashes

Hashes for simpsons_rdf-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 632c1ca6f6e3754ee87811a3ca3baf64245483a974d046aa7b1e4c185fd720bf
MD5 7325692cafa643cb500d35f7b40de613
BLAKE2b-256 2e03ceec029d7d89df617ff61725dca7e5036d6cae547c1e4aadca783deee172

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page