Module:MySPARQL: Difference between revisions
From TITAF TANGOWIKI
(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") |
(No difference)
|
Revision as of 12:30, 21 March 2025
Documentation for this module may be created at Module:MySPARQL/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