Skip to content

Commit a508634

Browse files
committed
Explain rdflib.js usage.
1 parent fca6f1b commit a508634

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

README.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ through [LDflex](https://github.com/RubenVerborgh/LDflex) expressions
77
[![Coverage Status](https://coveralls.io/repos/github/solid/query-ldflex/badge.svg?branch=master)](https://coveralls.io/github/solid/query-ldflex?branch=master)
88
[![Dependency Status](https://david-dm.org/solid/query-ldflex.svg)](https://david-dm.org/solid/query-ldflex)
99

10-
This library brings the [LDflex](https://github.com/RubenVerborgh/LDflex) language
11-
to Solid by:
10+
This library is a _configuration_ of
11+
the [LDflex](https://github.com/RubenVerborgh/LDflex) language
12+
for the Solid ecosystem.
13+
It configures LDflex with:
1214

13-
1. setting [JSON-LD context for Solid](https://github.com/solid/context)
14-
2. binding a query engine ([Comunica](https://github.com/RubenVerborgh/LDflex-Comunica))
15-
3. exposing useful [data paths](#data-paths)
15+
1.[JSON-LD context for Solid](https://github.com/solid/context)
16+
2. a Solid-authenticated query engine ([Comunica](https://github.com/RubenVerborgh/LDflex-Comunica) or [rdflib.js](https://github.com/LDflex/LDflex-rdflib/))
17+
3. useful [data paths](#data-paths) for Solid
1618

1719
LDflex expressions occur for example
1820
on [Solid React components](https://github.com/solid/react-components),
@@ -97,7 +99,7 @@ npm install @solid/query-ldflex
9799
```
98100

99101
## Usage
100-
### With Node.js
102+
### Within Node.js environments
101103
```javascript
102104
const { default: data } = require('@solid/query-ldflex');
103105

@@ -119,6 +121,19 @@ async function showProfile(person) {
119121

120122
```
121123

124+
If, instead of the Comunica query engine,
125+
you want to use the rdflib.js query engine,
126+
you can
127+
128+
```javascript
129+
const { default: data } = require('@solid/query-ldflex/lib/exports/rdflib');
130+
```
131+
132+
When creating browser builds,
133+
it can be easier to simply tell webpack
134+
to replace `@ldflex/comunica` by `@ldflex/rdflib`.
135+
136+
122137
### In the browser
123138
```html
124139
<script src="solid-auth-client.bundle.js"></script>
@@ -133,6 +148,15 @@ document.addEventListener('DOMContentLoaded', async () => {
133148

134149
```
135150

151+
To replace Comunica by rdflib.js,
152+
opt for
153+
154+
```html
155+
<script src="solid-auth-client.bundle.js"></script>
156+
<script src="rdflib.min.js"></script>
157+
<script src="solid-query-ldflex.rdflib.js"></script>
158+
```
159+
136160
### Adding a custom JSON-LD context
137161
In addition to the [default properties](https://github.com/solid/context/blob/master/context.json),
138162
you might want to support your own:

0 commit comments

Comments
 (0)