[ Date Index ]
[ Thread Index ]
[ <= Previous by date /
thread ]
[ Next by date /
thread => ]
Re: [LUG] SPARCQL
- To: list@xxxxxxxxxxxxx
- Subject: Re: [LUG] SPARCQL
- From: Sebastian <seabass@xxxxxx>
- Date: Tue, 14 Sep 2021 15:43:23 +0100
- Content-disposition: inline
- Delivered-to: dclug@xxxxxxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dcglug.org.uk; s=1618045561; h=Sender:Content-Transfer-Encoding: Content-Type:Reply-To:List-Subscribe:List-Help:List-Post:List-Unsubscribe: List-Id:Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Owner:List-Archive; bh=JDRm98pBdju+FH/UKe6bNbuqPNs/m7jpVjuapyuuOk0=; b=tZbaEjUpZBOAJbJwoviyMc2RUa KolfB8HUCPYK0Nhpz2bhfMv7qw6Z7DgZZR0Rw01uyFMVyANUamLMIHM1yK7nUtevTTK9okbXjmdYF nS+MAOody8jazEsmkj785HLG+Ui6ZWLZtyFI8U12aYD32BBmkrU+yoh4YYv0jwdY3M7w=;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1631630605; bh=WeBF8OQmauMGaAHH7sPtYagQ3VdfzB+CZ7lqvH8GP6Y=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=aLGYal6Qp8iLIXG5wj22B5JhCWWyWhKFGz5Ohsoe3gP+wX0i43HV4S6Mly0wVWKkG FqzilJVqmeqtK84Rz6+1mnrtn/s2+5/bFbnad/4b4KsISSZvMR81QN1+qBEiJhUskx qY5YCCId/rDT0m+WcqeMjZ/iVYZ+Xguahrh6daAo=
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