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

Add documentation to the SPARQL queries #64

Open
Daniel-Mietchen opened this Issue Mar 16, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@Daniel-Mietchen
Collaborator

Daniel-Mietchen commented Mar 16, 2017

It would probably good to enrich the "Edit query on Wikidata.org" links with brief documentation of the SPARQL queries, such that SPARQL and/ or Wikidata newbies can use them as a playground.

@fnielsen

This comment has been minimized.

Owner

fnielsen commented Apr 3, 2017

@fnielsen

This comment has been minimized.

Owner

fnielsen commented Apr 23, 2017

Some of the newest queries have some documentation:

# Prolific authors for a specific journal
SELECT ?count ?author ?authorLabel ?orcid
WITH {
  # Count the number of works author by the author publishing in the journal
  SELECT ?author (COUNT(?work) AS ?count) WHERE {
    ?work wdt:P50 ?author ;
          wdt:P1433 wd:Q1981225 .
  }
  GROUP BY ?author
} AS %result
WHERE {
  INCLUDE %result 
          
  # Include optional ORCID iD
  OPTIONAL { ?author wdt:P496 ?orcid . }
  
  # Label the results
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,no,ru,sv,zh" . } 
}
ORDER BY DESC(?count)
LIMIT 50
@fnielsen

This comment has been minimized.

Owner

fnielsen commented Oct 10, 2017

This is still somewhat of an issue. One recent commit added a bit of comments in the SPARQL query: 5c589cb

@fnielsen

This comment has been minimized.

Owner

fnielsen commented Oct 11, 2017

This commit 7f57633 adds some comments in the SPARQL query.

@Daniel-Mietchen

This comment has been minimized.

Collaborator

Daniel-Mietchen commented Aug 20, 2018

Here is another request for better documentation.

Some problems:

  • on result views other than in tables, the "Edit on query.Wikidata.org" link now simply says "Wikidata Query", which does not inform users unfamiliar with the interface that they can actually click that link to get more information
  • once they do click, they see the SPARQL query, which is intended but usually needs more documentation
  • documentation counts towards the character limit for a query. One way around that could be a separate page (inside Scholia or maybe even on wiki) that explains the query and some options for customization (e.g. adding or removing some OPTIONAL filters).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment