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.3.0.tar.gz (2.2 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.3.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpsons_rdf-0.3.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Linux/6.16.3-200.fc42.x86_64

File hashes

Hashes for simpsons_rdf-0.3.0.tar.gz
Algorithm Hash digest
SHA256 83ed8f66ab8ea3cd123bd2cf8916cb792d7dc0febb4f7c99fd002ef99e276421
MD5 f9d9efed4bcd2344868ab2e8a8916be5
BLAKE2b-256 0a048997ccfe04f1675b8fd580a571189667be43afaace53b163677443c43aeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpsons_rdf-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Linux/6.16.3-200.fc42.x86_64

File hashes

Hashes for simpsons_rdf-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0453aaf29c407e1eb9d3fc98fdf99f40e1567cd8c3f0e97a5b55c3fca698587e
MD5 196a2a0864c7a16ccd1db8b821867ad6
BLAKE2b-256 27fa283984fb1a1656a684cc11bfddf836bd7d2965ec6330eb0800f027142653

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