Skip to content

Fix co-author map query for QLever compatibility#2781

Open
HakanIST wants to merge 1 commit intoWDscholia:mainfrom
HakanIST:fix-coauthor-map-qlever
Open

Fix co-author map query for QLever compatibility#2781
HakanIST wants to merge 1 commit intoWDscholia:mainfrom
HakanIST:fix-coauthor-map-qlever

Conversation

@HakanIST
Copy link
Copy Markdown

@HakanIST HakanIST commented Apr 4, 2026

Summary

Fix the SPARQL query in author_coauthor-map.sparql that was returning no results on the QLever-backed Scholia instance.

Fixes #2780

Changes

Two issues were identified and fixed:

1. IRI inequality filter incompatibility with QLever

FILTER (?author != target:) does not work correctly on QLever for IRI inequality comparison. QLever silently returns empty results instead of filtering properly.

Fix: Changed to FILTER (STR(?author) != STR(target:)) which works correctly on both QLever and Wikidata SPARQL (Blazegraph).

2. Invalid GROUP BY clause

GROUP BY ?organization ?geo ?count included the aggregate variable ?count (defined as COUNT(DISTINCT ?work)), which is technically invalid SPARQL. While Blazegraph tolerates this, QLever is stricter.

Fix: Removed ?count from the GROUP BY clause, leaving GROUP BY ?organization ?geo.

Testing

  • Verified the fixed query returns results on QLever API (previously returned 0 results)
    • Verified the fixed query continues to work correctly on Wikidata SPARQL endpoint (Blazegraph)

Fix the SPARQL query in author_coauthor-map.sparql that was returning
no results on the QLever-backed Scholia instance.

Two issues were identified and fixed:

1. FILTER (?author != target:) does not work correctly on QLever
   for IRI inequality comparison. Changed to use
   FILTER (STR(?author) != STR(target:)) which works on both
   QLever and Wikidata SPARQL (Blazegraph).

2. GROUP BY ?organization ?geo ?count included the aggregate
   variable ?count, which is invalid SPARQL. QLever is stricter
   about this than Blazegraph. Removed ?count from GROUP BY.

Fixes WDscholia#2780
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.

Co-author map yielding "no results" on Scholia-QLever

1 participant