@@ -7,12 +7,14 @@ through [LDflex](https://github.com/RubenVerborgh/LDflex) expressions
7
7
[ ![ Coverage Status] ( https://coveralls.io/repos/github/solid/query-ldflex/badge.svg?branch=master )] ( https://coveralls.io/github/solid/query-ldflex?branch=master )
8
8
[ ![ Dependency Status] ( https://david-dm.org/solid/query-ldflex.svg )] ( https://david-dm.org/solid/query-ldflex )
9
9
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:
12
14
13
- 1 . setting a [ 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 . a [ 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
16
18
17
19
LDflex expressions occur for example
18
20
on [ Solid React components] ( https://github.com/solid/react-components ) ,
@@ -97,7 +99,7 @@ npm install @solid/query-ldflex
97
99
```
98
100
99
101
## Usage
100
- ### With Node.js
102
+ ### Within Node.js environments
101
103
``` javascript
102
104
const { default: data } = require (' @solid/query-ldflex' );
103
105
@@ -119,6 +121,19 @@ async function showProfile(person) {
119
121
120
122
```
121
123
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
+
122
137
### In the browser
123
138
``` html
124
139
<script src =" solid-auth-client.bundle.js" ></script >
@@ -133,6 +148,15 @@ document.addEventListener('DOMContentLoaded', async () => {
133
148
134
149
```
135
150
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
+
136
160
### Adding a custom JSON-LD context
137
161
In addition to the [ default properties] ( https://github.com/solid/context/blob/master/context.json ) ,
138
162
you might want to support your own:
0 commit comments