I recently noticed the JSON support in Semantic MediaWiki.
Gave me interesting thoughts, as it could be a very powerful way to 
connect wiki data to on-wiki JavaScript tools.

However I have to notes.

In addition to json support on Special:Ask and in #ask queries, could we 
also support some sort of Special:ExportJSON. ie: Like how ExportRDF 
exports single page rdf files with the semantic data, export single page 
json of all the properties on that page.

Also, the json being outputted is invalid. (At least from what I get on 
Wikia, I don't know about trunk):
Doing an #ask format=json on yugioh.wikia's Dark Magician for ?English 
Name, ?ATK, and ?DEF gives me this.
{
    properties: {
        "english_name" : { valueType: "text" },
        "atk" : { valueType: "number" },
        "def" : { valueType: "number" }
    },
    items: [
        {
            label: "Dark Magician",
            "english_name": "Dark Magician",
            "atk": 2500,
            "def": 2100,
            "uri" : "http://yugioh.wikia.com/index.php?title=Dark Magician"
        }
    ]
}

In JSON ALL keys MUST be wrapped with DOUBLE quotes. the properties: 
valueType: items: and label: listed there are all invalid because they 
are not wrapped in double quotes.
All valid JSON parsers will reject the json outputted by SMW.

Also, wouldn't it be a good idea to at least note that we're modifying 
the keys that the query asked for? Something like a "normalized": { 
"English Name": "english_name", "ATK": "atk", "DEF", "def" }, at the top.

-- 
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to