Skip to content
p-lodPublic

About

Python library to access the P-LOD triplestore.

Resources

Stars

1 star

Watchers

3 watching

Forks

Latest commit

 

History

127 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Access the P-LOD Triplestore

Install using python3 -m pip install git+https://github.com/p-lod/plodlib

From command line try: python3 -m plodlib --method depicts_concepts pompeii

This will show a list of all the concepts that the Pompeii Artistic Landscape Project has recorded at Pompeii.

All of this is in early stages!

Configuration

  • PLOD_ENDPOINT: the SPARQL query endpoint. Default: http://localhost:3030/plod_endpoint/query (Fuseki on the same machine, as on the p-lod.org server).
  • Every HTTP request has a timeout (5 s connect, 30 s read). A failed or timed-out SPARQL query raises plodlib.PLODQueryError.

Optional caching

plodlib can cache SPARQL query results on disk to speed up repeat lookups (useful for classroom / demo workloads where the same URLs are hit many times in a short window). Caching is off by default — importing the library creates no files. Enable it explicitly at startup:

import plodlib
plodlib.enable_cache()                # defaults: ./cache, 100 MB, 30-minute TTL
# or, with explicit args:
plodlib.enable_cache(directory='/var/lib/plod/cache', size_mb=200, ttl_sec=1800)

Backed by diskcache (SQLite, multi-process safe — gunicorn workers can share the same cache directory). Disable with plodlib.disable_cache(). Invalidation on a triplestore re-ingest: either wait out the TTL or rm -rf the cache dir.

About

Python library to access the P-LOD triplestore.

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages