Wikidata:WikiProject Alba amicorum National Library of the Netherlands/Extract-KB-LOD-AA
Jump to navigation
Jump to search
Try it!
Try it!
Try it!
This project is part of the Wikidata efforts of the Koninklijke Bibliotheek Nederland
Home | Pilot projects | Overviews | Source data | All project pages |
Overview | Europeana | data.bibliotheken.nl | KB catalog | KB website | Other sources |
How to extract the alba amicorum + album contributions available in http://data.bibliotheken.nl/doc/dataset/rise-alba using SPARQL[edit]
SPARQL endpoint and dataset[edit]
- SPARQL endpoint: http://data.bibliotheken.nl/sparql
- Dataset: http://data.bibliotheken.nl/id/dataset/rise-alba
Querying alba amicorum (+contributions) through data.bibliotheken.nl SPARQL endpoint[edit]
Alba only[edit]
SELECT DISTINCT ?album ?inventoryNumber ?albumtitle ?image WHERE { ?inscription foaf:isPrimaryTopicOf/void:inDataset <http://data.bibliotheken.nl/id/dataset/rise-alba> . ?inscription schema:isPartOf ?album . ?album schema:name ?albumtitle . ?album schema:identifier ?inventoryNumber. ?album schema:dateCreated ?dateCreated . ?album schema:image ?a . ?a schema:contentUrl ?image . } ORDER BY ?album
Alba with GROUP_CONCAT[edit]
Retrieves 57 alba
SELECT DISTINCT ?album ?albumtitle (GROUP_CONCAT(DISTINCT(?owner); separator="****") as ?albumowner) (GROUP_CONCAT(DISTINCT(?albumdescr); separator="****") as ?albumdescription) (GROUP_CONCAT(DISTINCT(?albumlocation); separator="****") as ?albumlocationcreated) (GROUP_CONCAT(DISTINCT(?inventory); separator="****") as ?inventoryNumber) (GROUP_CONCAT(DISTINCT(?material); separator="****") as ?albummaterial) (GROUP_CONCAT(DISTINCT(?date); separator="****") as ?dateCreated) ?albumpages ?albumwidth ?albumheight #(GROUP_CONCAT(DISTINCT(?image); separator="****") as ?albumimages) WHERE { ?contrib foaf:isPrimaryTopicOf/void:inDataset <http://data.bibliotheken.nl/id/dataset/rise-alba> . ?contrib schema:isPartOf ?album . ?album schema:name ?albumtitle . OPTIONAL{?album schema:numberOfPages ?albumpages.} #?album schema:image ?a . #?a schema:contentUrl ?image . #CONCAT fields OPTIONAL{?album schema:material ?material.} OPTIONAL{?album schema:description ?albumdescr.} OPTIONAL{?album schema:locationCreated ?albumlocation.} OPTIONAL{?album schema:identifier ?inventory.} OPTIONAL{?album schema:width ?albumwidth.} OPTIONAL{?album schema:height ?albumheight.} OPTIONAL{?album schema:dateCreated ?date.} OPTIONAL{?album schema:author ?owner.} } #GROUP BY ?album ?albumwidth ?albumheight #?albumpages ORDER BY ?album
Alba and their contributions[edit]
Retrieves 2096 results
SELECT DISTINCT ?album ?albumtitle ?contrib ?contribtitle WHERE { # ?contrib foaf:isPrimaryTopicOf/void:inDataset <http://data.bibliotheken.nl/id/dataset/rise-alba> . ?contrib schema:name ?contribtitle . ?contrib schema:isPartOf ?album . ?album schema:name ?albumtitle . } ORDER BY ?album
Querying alba amicorum (+ contributions) through the WDQS interface[edit]
All alba amicorum in data.bibliotheken.nl[edit]
Finds only 55 alba, not 57 as above. Why is there a differecne of 2? --> find out
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?album ?albumtitle WHERE {
SERVICE <http://data.bibliotheken.nl/sparql>{
?inscription schema:isPartOf ?album .
?album schema:name ?albumtitle .
?album schema:identifier ?inventoryNumber.
?album schema:dateCreated ?dateCreated .
?album schema:image ?a .
?a schema:contentUrl ?image .
}
}
ORDER BY ?album
limit 1000
Contributions to an album with the name 'Kerwal'[edit]
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?album ?album_name ?bijdrage ?bijdrage_name ?auteur (GROUP_CONCAT(?desc;SEPARATOR = " ") as ?bijdrage_beschrijving) ?maakdatum ?maaklocatie ?afbeelding ?bijdrage_nummer WHERE {
SERVICE <http://data.bibliotheken.nl/sparql>{
?album schema:name ?album_name .
?bijdrage schema:isPartOf ?album .
?bijdrage schema:description ?desc .
?bijdrage schema:name ?bijdrage_name .
?bijdrage schema:author ?auteur.
?bijdrage schema:dateCreated ?maakdatum.
?bijdrage schema:locationCreated ?maaklocatie.
?bijdrage schema:image [ schema:contentUrl ?afbeelding] .
?bijdrage schema:position ?bijdrage_nummer .
FILTER Contains(?album_name,"Kerwal")
}
}
GROUP BY ?album ?bijdrage ?afbeelding ?auteur ?maakdatum ?maaklocatie ?album_name ?bijdrage_name ?bijdrage_nummer
ORDER BY xsd:integer(?bijdrage_nummer)
limit 1000
All contributions to alba amicorum in data.bibliotheken.nl (3721 rows)[edit]
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX schema: <http://schema.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT ?album ?album_name ?bijdrage ?bijdrage_name ?auteur (GROUP_CONCAT(DISTINCT ?desc;SEPARATOR = " ") as ?bijdrage_beschrijving) ?maakdatum ?maaklocatie ?afbeelding ?bijdrage_nummer WHERE {
SERVICE <http://data.bibliotheken.nl/sparql>{
?album schema:name ?album_name .
?bijdrage schema:isPartOf ?album .
?bijdrage schema:description ?desc .
?bijdrage schema:name ?bijdrage_name .
?bijdrage schema:author ?auteur.
?bijdrage schema:dateCreated ?maakdatum.
?bijdrage schema:locationCreated ?maaklocatie.
?bijdrage schema:image [ schema:contentUrl ?afbeelding] .
?bijdrage schema:position ?bijdrage_nummer .
#FILTER Contains(?album_name,"*")
}
}
GROUP BY ?album ?bijdrage ?afbeelding ?auteur ?maakdatum ?maaklocatie ?album_name ?bijdrage_name ?bijdrage_nummer
ORDER BY ?album_name xsd:integer(?bijdrage_nummer)
Number of alba and contributions[edit]
- No of alba: 55 or 57? (see above, why is there a difference of 2?)
- No of contributions: 2096 (or 3721) ? (SPARQL-query ?)