Hi all,
For this Flemish museums on Wikidata project https://www.wikidata.org/wiki/Wikidata:Flemish_art_collections,_Wikidata_and_Linked_Open_Data ( … we hope to import some 30,000 Flemish artworks in the upcoming months :-) … ) I and the rest of the project team are trying to find out if and how we’ll be able to retrieve RDF from Wikidata - one RDF export/file for all concerned items at once.
So this is not RDF for a single item (like this https://www.wikidata.org/wiki/Special:EntityData/Q21012032.rdf) and also not a RDF dump of all of Wikidata like mentioned here https://www.wikidata.org/wiki/Wikidata:Data_access#Access_to_dumps. It would be an RDF file corresponding to the results of this WDQ query http://tools.wmflabs.org/autolist/autolist1.html?q=CLAIM%5B195:1471477%5D%20OR%20CLAIM%5B195:2365880%5D%20OR%20CLAIM%5B195:1948674%5D%20OR%20CLAIM%5B195:1928672%5D%20OR%20CLAIM%5B195:1540707%5D%20OR%20CLAIM%5B195:1573755%5D%20OR%20CLAIM%5B195:2098074%5D (which should produce more than 30,000 items in a few months!).
Any tips on how to achieve this? Wikidata Toolkit? But how/what to do? We are not programmers/developers but we do have some budget to hire someone to build us something, so pointers to a (Belgian??) developer who could help would also be very welcome.
The project raises quite a few questions, by the way, so I might come back with more :-)
Many thanks in advance! Sandra (User:Spinster)
Hi Sandra,
For part of the artworks on Danish museums I used the standard SPARQL service (https://query.wikidata.org). I my case I only downloaded data for some hundred artworks, - as far as I recall, so I do not know how stable the approach is for 30,000 artworks.
You will see some example on my Wikidata user page:
https://www.wikidata.org/wiki/User:Fnielsen
The Python 'sparql' and 'pandas' package allows for easy scripting. The example does not use RDF but get the data into a Pandas DataFrame.
For 'or' between all the museums you want I believe you can use the UNION:
SELECT ?work ?workLabel WHERE { { ?work wdt:P195 wd:Q1471477 . } UNION { ?work wdt:P195 wd:Q2365880 . } UNION { ?work wdt:P195 wd:Q1948674 . } UNION { ?work wdt:P195 wd:Q1928672 . } UNION { ?work wdt:P195 wd:Q1540707 . } UNION { ?work wdt:P195 wd:Q1573755 . } UNION { ?work wdt:P195 wd:Q2098074 . } SERVICE wikibase:label { bd:serviceParam wikibase:language "nl,en" . } }
https://query.wikidata.org has a download results for CSV or JSON.
Try this one: https://tinyurl.com/p8ghgnx and press execute and download CSV.
best Finn
On 10/26/2015 05:11 PM, Sandra Fauconnier wrote:
Hi all,
For this Flemish museums on Wikidata project https://www.wikidata.org/wiki/Wikidata:Flemish_art_collections,_Wikidata_and_Linked_Open_Data ( … we hope to import some 30,000 Flemish artworks in the upcoming months :-) … ) I and the rest of the project team are trying to find out if and how we’ll be able to retrieve RDF from Wikidata - one RDF export/file for all concerned items at once.
So this is not RDF for a single item (like this https://www.wikidata.org/wiki/Special:EntityData/Q21012032.rdf) and also not a RDF dump of all of Wikidata like mentioned here https://www.wikidata.org/wiki/Wikidata:Data_access#Access_to_dumps. It would be an RDF file corresponding to the results of this WDQ query http://tools.wmflabs.org/autolist/autolist1.html?q=CLAIM%5B195:1471477%5D%20OR%20CLAIM%5B195:2365880%5D%20OR%20CLAIM%5B195:1948674%5D%20OR%20CLAIM%5B195:1928672%5D%20OR%20CLAIM%5B195:1540707%5D%20OR%20CLAIM%5B195:1573755%5D%20OR%20CLAIM%5B195:2098074%5D (which should produce more than 30,000 items in a few months!).
Any tips on how to achieve this? Wikidata Toolkit? But how/what to do? We are not programmers/developers but we do have some budget to hire someone to build us something, so pointers to a (Belgian??) developer who could help would also be very welcome.
The project raises quite a few questions, by the way, so I might come back with more :-)
Many thanks in advance! Sandra (User:Spinster)
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Dear Sandra,
On 10/26/2015 05:11 PM, Sandra Fauconnier wrote:
Any tips on how to achieve this? Wikidata Toolkit? But how/what to do? We are not programmers/developers but we do have some budget to hire someone to build us something, so pointers to a (Belgian??) developer who could help would also be very welcome.
I believe it is BotMultichill that has uploaded much of the National Gallery of Denmark to Wikidata. https://www.wikidata.org/wiki/User:Multichill "heeft het Nederlands als moedertaal." Maybe you want to contact him.
best Finn
Hi Sandra,
There are different ways to get the RDF. 1. You could download the individueel rdf files, use an RDF converter tool like redland rapper [1] to convert the rdf downloads to a format like turtle which would allow concatenation of all the different download into one.
2. Use construct queries. You could extract them with a construct query from the sparql endpoint of Wikidata at (http://query.wikidata.org). The following query for example extracts the triples on two WD items (Q5803847 Q20051232)
PREFIX wd: http://www.wikidata.org/entity/
CONSTRUCT {?wdid ?p ?o .} WHERE { VALUES ?wdid {wd:Q5803847 wd:Q20051232 } ?wdid ?p ?o . }
This leads to the following results [2]
[3] Use a program language with a SPARQL library. I use python which has a library called sparqlwrapper (https://rdflib.github.io/sparqlwrapper/). This allows programmatic iteration of SPARQL results.
I hope this helps a bit?
Kind regards,
Andra Waagmeester
[1] http://librdf.org/raptor/rapper.html [2] https://query.wikidata.org/#PREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.or... [3] https://rdflib.github.io/sparqlwrapper/
On Mon, Oct 26, 2015 at 5:11 PM, Sandra Fauconnier < sandra.fauconnier@gmail.com> wrote:
Hi all,
For this Flemish museums on Wikidata project https://www.wikidata.org/wiki/Wikidata:Flemish_art_collections,_Wikidata_and_Linked_Open_Data ( … we hope to import some 30,000 Flemish artworks in the upcoming months :-) … ) I and the rest of the project team are trying to find out if and how we’ll be able to retrieve RDF from Wikidata - one RDF export/file for all concerned items at once.
So this is not RDF for a single item (like this https://www.wikidata.org/wiki/Special:EntityData/Q21012032.rdf) and also not a RDF dump of all of Wikidata like mentioned here https://www.wikidata.org/wiki/Wikidata:Data_access#Access_to_dumps. It would be an RDF file corresponding to the results of this WDQ query http://tools.wmflabs.org/autolist/autolist1.html?q=CLAIM%5B195:1471477%5D%20OR%20CLAIM%5B195:2365880%5D%20OR%20CLAIM%5B195:1948674%5D%20OR%20CLAIM%5B195:1928672%5D%20OR%20CLAIM%5B195:1540707%5D%20OR%20CLAIM%5B195:1573755%5D%20OR%20CLAIM%5B195:2098074%5D (which should produce more than 30,000 items in a few months!).
Any tips on how to achieve this? Wikidata Toolkit? But how/what to do? We are not programmers/developers but we do have some budget to hire someone to build us something, so pointers to a (Belgian??) developer who could help would also be very welcome.
The project raises quite a few questions, by the way, so I might come back with more :-)
Many thanks in advance! Sandra (User:Spinster)
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata