Skip to main content

Read and query HDT document with ease in Python

Project description

pyHDT

Build Status Documentation Status PyPI version

Read and query HDT document with ease in Python

Online Documentation

Requirements

  • git

  • pip

  • gcc/clang with c++11 support

  • Python Development headers > You sould have the Python.h header available on your system. > For example, for Python 3.4, install the python3.4-dev package on Debian/Ubuntu systems.

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


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)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hdt-1.0.4-py3.6-linux-x86_64.egg (4.1 MB view details)

Uploaded Egg

hdt-1.0.4-py2.7-linux-x86_64.egg (4.1 MB view details)

Uploaded Egg

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

Hashes for hdt-1.0.4.tar.gz
Algorithm Hash digest
SHA256 46adab43b70a4a97e464cfc73d941560064c22cf88a1021137ea449f4336ae71
MD5 bd0f042dfb6c71a6060016db5f685ce4
BLAKE2b-256 3c78483de9651079ae9737621db6c901dd6b11615f876b333eb5605978b2d514

See more details on using hashes here.

File details

Details for the file hdt-1.0.4-py3.6-linux-x86_64.egg.

File metadata

File hashes

Hashes for hdt-1.0.4-py3.6-linux-x86_64.egg
Algorithm Hash digest
SHA256 9c497f7bfd2fd39b96a86cae99eb251e15e6df440e341f782a354f5c17a7d43c
MD5 b7037b413cd09792e36af3c486fa05a6
BLAKE2b-256 1d49fc38f4b17361e60394974cd8c58d30eb866bfce974c94b9a6ab17192fdfe

See more details on using hashes here.

File details

Details for the file hdt-1.0.4-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for hdt-1.0.4-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 d0f5e6b16b7e177f003619e0db3dadd4ff268aa0c38fed3c890f755b9dffb3e8
MD5 bc01db42fadd7f1b6505a107ada5f67b
BLAKE2b-256 69e3c8da67721218f08a3db0df0d390064873cb7f4090b3f568be005e005341b

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