Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3743611
D3425.id8908.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3425.id8908.diff
View Options
diff --git a/sparql-client/Cargo.toml b/sparql-client/Cargo.toml
--- a/sparql-client/Cargo.toml
+++ b/sparql-client/Cargo.toml
@@ -2,6 +2,16 @@
name = "sparql-client"
version = "0.1.0"
edition = "2021"
+description = "SPARQL client based on Oxigraph components"
+authors = [
+ "Sébastien Santoro <dereckson@espace-win.org>"
+]
+license = "BSD-2-Clause"
+readme = "README.md"
+keywords = [ "RDF", "SPARQL", "Wikidata" ]
+categories = [ "database" ]
+repository = "https://devcentral.nasqueron.org/source/datasources/browse/main/sparql-client/"
+homepage = "https://agora.nasqueron.org/Nasqueron_Datasources"
[dependencies]
ds-http-client = { version = "0.1.0", path = "../ds-http-client" }
diff --git a/sparql-client/README.md b/sparql-client/README.md
new file mode 100644
--- /dev/null
+++ b/sparql-client/README.md
@@ -0,0 +1,37 @@
+# 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/plain
Expires
Fri, Nov 15, 22:26 (17 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2246822
Default Alt Text
D3425.id8908.diff (1 KB)
Attached To
Mode
D3425: Document sparql-client release
Attached
Detach File
Event Timeline
Log In to Comment