TBFY / knowledge-graph-API

This repository is dedicated to the core API of the TheyBuyForYou project built on top of R4R (https://github.com/TBFY/r4r)
2 stars 1 forks source link

OCDS statistics #43

Open MitjaMed opened 4 years ago

MitjaMed commented 4 years ago

Regarding the international compasrison of countries, a statistics would be beneficial to see what data is available from which countries. I would propose a Table where rows would be OCDS data categories and columns would be country data. In each cell a value would be calcualted dividing the number of occurences of this data in this category (COUN T) vs. total number of data for that country. Example: Let's say that the KG contains 1000 instances of Slovenian data Slovenia, and in the OCDS line 63 (I am clearly making up this numbers) there are 850 Slovenian entries, so the value in the table would be 85%.

fyedro commented 4 years ago

Hi Mitja, here you are an example of how to create this kind of queries (Ex: query that calculates the percentage of Slovenian organisations)

PREFIX rov: http://www.w3.org/ns/regorg# PREFIX dbp: http://dbpedia.org/ontology/

SELECT DISTINCT (COUNT(?s) AS ?totalOrganisations) (COUNT(?s2) AS ?totalCountry) (((?totalCountry*100)/?totalOrganisations) AS ?percentageCountry) WHERE { { ?s a rov:RegisteredOrganization } UNION { ?s2 a rov:RegisteredOrganization . ?s2 dbp:jurisdiction "si" . } }

You can create statistical queries similar to this one, I will be glad to help you if you need it

fyedro commented 4 years ago

SPARQL endpoint: http://52.19.213.234:3030//tbfy/query YASGUI SPARQL query GUI: http://yasgui.tbfy.eu or http://52.19.213.234:3040/