Skip to content

Instantly share code, notes, and snippets.

@jaw111
Forked from ColinMaudry/availability-reponse-time.rq
Created July 15, 2015 16:25
Show Gist options
  • Save jaw111/54709eeb1d0760f35588 to your computer and use it in GitHub Desktop.
Save jaw111/54709eeb1d0760f35588 to your computer and use it in GitHub Desktop.
#List of RDF classes and for each, the number of instances
#Liste des classes RDF et pour chacune, le nombre d'instances
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dgfr: <http://colin.maudry.com/ontologies/dgfr#>
select distinct ?class (count(?thing) as ?numInstances) where {
graph <http://www.data.maudry.com> {
?thing a ?class .
}
}
group by ?class
order by ?class
#List of all the named graphs in the repository. <http://www.data.maudry.com> is the named
#graph where most of the data is stored.
#Liste des graphes nommés présents dans le dépôt. <http://www.data.maudry.com> est
#le graphe nommé qui contient la plus grande partie des données.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dgfr: <http://colin.maudry.com/ontologies/dgfr#>
select distinct ?graph where {
graph ?graph {
?s ?p ?o
}
}
#List of the organizations, with their number of datasets and distributions, sorted by the total number of downloads
#Liste des organisations, avec leur nombre de datasets, de distributions (ressources) et de téléchargements
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX dgfr: <http://colin.maudry.com/ontologies/dgfr#>
SELECT ?organisation
(count(distinct ?dataset) as ?nombreDatasets)
(count(distinct ?distribution) as ?nombreRessources)
(sum(?downloads) as ?nombreTéléchargements) WHERE {
graph <http://www.data.maudry.com> {
?organizationUri a foaf:Organization ;
rdfs:label ?organisation ;
dgfr:published ?dataset .
?dataset a dcat:Dataset ;
dcat:distribution ?distribution .
?distribution dgfr:downloads ?downloads .
}
}
group by ?organisation
order by desc(?nombreTéléchargements)
limit 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment