From be6c7e741ca97cdbd0cd068e51efeb613ed3cd11 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Wed, 28 Jun 2023 12:47:52 +0200 Subject: [PATCH] Mention Comunica in README for more complex querying --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 59b4bae..b4fd9cc 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,21 @@ dataset.add(DF.quad(DF.namedNode('ex:s1'), DF.namedNode('ex:p1'), DF.namedNode(' console.log(dataset.has(DF.quad(DF.namedNode('ex:s1'), DF.namedNode('ex:p1'), DF.namedNode('ex:o1')))); ``` +Note that this library only focuses on triple storage and provide triple pattern query access. +If you want to execute more complex queries over this store (such as SPARQL queries), engines such as [Comunica](https://comunica.dev/) may be used: + +```typescript +import { QueryEngine } from '@comunica/query-sparql'; + +const bindingsStream = await myEngine.queryBindings(`SELECT * WHERE { ?s ?p ?o }`, { + sources: [store], +}); +bindingsStream.on('data', (binding) => { + console.log(binding.toString()); +}); +``` +Learn more about using Comunica: https://comunica.dev/docs/query/getting_started/query_app/ + ## Usage All public getters and methods of an `RdfStore` are illustrated below.