Module:Theorems

From MaRDI portal
Revision as of 16:29, 1 August 2024 by Schubotz (talk | contribs) (Created page with "local sparql = require('SPARQL') -- Load the SPARQL binding local p = {} function p.showFirstValue(frame) local sparqlQuery = frame.args[1] local queryResults = sparql.runQuery(sparqlQuery) -- Use the runQuery method local firstColName = queryResults['head']['vars'][0] return queryResults['results']['bindings'][0][firstColName]['value'] end return p")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Theorems/doc

local sparql = require('SPARQL') -- Load the SPARQL binding

local p = {}

function p.showFirstValue(frame)
  local sparqlQuery = frame.args[1]
  local queryResults = sparql.runQuery(sparqlQuery) -- Use the runQuery method

  local firstColName = queryResults['head']['vars'][0]
  return queryResults['results']['bindings'][0][firstColName]['value']

end

return p