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.0.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.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpsons_rdf-0.2.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.13.7-200.fc41.x86_64

File hashes

Hashes for simpsons_rdf-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7aede631f6eeca51d323b821067aeffaef67b9a5e0b2b721f6518726b5b08919
MD5 da8217b33ca200abd7370ddc31137130
BLAKE2b-256 9173fc4c4fb0468153525b7eaedb47314fa68da0119b5a3dd10d3b4162c13812

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpsons_rdf-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.13.7-200.fc41.x86_64

File hashes

Hashes for simpsons_rdf-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9dc8584d90dcd2229e8108ef4046c8c1fe1cdf38e5f64fc632681c95d6422ef
MD5 a519a65c2ecb735141525b716af460d3
BLAKE2b-256 f69bf9a720213a6c76be4bddbdd1f1801f511fd10c6277a859546aaa027ff4a2

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