Module:Smw

De Semantic MediaWiki - Sandbox

Révision datée du 18 juin 2016 à 00:33 par Mwjames (discussion | contributions) (Mwjames a déplacé la page Module:SMW vers Module:Smw sans laisser de redirection)

-- 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
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.