D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] SPARCQL

 

Dear Martin,

...and here's the same query, but with JSON behind the scenes rather
than XML. The character escaping issue is still extant, unfortunately.
However, jq seems to be about five times faster than the Perl version of
xpath that I suggested in my previous email, so if you have jq installed
this may be preferable.

curl -s 
'https://edmo.seadatanet.org/sparql/sparql?query=PREFIX+skos%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0D%0APREFIX+rdf%3A%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0ASELECT+DISTINCT+%3Fs+%3Fp+WHERE+%7B%3Fs+rdf%3Atype+%3Chttp%3A%2F%2Fwww.w3.org%2Fns%2Forg%23Organization%3E.+%3Fs+skos%3AprefLabel+%3Fp%7D+ORDER+By+%3Fp&output=json&force-accept=text%2Fplain'\
| jq -r ".results.bindings[].p.value"\
| sort

Best wishes,

Sebastian

-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dcglug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq