Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56981097
README.md
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
870 B
Referenced Files
None
Subscribers
None
README.md
View Options
#
SPARQL
client
The
crate
sparql
-
client
is
a
SPARQL
client
based
on
Oxigraph
components
.
It
can
be
used
to
query
SPARQL
endpoints
like
Wikidata
.
##
Usage
example
```
use
sparql_client
::
Client
;
#[
tokio
::
main
]
async
fn
main
()
{
let
client
=
Client
::
new
(
"https://query.wikidata.org/sparql"
);
let
railway_query
=
r
#
"
#Cities connected by the Trans-Mongolian and Trans-Siberian Railway
SELECT ?city ?cityLabel ?coordinates
WHERE
{
VALUES ?highway { wd:Q559037 wd:Q58767 }
?highway wdt:P2789 ?city .
?city wdt:P625 ?coordinates .
SERVICE wikibase:label { bd:serviceParam wikibase:language "
en
". }
}
"
#;
let
solutions
=
client
.
query
(
railway_query
).
await
.
into_solutions
()
.
expect
(
"No response has been found for the query."
);
for
city_solution
in
solutions
{
println
!(
"{:?}"
,
city_solution
);
}
}
```
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 09:01 (3 d, 4 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4258049
Default Alt Text
README.md (870 B)
Attached To
Mode
rDS Nasqueron Datasources
Attached
Detach File
Event Timeline
Log In to Comment