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

Use AUTO_LANGUAGE everywhere #592

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@egonw
Copy link
Collaborator

egonw commented Dec 23, 2018

No description provided.

@egonw egonw requested a review from fnielsen Dec 23, 2018

@fnielsen
Copy link
Owner

fnielsen left a comment

I wonder if it is a good way to remove all languages? What if your AUTO_LANGUAGE and English is not set? For instance, I probably browse with Danish locale and if I see a work that is only set in French I would not see any label?

@egonw

This comment has been minimized.

Copy link
Collaborator

egonw commented Jan 8, 2019

I was mostly concerned with the redundancy... can we make this a global value and then insert it into all the SPARQL queries, so that we have one place to add/update it? So the SPARQL query would have something like {{ q }} in the Scholia source pages, e.g.:

 topicsSparql = `
#defaultView:Table
SELECT ?count ?theme ?themeLabel ?example_work ?example_workLabel
WITH {
  SELECT (COUNT(?work) AS ?count) ?theme (SAMPLE(?work) AS ?example_work)
  WHERE {
    ?work wdt:P50 wd:{{ q }} .
    ?work wdt:P921 ?theme .
  }
  GROUP BY ?theme
} AS %result
WHERE {
  INCLUDE %result
  {{ serviceLabel }}
}
ORDER BY DESC(?count) 

And that new variable is globally defined somewhere, either SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,no,ru,sv,zh". } or SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }.

What do you think?

@Daniel-Mietchen

This comment has been minimized.

Copy link
Collaborator

Daniel-Mietchen commented Feb 3, 2019

Instead of constructs like {{ q }} in the Scholia source pages, I would prefer us to

  • have the SPARQL query stored in plain, perhaps with a ?default variable. if we go that way, we could even think about storing the queries using a specific property like Wikidata SPARQL query equivalent (P3921), which would open up new ways to configure Scholia page content (e.g. in connection with ASK queries, as per #617 )
  • specify elements of that default SPARQL query that Scholia then works with to display content for the target QID(s) (e.g. replacing the ?default variable with the target QID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment