Module:Smw
De Semantic MediaWiki - Sandbox
-- Module:SMW
local p = {}
-- Return results
function p.ask(frame)
if not mw.ext.smw then
return "mw.ext.smw module not found"
end
if frame.args[1] == nil then
return "no parameter found"
else
queryResult = mw.ext.smw.getQueryResult( frame.args[1] )
end
if queryResult == nil then
return "(no values)"
end
return queryResult
end
-- Return property type
function p.type(frame)
if not mw.ext.smw then
return "mw.ext.smw module not found"
end
if frame.args[1] == nil then
return "no parameter found"
else
type = mw.ext.smw.getPropertyType( frame.args[1] )
end
if type == nil then
return "(no values)"
end
return type
end
return p