knitr::opts_chunk$set( collapse = TRUE, comment = "#>", echo = TRUE, message=FALSE, warning=FALSE )
library(glitter)
Cette vignette reprend l'ensemble des exemples proposés sur le SPARQL endpoint de la BNF et les "traduit" en commandes glitter
pour que les utilisateurs de R puissent les exécuter directement depuis R.
Pour limiter la taille et le temps d'exécution de cette vignette chaque jeu de données en résultat et limité à 10 lignes maximum à l'aide de spq_head(n=10)
.
tib=spq_init(endpoint="dataBNF") %>% spq_add("?s ?p ?o") %>% spq_head(10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?auteur foaf:birthday ?jour") %>% spq_add("?auteur bio:birth ?date1") %>% spq_add("?auteur bio:death ?date2") %>% spq_add("?auteur foaf:name ?nom", .required = FALSE) %>% spq_arrange(jour) %>% spq_prefix() %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
fleurs_du_mal="<http://data.bnf.fr/ark:/12148/cb11947965f>" tib=spq_init(endpoint = "dataBNF") %>% spq_add("{fleurs_du_mal} foaf:focus ?Oeuvre") %>% spq_add("?edition rdarelationships:workManifested ?Oeuvre") %>% spq_add("?edition dcterms:date ?date", .required=FALSE) %>% spq_add("?edition dcterms:title ?titre") %>% spq_add("?edition dcterms:publisher ?editeur") %>% spq_head(n=10) %>% spq_prefix() %>% spq_perform() knitr::kable(tib)
doc="<http://data.bnf.fr/ark:/12148/cb42712156j#about>" tib=spq_init(endpoint="dataBNF") %>% spq_add("{doc} rdarelationships:electronicReproduction ?URLGallica") %>% spq_add("{doc} dcterms:title ?title") %>% spq_prefix() %>% spq_perform() knitr::kable(tib)
expo="<http://data.bnf.fr/ontology/bnf-onto/ExpositionVirtuelle>" tib=spq_init(endpoint="dataBNF") %>% spq_add("?exposition a {expo}") %>% spq_add("?exposition dcterms:title ?titre") %>% spq_add("?exposition dcterms:subject ?sujet") %>% spq_head(n=30) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?person isni:identifierValid '0000000121012885'") %>% spq_add("?person foaf:focus ?identity") %>% spq_add("?identity foaf:familyName ?nom") %>% spq_add("?identity foaf:givenName ?prenom") %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?pidArk bnf-onto:FRBNF '11992081'^^xsd:integer") %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?work rdfs:label ?title") %>% spq_add("?work dcterms:creator ?creator") %>% spq_add("?manifestation bnf-onto:isbn '2-7028-4777-3'") %>% spq_add("?manifestation rdarelationships:workManifested ?work") %>% spq_add("?creator foaf:name ?name") %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?oeuvre dcterms:creator ?auteur") %>% spq_add("?auteur bio:death ?mort") %>% spq_add("?auteur foaf:familyName ?nom") %>% spq_filter(as.integer(mort) < as.integer('1924')) %>% spq_group_by(auteur, nom, mort) %>% spq_arrange(desc(as.integer(mort))) %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?image dcterms:type <http://purl.org/dc/dcmitype/StillImage>") %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?manifestation bnf-onto:ouvrageJeunesse 'true'^^xsd:boolean") %>% spq_add(". rdarelationships:workManifested ?oeuvre") %>% spq_add(". rdfs:seeAlso ?uri") %>% spq_group_by(uri, oeuvre) %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?auteur rdf:type skos:Concept") %>% spq_add(". foaf:focus ?person") %>% spq_add("?doc rdarelationships:electronicReproduction ?url") %>% spq_add(". dcterms:subject ?auteur") %>% spq_add(". dcterms:subject <http://data.bnf.fr/ark:/12148/cb11932843f>") %>% spq_head(n=10) %>% spq_group_by(auteur, url) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?sujet1 skos:prefLabel ?label") %>% spq_add(". skos:narrower ?uri2") %>% spq_add("?uri2 skos:prefLabel ?label2") %>% spq_add("?uri2 skos:narrower ?uri3", .required = FALSE) %>% spq_add("?uri3 skos:prefLabel ?label3", .required = FALSE) %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?sujet dcterms:isPartOf <http://data.bnf.fr/vocabulary/rameau/r166>") %>% spq_add(". skos:prefLabel ?label") %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?c a <http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing>") %>% spq_add("?lieu foaf:focus ?c") %>% spq_add("?lieu skos:closeMatch ?concept") %>% spq_group_by(lieu, concept , c) %>% spq_head(n=100) %>% spq_perform() knitr::kable(tib)
tib=spq_init(endpoint="dataBNF") %>% spq_add("?ConceptA foaf:focus ?auteur") %>% spq_add("?oeuvre dcterms:creator ?auteur") %>% spq_add("?ConceptA rdfs:seeAlso ?wikipedia") %>% spq_filter(str_detect(wikipedia,'wikipedia')) %>% spq_head(n=10) %>% spq_perform() knitr::kable(tib)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.