Hi Andra! I actually built that functionality into WikidataQueryServiceR -- see `help("scrape_example", package = "WikidataQueryServiceR")` and https://github.com/bearloga/WikidataQueryServiceR/#extracting-and-running-example-sparql-queries <https://cran.r-project.org/web/packages/WikidataQueryServiceR/README.html#extracting-and-running-example-sparql-queries> -- but had to make it optional (not part of the core functionality) for licensing/dependency reasons.
Glad to see people are using WDQSR! :) On the Python side, I'm sure there's a way to do something similar using BeautifulSoup web-scraping library. Cheers, Mikhail *Mikhail Popov* // Count Logula, Discovery <https://www.mediawiki.org/wiki/Wikimedia_Discovery>, Wikimedia Foundation <https://wikimediafoundation.org/> Public PGP Key <https://people.wikimedia.org/~bearloga/public.asc> *Imagine a world in which every single human being can freely share in the **sum of all knowledge. That's our commitment.* Donate <https://donate.wikimedia.org/>. On Fri, Mar 3, 2017 at 5:38 AM, Andra Waagmeester <an...@micelio.be> wrote: > I am still a happy consumer/contributor to the WDQS example page. In this > context I am wondering if it is possible, and if so what it would take to > extent the "Tri It!" link in the SPARQL2 template, with a "get the code in > the <programming language of your choice>"? > > When using libraries like WikidataQueryServiceR or python I often rely on > examples stored in the WDQS example page. It would be quite convenient to > be able to do something like: demo_query("Popular surnames among fictional > characters") in R which would direct feed on the WDQS example page. > > Where can I express such a feature request? > > Cheers, > > > Andra > > > On Sat, Sep 24, 2016 at 12:48 AM, Stas Malyshev <smalys...@wikimedia.org> > wrote: > >> Hi! >> >> On 9/23/16 2:44 PM, Andra Waagmeester wrote: >> > I wasn't aware of the SPARQL2 template, really nice! Now adding example >> > queries becomes even less time consuming. >> > >> > A minor comment is that to me red as background color feels a bit like >> > something that needs improvement. Where from now on I will use the >> > SPARQL2 template by default. Is it possible to change the background >> > color to, for example, green? >> >> I've removed the background, looks like nobody is really happy about it >> being there :) >> >> -- >> Stas Malyshev >> smalys...@wikimedia.org >> >> _______________________________________________ >> Wikidata mailing list >> Wikidata@lists.wikimedia.org >> https://lists.wikimedia.org/mailman/listinfo/wikidata >> > > > _______________________________________________ > Wikidata mailing list > Wikidata@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikidata > >
_______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata