Skip to content

API Documentation

Aljosha Koecher edited this page Mar 10, 2022 · 1 revision

Every API route that retrieves some information from the knowledge graph shall return a full SparqlResponse objec

export interface SparqlResponse {
    head: {
        vars: Array<string>
    },
    results: {
        bindings:[
            Record<string, {type: string, value:string | number}>
        ]
    }
}

Mapping into a list or table structure is done in the frontend using one of the two pipeable custom RxJs operators toSparqlVariableList and toSparqlTable, respectively.

  • toSparqlList(variableName) -> get only the bindings of the given variable
  • toSparqlTable -> get all variables in a table-like structure filling empty slots
Clone this wiki locally