KGHeartBeat API
What is KGHeartBeat API
Library that allows you to perform Knowledge Graph (Linked Open Data) quality analysis.
The granularity with which KG quality can be measured is at the metric level, meaning that it is possible to combine the calculation of multiple metrics to obtain KG quality for a dimension. The examples section shows how you can calculate the quality of different dimensions combining together the calculation of different metrics.
For documentation on the library implementation visit here: https://gabrielet0.github.io/KGHeartbeat-API/reference/
For information on which metrics are supported and how they are calculated visit here: https://isislab-unisa.github.io/KGHeartbeat/
Installation
pip install kgheartbeat
Examples
- Calculate the Availability dimension
- Calculate the Licensing dimension
- Calcuate the Versatility dimension
Calculate the Availability dimension
from kgheartbeat import KnowledgeGraph
# Instanziate a KnowledgeGraph class, passing the id of the kg to be analyzed
kg = KnowledgeGraph('dbpedia')
# Check the SPARQL endpoint availability
sparqlAv = kg.checkEndpointAv()
# Check if the links for download the dataset is up
checkDump = kg.checkDownload()
# Check if there are any inactive links
inactiveLks = kg.checkInactiveLinks()
# Calculate the URI's deferenceability (based on 5000 randomly recoverable uri). THIS COULD TAKE TIME, DEPENDS ON THE SPEED OF THE ENDPOINT (~45 min. for DBpedia)
uriDef = kg.getURIsDef()
#Print all the results
print(f"SPARQL endpoint availability: {sparqlAv}\n \
RDF dump link availability: {checkDump}\n\
Any inactive links: {inactiveLks}\n\
URIs deferenceability: {uriDef}")
Calculate the Licensing dimension
from kgheartbeat import KnowledgeGraph
# Instanziate a KnowledgeGraph class, passing the id of the kg to be analyzed
kg = KnowledgeGraph('taxref-ld')
#Search for the machine-redeable license
mr_license = kg.getLicenseMR()
#Search for a human-redeable license
hr_license = kg.getLicenseHR()
print(f"Machine redeable license: {mr_license}\nHuman-redeable license: {hr_license}")
Calcuate the Versatility dimension
# Instanziate a KnowledgeGraph class, passing the id of the kg to be analyzed
kg = KnowledgeGraph('bncf-ns')
#Find the different serialization formats available (e.g. .rdf, .n3, .xml)
formats = kg.getSerializationFormat()
#Get languages if is indicated
languages = kg.getLanguages()
#get all the links to access the KG
link_access = kg.getAccessAtKG()
print(f"Serialization formats: {formats}\nLanguages: {languages}\n Link to access the KG:{link_access}\n")
Metadata
Release files for kgheartbeat 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kgheartbeat-0.2.6.tar.gz | 14.9 MB | Without provenance | Details for kgheartbeat-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kgheartbeat-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for kgheartbeat-0.2.6-py3-none-any.whl |
Total release size: 30.5 MB
Release files / kgheartbeat-0.2.6.tar.gz
| Download URL | kgheartbeat-0.2.6.tar.gz |
|---|---|
| Size | 14.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
903cdb795fb9c82e136ce4d6a253921edcf4de0d2174f157d001b966a6ea8764
|
|
BLAKE2b-256 checksum How to use checksums |
1d8f40cf1f90f58ede0d53ab39d81481b19bb2c611c448a86af4f63a1aa91d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.19
|
Release files / kgheartbeat-0.2.6-py3-none-any.whl
| Download URL | kgheartbeat-0.2.6-py3-none-any.whl |
|---|---|
| Size | 15.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
466d4f99db56d52677b6918ee5a5ccf033d4e726d3d8ee3f765aa78dec1a056c
|
|
BLAKE2b-256 checksum How to use checksums |
4013dcc8f585b93c009095e371215ca0de25eb91cb5fa6f9fe71ddf03c7cc1f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.19
|
Security for kgheartbeat 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.