NetsBlox
NetsBlox copied to clipboard
Wikidata RPC
@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
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.
@CliffordAnderson - What is the status here? Is there anything I can do to help this along?
@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.
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:
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):
This makes the select item where
block very simple:
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?