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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Fix #2429 config module #2515

wants to merge 9 commits into from

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-experimental.wikidata.org/sparql
sparql_editurl = https://query-main-experimental.wikidata.org/#
sparql_embedurl = https://query-main-experimental.wikidata.org/embed.html#

# Wikidata Split Scholar
#sparql_endpoint = https://query-scholarly-experimental.wikidata.org/sparql
#sparql_editurl = https://query-scholarly-experimental.wikidata.org/#
#sparql_embedurl = https://query-scholarly-experimental.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?

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