Query parameters
Query parameters are passed as standard HTTP query string arguments. They are applied after the SPARQL query returns and after postprocessing, in this fixed order: require, filter, sort, format/json.
require
Section titled “require”Remove rows where a field is empty.
?require=author?require=author&require=venuefilter
Section titled “filter”Keep only rows matching a condition. Three modes:
Regex (no operator): the value is treated as a regular expression.
?filter=title:opencitationsComparison (=, <, >): compared using the field’s declared type from #field_type.
?filter=pub_date:>2020?filter=volume:=5?filter=pub_date:<2024Multiple filters stack:
?filter=pub_date:>2020&filter=type:journal articleSort rows by a field in ascending or descending order.
?sort=asc(pub_date)?sort=desc(pub_date)Multiple sort parameters are applied in sequence:
?sort=asc(pub_date)&sort=desc(title)format
Section titled “format”Override the response format. Takes priority over the Accept header.
?format=csv?format=jsonCustom formats registered via #format are also available (e.g., ?format=xml).
Transform fields in JSON responses. Only applies when the output format is JSON.
array: split a string into an array by separator.
?json=array("; ", author)"Massari, Arcangelo [orcid:0000-0002-8420-0696 omid:ra/06250110138]; Mariani, Fabio [orcid:0000-0002-7382-0187 omid:ra/0621012370562]" becomes ["Massari, Arcangelo [orcid:0000-0002-8420-0696 omid:ra/06250110138]", "Mariani, Fabio [orcid:0000-0002-7382-0187 omid:ra/0621012370562]"].
dict: split a string into an object with named keys.
?json=dict(", ", author, family, given)"Massari, Arcangelo" becomes {"family": "Massari", "given": "Arcangelo"}.
Both transformations work on nested paths using dot notation:
?json=array(";", person.names)Multiple transformations can be chained. Each one operates on the result of the previous:
?json=array("; ", author)&json=dict(", ", author, family, given)Combined example
Section titled “Combined example”/v1/metadata/doi:10.1162/qss_a_00292?require=author&filter=pub_date:>2020&sort=desc(pub_date)&format=csvThis removes rows without an author, keeps only those published after 2020, sorts by date descending, and returns CSV.