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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpsons_rdf-0.1.4.tar.gz
  • Upload date:
  • Size: 2.3 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.4.tar.gz
Algorithm Hash digest
SHA256 4fa8eba276bc1ec8d3cd0e2968f351aa62a1d0ca35b4fe0e0a8ca6df40103eb9
MD5 bb63f19340f64b21992cba6d1804c46a
BLAKE2b-256 93620811766c253103b23f8ec040946b95682ab791dddff1f8e70e541b186d0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpsons_rdf-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0644df134305347d95c615e49c40e435f3839a6ffc344fa4f54b534c634dbfb3
MD5 2f554c57b55c663abe500d97775431f0
BLAKE2b-256 76d508adcda83d0a25ca58fc45ecba4f49046c367a7e9bb82ab8d72eda6a7c3c

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