ec-doris / EuKnowledgeGraph

This repository contains the Wikibase configuration of the EU Knowledge Graph
https://linkedopendata.eu
12 stars 1 forks source link

Wikibot to update triple count #128

Open kvistgaard opened 1 year ago

kvistgaard commented 1 year ago

As agreed today with @D063520 , here's a description of this enhancement.

For all items, instances of SPARQL endpoint with valid values for URL - EU Knowledge Graph, The bot should query once a day the endpoint. In case there is a result, it should update the value of the property "number of triples"[^1] with the retrieved count and update the date qualifier with the current date. In case there is no result, the last successfully updated value should left. Optionally the last case can update an appropriate operational status direct property or qualifier.

It should be decided how to count. Most triple stores will give all accesible triples with SELECT COUNT (*) {?s ?p ?o} but for some the correct count needs to be retrieved with [^2] :

SELECT ?g ?s ?p ?o
WHERE
{
    { ?s ?p ?o }
    UNION
    { GRAPH ?g { ?s ?p ?o } }
}

[^1]: To be imported as EIKG match of number of triples - Wikidata

[^2]: For example, Fuseki and RDF4J treat the default graph differently. Some triple stores support FROM DEFAULT, others not.