Skip to content

# `` examples

These examples all live in `./examples` in the source-distribution of RDFLib.

Modules:

- `berkeleydb_example` –

  BerkeleyDB in use as a persistent Graph store.

- `conjunctive_graphs` –

  An RDFLib ConjunctiveGraph is an (unnamed) aggregation of all the Named Graphs

- `custom_datatype` –

  RDFLib can map between RDF data-typed literals and Python objects.

- `custom_eval` –

  This example shows how a custom evaluation function can be added to

- `datasets` –

  This module contains a number of common tasks using the RDFLib Dataset class.

- `foafpaths` –

  SPARQL 1.1 defines path operators for combining/repeating predicates

- `infixowl_ontology_creation` –
- `jsonld_serialization` –

  JSON-LD is “A JSON-based Serialization for Linked Data” (https://www.w3.org/TR/json-ld/)

- `parse_patch` –
- `patch_serializer_example` –
- `prepared_query` –

  SPARQL Queries be prepared (i.e parsed and translated to SPARQL algebra)

- `resource_example` –

  RDFLib has a `Resource` class, for a resource-centric API.

- `secure_with_audit` –

  This example demonstrates how to use Python audit hooks to block access

- `secure_with_urlopen` –

  This example demonstrates how to use a custom global URL opener installed with `urllib.request.install_opener` to block access to URLs.

- `simple_example` –
- `slice` –

  RDFLib Graphs (and Resources) can be “sliced” with [] syntax

- `smushing` –

  A FOAF smushing example.

- `sparql_query_example` –

  SPARQL Query using `Graph.query`

- `sparql_update_example` –

  SPARQL Update statements can be applied with `Graph.update`

- `sparqlstore_example` –

  Simple examples showing how to use the SPARQLStore

- `swap_primer` –

  This is a simple primer using some of the

- `transitive` –

  An example illustrating how to use the