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

Fix #2429 config module #2515

Merged
merged 9 commits into from
Sep 5, 2024
Merged

Fix #2429 config module #2515

merged 9 commits into from
Sep 5, 2024

Conversation

fnielsen
Copy link
Collaborator

@fnielsen fnielsen commented Jun 7, 2024

The setup and reading of the configuration is handle by a separate module.

Fixes #2429

Description

The setup and reading of the configuration is handle by a separate module.

Caveats

Please list anything which has been left out of this PR or which should be considered before this PR is accepted
Check any of the following which apply:

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
    • I have made corresponding changes to the documentation
  • This change requires new dependencies (please list)

If you make changes to the Python code

  • My code passes the tox check, I can receive warnings about tests, documentation or both

Testing

Please describe the tests that you ran to verify your changes. Provide instructions, so we can reproduce. Please also list any relevant details for your test configuration.

  • Various tests on the command-line
  • Test for the webapp, e.g., rss

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have not used code from external sources without attribution
  • I have considered accessibility in my implementation
  • There are no remaining debug statements (print, console.log, ...)

The setup and reading of the configuration is handle by a separate module.
@fnielsen fnielsen requested a review from egonw June 7, 2024 17:20
@egonw
Copy link
Collaborator

egonw commented Jun 7, 2024

Okay, I think I see what you meant now.

My first test did not work, but that's because the scholia.js still uses internally hardcoded (unconfigurable) URLs. But I can work with this.

@egonw egonw self-assigned this Jun 7, 2024
@egonw
Copy link
Collaborator

egonw commented Jun 8, 2024

Example scholia.ini:

[query-server]
# QLever
#sparql_endpoint = https://qlever.cs.uni-freiburg.de/api/wikidata
#sparql_editurl = https://qlever.cs.uni-freiburg.de/wikidata/?query=
#sparql_embedurl = 

# OpenLink (Virtuoso)
#sparql_endpoint = https://wikidata.demo.openlinksw.com/sparql/
#sparql_editurl = 
#sparql_embedurl =

# Wikidata:
#sparql_endpoint = https://query.wikidata.org/sparql
#sparql_editurl = https://query.wikidata.org/#
#sparql_embedurl = https://query.wikidata.org/embed.html#

# Wikidata Split Main
sparql_endpoint = https://query-main.wikidata.org/sparql
sparql_editurl = https://query-main.wikidata.org/#
sparql_embedurl = https://query-main.wikidata.org/embed.html#

# Wikidata Split Scholar
#sparql_endpoint = https://query-scholarly.wikidata.org/sparql
#sparql_editurl = https://query-scholarly.wikidata.org/#
#sparql_embedurl = https://query-scholarly.wikidata.org/embed.html#

[requests]
user_agent = Scholia

@egonw egonw assigned fnielsen and unassigned egonw Jun 8, 2024
@@ -218,6 +217,14 @@ function sparqlToResponse(sparql, doneCallback) {
}


function sparqlToResponse(sparql, doneCallback) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to understand this. As far as I can determine you do not have polymorphic functions in Javascript, so the second definition of sparqlToResponse will overwrite the first one? Or what am I missing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ node -e "function f(a, b) { console.log('two arguments'); } function f(a) { console.log('one argument'); } f(1, 2);"
one argument

Copy link
Collaborator

@egonw egonw Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fnielsen, good catch. Are you okay to name the new one sparqlToResponse2? If not, what name should it be?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch pushed: 4f593ae

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fnielsen, what do you think?

@egonw
Copy link
Collaborator

egonw commented Sep 4, 2024

Okay, we have to start moving. We have less than 6 months left.

Hi all!

As part of the WDQS Graph Split project,[1] we have new SPARQL endpoints available for serving
the “main”[2] and “scholarly”[3] subgraphs of Wikidata.

As you might be aware we are addressing the Wikidata Query Service stability and scaling issues.
We have been working on several projects to address these issues. This announcement is about one
of them, the WDQS Graph Split.[1] This change will have an impact on certain uses of the Wikidata
Query Service.

We are now entering a transition period until the end of February 2025. The three SPARQL endpoints
will remain in place until the end of the transition. At the end of the transition,
[query.wikidata.org](http://query.wikidata.org/) will serve the main Wikidata subgraph (without
scholarly articles). The query-main and query-scholarly endpoints will continue to be available after
the transition.

If you know to want more this change, please refer to the talk page on Wikidata.[4]

Have fun!

[1] https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/WDQS_graph_split
[2] https://query-main.wikidata.org/
[3] https://query-scholarly.wikidata.org/
[4] https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/WDQS_backend_update/September_2024_scaling_update

@egonw
Copy link
Collaborator

egonw commented Sep 5, 2024

Oh, I did write up how to use this patch, but forgot to add the link here: https://chem-bla-ics.linkedchemistry.info/2024/08/23/scholia.html

@fnielsen fnielsen merged commit c4c89d4 into master Sep 5, 2024
7 checks passed
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.

Top-level configurable
2 participants