Re: [JSON] market segments - 6B solutions

On 2011-03-17, at 17:25, Sandro Hawke wrote:
...

> {"head":{"vars":["g","s","p","o"]},
> "results": {
>  "bindings":[
>   {"g":{"type":"uri","value":"a"},
>    "s":{"type":"bnode","value":"b100000000000004"},
>    "p":{"type":"uri","value":"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"},
>    "o":{"type":"uri","value":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}},
>   ...
> 
> Part of what makes me lean in this direction is that I've been trying to
> write some javascript stuff using RDF, and I find mostly I want to do
> app-specific SPARQL queries, and just see the results in json.  So, if I
> want a whole graph, it's nice to not have to do anything different.
> 
> Although, honestly, in writing apps, so far I'm finding I'd prefer
> OO-style data to triple-style, and I've been having my serverside code
> do that conversion.   Hmm.   Not sure how to generalize that yet.

I would expect something like a JSON CONSTRUCT, it's something I've wanted in writing web apps, but it's not really in scope for this group.

e.g.

JSON CONSTRUCT {
  { ?name: [ ?lat, ?long ] }
}
WHERE {
  ?x rdfs:label ?name ;
     geo:lat ?lat ;
     geo:long ?long ;
}

returning

[
  { "Point 1": [ 51.9, 1.5 ] },
  { "Point 2": [ 50.7, 1.2 ] }
]

[with apologies if that's not legal JSON syntax, I'm a bit rusty]

- Steve

-- 
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD

Received on Thursday, 17 March 2011 22:51:36 UTC