Read and query HDT document with ease in Python
Project description
pyHDT
Read and query HDT document with ease in Python
Requirements
Installation
Installation in a virtualenv is strongly advised!
Pip install (recommanded)
pip install hdt
Quick install
curl https://github.com/Callidon/pyHDT/blob/master/install.sh -sSf | sh
Manual installation
git clone --recursive https://github.com/Callidon/pyHDT cd pyHDT/ pip install -r requirements.txt python setup.py install
Getting started
from hdt import HDTDocument
# Load an HDT file. Missing indexes are generated automatically
document = HDTDocument("test.hdt")
# Display some metadata about the HDT document itself
print("nb triples: %i" % document.get_total_triples())
print("nb subjects: %i" % document.get_nb_subjects())
print("nb predicates: %i" % document.get_nb_predicates())
print("nb objects: %i" % document.get_nb_objets())
print("nb shared subject-object: %i" % document.get_nb_shared())
# Fetch all triples that matches { ?s ?p ?o }
# Use empty strings ("") to indicates variables
(triples, cardinality) = document.search_triples("", "", "")
print("cardinality of { ?s ?p ?o }: %i" % cardinality)
for triple in triples:
print(triple)
# Search also support limit and offset
(triples, cardinality) = document.search_triples("", "", "", limit=10, offset=100)
# etc ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hdt-1.0.4.tar.gz
(179.5 kB
view details)
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hdt-1.0.4.tar.gz.
File metadata
- Download URL: hdt-1.0.4.tar.gz
- Upload date:
- Size: 179.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46adab43b70a4a97e464cfc73d941560064c22cf88a1021137ea449f4336ae71
|
|
| MD5 |
bd0f042dfb6c71a6060016db5f685ce4
|
|
| BLAKE2b-256 |
3c78483de9651079ae9737621db6c901dd6b11615f876b333eb5605978b2d514
|
File details
Details for the file hdt-1.0.4-py3.6-linux-x86_64.egg.
File metadata
- Download URL: hdt-1.0.4-py3.6-linux-x86_64.egg
- Upload date:
- Size: 4.1 MB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c497f7bfd2fd39b96a86cae99eb251e15e6df440e341f782a354f5c17a7d43c
|
|
| MD5 |
b7037b413cd09792e36af3c486fa05a6
|
|
| BLAKE2b-256 |
1d49fc38f4b17361e60394974cd8c58d30eb866bfce974c94b9a6ab17192fdfe
|
File details
Details for the file hdt-1.0.4-py2.7-linux-x86_64.egg.
File metadata
- Download URL: hdt-1.0.4-py2.7-linux-x86_64.egg
- Upload date:
- Size: 4.1 MB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0f5e6b16b7e177f003619e0db3dadd4ff268aa0c38fed3c890f755b9dffb3e8
|
|
| MD5 |
bc01db42fadd7f1b6505a107ada5f67b
|
|
| BLAKE2b-256 |
69e3c8da67721218f08a3db0df0d390064873cb7f4090b3f568be005e005341b
|