Skip to content

Multiple strings as parameter #544

Description

@sverhoeven

I would like support for passing multiple string values as a parameter to grlc.

Given SPARQL query like

#+ endpoint: https://sparql.uniprot.org/sparql
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
SELECT ?protein ?pdb_db
WHERE {
    # --- Protein Selection ---
    VALUES (?ac) { ("O15178") ("O15294")}
    BIND (IRI(CONCAT("http://purl.uniprot.org/uniprot/",?ac)) AS ?protein)
    ?protein a up:Protein .
    ?protein rdfs:seeAlso ?pdb_db .
    ?pdb_db up:database <http://purl.uniprot.org/database/PDB> .
}

To grlc-ify replace ("O15178") ("O15294") with a parameter like (?__uniprotAccessions_stringlist) with possible value ["O15178", "O15294"].

The openapi spec for the parameter would look like

{
    "description": "A list of string values that will substitute ?__uniprotAccessions_stringlist in the original query",
    "in": "query",
    "name": "uniprotAccessions",
    "required": false,
    "type": "array",
    "items": {
        "type": "string"
    }
}

Nice to have if I can specify the minimum and/or maximum number of items in the list.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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