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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpsons_rdf-0.1.3.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.11.7-300.fc41.x86_64

File hashes

Hashes for simpsons_rdf-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0cbe45daa5722adb07a87872a16f4e45380f4a84d6b1b6619d2976f8cd33c9b6
MD5 68749938fdb4836095ae890f17d19f45
BLAKE2b-256 73660c140beb0522b26d41017c99fc85f4336571903ed35839c4e4efec6ed2f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpsons_rdf-0.1.3-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.13.0 Linux/6.11.7-300.fc41.x86_64

File hashes

Hashes for simpsons_rdf-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33babf116706e0abc8a35964dac6c163e8919dc63423241995715586ec3f20ad
MD5 166c259a1e79ea3eea6bb1dfb3200229
BLAKE2b-256 07b524f0ed6f3c362d1249f36f98480e4cc4e0318f6fcdcb9e9313871ee6c814

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