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

use queries from scholia as a testsuite #859

Open
WolfgangFahl opened this issue Jan 10, 2023 · 1 comment
Open

use queries from scholia as a testsuite #859

WolfgangFahl opened this issue Jan 10, 2023 · 1 comment

Comments

@WolfgangFahl
Copy link

WolfgangFahl commented Jan 10, 2023

https://github.com/WDscholia/scholia/tree/master/scholia/app/templates contains 331 queries being used in the
https://scholia.toolforge.org/

project.
An example is
https://github.com/WDscholia/scholia/blob/master/scholia/app/templates/event-series_events.sparql

PREFIX target: <http://www.wikidata.org/entity/{{ q }}>

# title: List of event and proceedings for a specific event series
SELECT DISTINCT 
  (SAMPLE(?years) AS ?year)
  (SAMPLE(?short_names) AS ?short_name)
  ?event ?eventLabel (CONCAT("/event/", SUBSTR(STR(?event), 32)) AS ?eventUrl)
  ?proceedings ?proceedingsLabel (CONCAT("/venue/", SUBSTR(STR(?proceedings), 32)) AS ?proceedingsUrl)
WHERE {
  {
    ?event wdt:P179 | wdt:P31 target: .
    OPTIONAL {
      ?event wdt:P585 | wdt:P580 ?datetime .
      BIND(YEAR(?datetime) AS ?years)
    }
    OPTIONAL {
      ?event wdt:P1813 ?short_names
    }
    OPTIONAL {
      ?proceedings wdt:P4745 ?event
    }
  }
  UNION
  {
    # proceedings even if the event is not there!!!
    ?proceedings ( wdt:P179 / wdt:P4745 ) target: .
    OPTIONAL {
      ?proceedings wdt:P577 ?datetime .
      BIND(YEAR(?datetime) AS ?years)    
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh". }
  }
GROUP BY ?event ?year ?eventLabel ?proceedings ?proceedingsLabel
ORDER BY DESC(?year)

these examples use templating so to try them out a line such as PREFIX target: <http://www.wikidata.org/entity/{{ q }}> needs to
be filled with a concrete Q-Identifier of a fitting entity. In this case e.g. #858 has the filled example as:
https://www.wikidata.org/wiki/Q105698448

which has a scholia profile at:
https://scholia.toolforge.org/event-series/Q105698448

https://qlever.cs.uni-freiburg.de/wikidata/U8lVrR

doesn't work and it would be good to test systematically which other queries work and do not work.

@WolfgangFahl
Copy link
Author

Here are some more queries:

The "named query" yaml file that may be used with pyLodStorage is available at:
https://github.com/WolfgangFahl/pyCEURmake/blob/main/resources/queries.yaml

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

No branches or pull requests

1 participant