NetsBlox icon indicating copy to clipboard operation
NetsBlox copied to clipboard

Wikidata RPC

Open CliffordAnderson opened this issue 5 years ago • 4 comments

@gsteinLTU Here is the basic Wikidata RPC, but I am experiencing a 403 forbidden error. Any thoughts about how to solve it?

NetsBlox/services#38

CliffordAnderson avatar Jun 18 '19 22:06 CliffordAnderson

I had to add a User-Agent string to the _requestData call to get it to work. I just added headers: { 'User-Agent': 'NetsBlox RPC' } after the queryString and my requests went through.

gsteinLTU avatar Jun 19 '19 20:06 gsteinLTU

@CliffordAnderson - What is the status here? Is there anything I can do to help this along?

brollb avatar Oct 24 '19 17:10 brollb

@brollb I am conceptually stuck on what this block should do. My latest thought is to treat it like a Javascript block, i.e. to allow users to put arbitrary SPARQL queries in the block and to serialize the results as JSON/a NetsBlox list. The other alternative is to simplify it and just create a few prebuilt SPARQL queries that could, for instance, return information about cultural institutions (libraries, museums, churches, galleries, etc.) in a select number of major cities (with an additional query to bring back geospatial coordinates. Your thoughts about the best direction would be valuable.

CliffordAnderson avatar Oct 24 '19 17:10 CliffordAnderson

Good question. I have to get a bit more familiar with SPARQL. One thing that could be worth exploring would be creating a set of custom blocks that could help forming queries. For example, here is a pretty basic example of what I had in mind: DeepinScreenshot_select-area_20191025102110

The blocks in this example are very simple and just construct the actual triples to be used in the query (this is just a simple example so I didn't include many relationships): myRole (1)

This makes the select item where block very simple: myRole (2)

I tried to stay pretty close to the SPARQL syntax. There also could be incrementally more complex blocks that provide more flexibility. If this approach provides a sufficient amount of scaffolding, then these blocks could be provided as a library and then the Wikidata service could simple execute arbitrary SPARQL. Another benefit of this approach is students could slowly progress to writing their own SPARQL, if desired.

Thoughts?

brollb avatar Oct 25 '19 15:10 brollb