Skip to main content

Library that allows to perform Knowledge Graph (Linked Open Data) quality analysis.

Project description

KGHeartBeat API

  1. What is KGHeartBeat API
  2. Installation
  3. Quality metrics covered
  4. Examples

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/

Quality metrics covered

Below is a graph showing the quality dimensions covered by KGHeartbeat and the percentage of metrics measured in each of them.

Quality metrics covered by KGHeartbeat

For more information on how they are calculated visit here: https://isislab-unisa.github.io/KGHeartbeat/

Installation

pip install kgheartbeat

Examples

  1. Calculate the Availability dimension
  2. Calculate the Licensing dimension
  3. 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")

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.5.tar.gz (14.9 MB view details)

Uploaded Source

Built Distribution

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

kgheartbeat-0.2.5-py3-none-any.whl (15.6 MB view details)

Uploaded Python 3

File details

Details for the file kgheartbeat-0.2.5.tar.gz.

File metadata

  • Download URL: kgheartbeat-0.2.5.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

Hashes for kgheartbeat-0.2.5.tar.gz
Algorithm Hash digest
SHA256 159504ed97802146e42da903eac7f1ad7144596fd7a020823997d9c4a9888d36
MD5 82e59bf08776c26c8eb1c285560442f3
BLAKE2b-256 4985b7c6c59fb5fb39f98845207f66200f4e37a4f3e17a1c496ac511284d1e17

See more details on using hashes here.

File details

Details for the file kgheartbeat-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: kgheartbeat-0.2.5-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

Hashes for kgheartbeat-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9f60b6b1e05494d5455e527374df5bb949f46ca1903e3d84a0ed050418f55c49
MD5 c6f78c4dd7ad03263ae9f8cc65607cd0
BLAKE2b-256 1c5d044a7f9503b48cf7a332974420b2ab75da2eb51afb00cf06f797e7207cdf

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