Skip to content

Query Subsetting #10

@mistermboy

Description

@mistermboy

Another approach for improving the performance in scholia queries could be to extract a subset of entities for each query. For example, in country authors query the first subquery extracts all the authors for a given country:

 SELECT DISTINCT ?author WHERE {
    ?author wdt:P27 | wdt:P1416/wdt:P17 | wdt:P108/wdt:P17 wd:{{q}}.
  }

Then, for each author, a further query is made.:

 SELECT
    ?author 
    (COUNT(DISTINCT ?citing_work) AS ?number_of_citing_works)
    (SAMPLE(?organization_) AS ?organization)
    (SAMPLE(?work) AS ?example_work)
  WHERE {
    INCLUDE %authors
    ?work wdt:P50 ?author .
    OPTIONAL { ?citing_work wdt:P2860 ?work . }
    OPTIONAL {
      ?author wdt:P1416 | wdt:P108 ?organization_ .
      ?organization_ wdt:P17 wd:Q32
    }
  }
  GROUP BY ?author 

Our aim is to extract a subset of these authors in order to decrease the overall query time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions