Library that allows to perform Knowledge Graph (Linked Open Data) quality analysis.
Project description
KGHeartbeat API
Library that allows you to perform Knowledge Graph (Linked Open Data) quality analysis.
Installation
pip install kgheartbeat
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")
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
kgheartbeat-0.2.4.tar.gz
(14.9 MB
view details)
Built Distribution
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 kgheartbeat-0.2.4.tar.gz.
File metadata
- Download URL: kgheartbeat-0.2.4.tar.gz
- Upload date:
- Size: 14.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b91d079c99d08bed22c2ddacb9cf8db885b3a692a13f3ce688b77aa95d0d5931
|
|
| MD5 |
12a4de256112732caa8bac37c0a973b7
|
|
| BLAKE2b-256 |
717d0b7dde6118a8a1f5c95f7575f4c51da7ee7140f3a5e9cc4763381da5ada1
|
File details
Details for the file kgheartbeat-0.2.4-py3-none-any.whl.
File metadata
- Download URL: kgheartbeat-0.2.4-py3-none-any.whl
- Upload date:
- Size: 15.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f3c1fb3b4668e7a01a8c8b3c90dbfe09f4ff6d785c5e1239d0fa744deb4daeb
|
|
| MD5 |
4811cb514a139c2167b03accbd3f7d7f
|
|
| BLAKE2b-256 |
e38622ac2ab1cc3407403a5a62f1c1cd42b31cbba85e71a57530ab13a6a728ba
|