Talk:Wikidata/Development/Phase 2 JSON

Latest comment: 12 years ago by Jeblad in topic Some comments

Some comments

edit

Allowing navigation on things like "population" imply that the form berlin.population will be dangerous, and also getting to the "as of" value will need something like berlin.population.statement33['as of']. Either there should be some transformation rules to turn labels into a js-safe form, or there should be some kind of marker that indicates that the form can't be accessed in the simple dot-form, or it should be explicitly stated that the dot-form can't be used when the label-enriched form is used.

In some cases I think the label-enriched form also needs type-markers to ease parsing, but I'm not sure. Perhaps the position always will be enough to identify the correct type. — Jeblad 12:42, 4 October 2012 (UTC)Reply

    berlin = {
        "statements" : {
            "population" : { 
                "statement33" : {
                    "value" : {
                        "value" : 3500000,
                        "type" : "number",
                        "accuracy" : {
                            "value" : 100000
                        }
                    },
                    "as of" : {
                        "value" : "2011-01-01T00:00:00",
                        "type" : "time",
                        "accuracy" : {
                            "value" : "1",
                            "unit" : "year"
                        }
                    }                     
                }
            }
        }
    };
Return to "Wikidata/Development/Phase 2 JSON" page.