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