Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wikidata RPC #2431

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CliffordAnderson
Copy link

@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

@gsteinLTU
Copy link
Member

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.

@brollb
Copy link
Contributor

brollb commented Oct 24, 2019

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

@CliffordAnderson
Copy link
Author

@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.

@brollb
Copy link
Contributor

brollb commented Oct 25, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants