# @ezs/lodex

> ezs dedicated statements for Lodex

Latest version **1.16.6** (published 2023-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ezs/lodex
pnpm add @ezs/lodex
yarn add @ezs/lodex
bun add @ezs/lodex
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.16.6 |
| Published | 2023-08-16 |
| First published | 2019-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 128.4 KB |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Nicolas Thouvenin |
| Maintainers | parmentf, touv, jj618 |
| Keywords | ezs |

## Links

- npm: https://www.npmjs.com/package/@ezs/lodex
- Repository: https://github.com/Inist-CNRS/ezs
- Homepage: https://github.com/Inist-CNRS/ezs/tree/master/packages/lodex#readme
- Issues: https://github.com/Inist-CNRS/ezs/issues
- npm.io page: https://npm.io/package/@ezs/lodex

## Dependencies (16)

- [n3](https://npm.io/package/n3.md) 1.9.0
- [jsonld](https://npm.io/package/jsonld.md) 3.1.1
- [mongodb](https://npm.io/package/mongodb.md) 4.12.0
- [quick-lru](https://npm.io/package/quick-lru.md) 4.0.1
- [valid-url](https://npm.io/package/valid-url.md) 1.0.9
- [lodash.get](https://npm.io/package/lodash.get.md) 4.4.2
- [lodash.set](https://npm.io/package/lodash.set.md) 4.3.2
- [xml-writer](https://npm.io/package/xml-writer.md) 1.7.0
- [lodash.find](https://npm.io/package/lodash.find.md) 4.6.0
- [lodash.omit](https://npm.io/package/lodash.omit.md) 4.5.0
- [lodash.unset](https://npm.io/package/lodash.unset.md) 4.5.2
- [relaxed-json](https://npm.io/package/relaxed-json.md) 1.0.3
- [lodash.compose](https://npm.io/package/lodash.compose.md) 2.4.1
- [lodash.mapkeys](https://npm.io/package/lodash.mapkeys.md) 4.6.0
- [lodash.zipobject](https://npm.io/package/lodash.zipobject.md) 4.1.3
- [node-object-hash](https://npm.io/package/node-object-hash.md) 2.3.10

## Recent versions

- 1.16.6 (latest) — 2023-08-16
- 1.16.5 — 2023-07-17
- 1.16.4 — 2023-03-28
- 1.16.3 — 2023-03-10
- 1.16.2 — 2023-01-05
- 1.16.1 — 2022-11-21
- 1.16.0 — 2022-11-18
- 1.15.2 — 2022-09-14
- 1.15.1 — 2022-06-21
- 1.15.0 — 2022-02-07
- 1.14.11 — 2022-01-31
- 1.14.10 — 2022-01-27
- 1.14.9 — 2021-12-15
- 1.14.8 — 2021-12-13
- 1.14.7 — 2021-12-06
- … 50 more at https://npm.io/package/@ezs/lodex/versions

## README

# lodex

Ce plugin propose une série d'instructions spécifiques à l’usage de [lodex](https://lodex.inist.fr)

## installation

```bash
npm install @ezs/core
```

## usage

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [convertJsonLdToNQuads](#convertjsonldtonquads)
-   [convertToAtom](#converttoatom)
-   [convertToExtendedJsonLd](#converttoextendedjsonld)
-   [extractIstexQuery](#extractistexquery)
-   [Field](#field)
-   [flattenPatch](#flattenpatch)
-   [getLastCharacteristic](#getlastcharacteristic)
-   [getParam](#getparam)
-   [injectDatasetFields](#injectdatasetfields)
-   [keyMapping](#keymapping)
-   [labelizeFieldID](#labelizefieldid)
-   [LodexAggregateQuery](#lodexaggregatequery)
-   [LodexBuildContext](#lodexbuildcontext)
-   [LodexGetCharacteristics](#lodexgetcharacteristics)
-   [LodexGetFields](#lodexgetfields)
-   [LodexInjectCountFrom](#lodexinjectcountfrom)
-   [LodexInjectSyndicationFrom](#lodexinjectsyndicationfrom)
-   [LodexJoinQuery](#lodexjoinquery)
-   [LodexOutput](#lodexoutput)
-   [LodexReduceQuery](#lodexreducequery)
-   [LodexRunQuery](#lodexrunquery)
-   [objects2columns](#objects2columns)
-   [parseNQuads](#parsenquads)
-   [writeTurtle](#writeturtle)

### convertJsonLdToNQuads

Take a JSON-LD object and transform it into NQuads triples.

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

### convertToAtom

Generate an atom XML feed from a resources feed, the LODEX configuration and
model.

#### Parameters

-   `fields` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** LODEX model (optional, default `{}`)
-   `atomFeed` **Feed** A feed of resources, see [feed](https://github.com/jpmonette/feed) (optional, default `{}`)
-   `config` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** LODEX configuration (with `perPage`) (optional, default `{}`)

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

### convertToExtendedJsonLd

Convert the result of an ISTEX query to an extended JSON-LD.

Every hit must contain the URI of original lodex resource, linked to the
query.

#### Parameters

-   `schemeForIstexQuery` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** URI to put between document and resource

### extractIstexQuery

Extract an ISTEX API query.

#### Parameters

-   `fields` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Field](#field)>** list of LODEX fields (optional, default `[]`)

#### Examples

Output:


```javascript
{
   content: 'fake query',
   lodex: {
      uri: 'http://resource.uri',
  },
}
```

### Field

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), any>

#### Properties

-   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The identifier of the field.
-   `scheme` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The semantic property of the field.

### flattenPatch

Take `Object` and transform all key ending byu number on array.

#### Parameters

-   `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### getLastCharacteristic

Get last characteristic (list of all dataset covering fields).

#### Examples

Input:


```javascript
[
  {
    "_id" : ObjectId("5ca32c64019f45001d2b602d"),
    "publicationDate" : ISODate("2019-04-02T09:33:24.463Z")
  },
  {
    "_id" : ObjectId("5cee50bb019f45001d2b602f"),
    "publicationDate" : ISODate("2019-05-29T09:28:27.773Z")
  },
  {
    "_id" : ObjectId("5cee5119019f45001d2b6031"),
    "publicationDate" : ISODate("2019-05-29T09:30:01.319Z")
  },
  {
    "_id" : ObjectId("5cee5153019f45001d2b6032"),
    "publicationDate" : ISODate("2019-05-29T09:30:59.770Z")
  },
  {
    "_id" : ObjectId("5cee5160019f45001d2b6033"),
    "publicationDate" : ISODate("2019-05-29T09:31:12.503Z")
  },
  {
    "_id" : ObjectId("5cee530e3e9676001909ba24"),
    "publicationDate" : ISODate("2019-05-29T09:38:22.569Z")
  }
]
```

Output:


```javascript
{
  "_id" : ObjectId("5cee530e3e9676001909ba24"),
  "publicationDate" : ISODate("2019-05-29T09:38:22.569Z")
}
```

Returns **any** 

### getParam

### injectDatasetFields

Inject in each item the last characteristics (the dataset covering fields) of a LODEX.

#### Parameters

-   `connectionStringURI` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** MongoDB connection string

#### Examples

Output:


```javascript
[
  {
    "characteristics": {
      "_id": "5d289071340bb500201b5146",
      "qW6w": "Catégories WOS",
      "ImiI": "Cette table correspond aux catégories Web Of Science.",
      "alRS": "/api/run/syndication",
      "aDLT": "Dans le cadre de l'enrichissement des documents du...",
      "SFvt": "https://enrichment-process.data.istex.fr/ark:/67375/R0H-PWBRNFQ8-H",
      "RzXW": "https://docs.google.com/drawings/d/1LzjO-oD6snh0MYfqxfPB7q-LU6Dev1SRmJstXFGzgvg/pub?w=960&h=720",
      "E4jH": "https://www.etalab.gouv.fr/licence-ouverte-open-licence",
      "MvkG": "Plateforme ISTEX",
      "m7G5": "Inist-CNRS",
      "1TvM": "2016-05-12",
      "WcNl": "2019-01-16",
      "publicationDate": "2019-07-12T13:51:45.129Z"
    }
  }
]
```

### keyMapping

Take an object and map its keys to the one in mapping parameters.
Keep keys absent in `from` parameter.

<caption>Input:</caption>

```json
[{
  "dFgH": "Value",
  "AaAa": "Value 2"
}]
```

<caption>EZS:</caption>

```ini
[keyMapping]
from = dFgH
to = Title
from = AaAa
to = Description
```

<caption>Output</caption>

```json
[{
  "Title": "Value",
  "Description": "Value 2"
}]
```

#### Parameters

-   `from` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** keys of the input
-   `to` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** matching keys for the output

Returns **any** Same object with modified keys

### labelizeFieldID

Inject in each item the last characteristics (the dataset covering fields) of a LODEX.

#### Parameters

-   `connectionStringURI` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** MongoDB connection string
-   `suffix` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Add ID field as a suffix

#### Examples

Input:


```javascript
[
  {
      "xderc": "Catégories WOS",
      "34Ddd": "Cette table correspond aux catégories Web Of Science.",
      "SD2Fs": "/api/run/syndication",
    }
  }
]
```

Output:


```javascript
[
  {
      "Titre": "Catégories WOS",
      "Description": "Cette table correspond aux catégories Web Of Science.",
      "URL": "/api/run/syndication",
    }
  }
]
```

### LodexAggregateQuery

Take `Object` containing a MongoDB aggregate query and throw the result

The input object must contain a `connectionStringURI` property, containing
the connection string to MongoDB.

#### Parameters

-   `collection` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** collection to use (optional, default `"publishedDataset"`)
-   `referer` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** data injected into every result object
-   `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** MongoDB filter
-   `limit` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result
-   `skip` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### LodexBuildContext

Take `Object` containing a URL query and throw a Context Object
compatible with runQuery or reduceQuery

#### Parameters

-   `connectionStringURI` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to connect to MongoDB (optional, default `"mongodb://ezmaster_db:27017"`)
-   `host` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** to set host (usefull to build some links)

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### LodexGetCharacteristics

Return the last characteristics (the dataset covering fields) of a LODEX.

#### Parameters

-   `connectionStringURI` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** MongoDB connection string

#### Examples

Output:


```javascript
[
  {
    "characteristics": {
      "_id": "5d289071340bb500201b5146",
      "qW6w": "Catégories WOS",
      "ImiI": "Cette table correspond aux catégories Web Of Science.",
      "alRS": "/api/run/syndication",
      "aDLT": "Dans le cadre de l'enrichissement des documents du...",
      "SFvt": "https://enrichment-process.data.istex.fr/ark:/67375/R0H-PWBRNFQ8-H",
      "RzXW": "https://docs.google.com/drawings/d/1LzjO-oD6snh0MYfqxfPB7q-LU6Dev1SRmJstXFGzgvg/pub?w=960&h=720",
      "E4jH": "https://www.etalab.gouv.fr/licence-ouverte-open-licence",
      "MvkG": "Plateforme ISTEX",
      "m7G5": "Inist-CNRS",
      "1TvM": "2016-05-12",
      "WcNl": "2019-01-16",
      "publicationDate": "2019-07-12T13:51:45.129Z"
    }
  }
]
```

### LodexGetFields

Return the fields (the model) of a LODEX.

#### Parameters

-   `connectionStringURI` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** MongoDB connection string

### LodexInjectCountFrom

Inject in each item the last characteristics (the dataset covering fields) of a LODEX.

<caption>Input:</caption>

```json
[
          { "id": 0, "value":2000  },
          { "id": 1, "value":2001  },
          { "id": 2, "value":2003  },
          { "id": 3, "value":2005  },
          { "id": 4, "value":2007  },
          { "id": 2, "value":2003  },
          { "id": 6, "value":2011  },
          { "id": 7, "value":2013  }
]
```

<caption>Script:</caption>

```ini
[injectCountFrom]
path = value
field = publicationDate
```

<caption>Output:</caption>

```json
[
          { "id": 0, "value":2003, "value_count":3  },
          { "id": 1, "value":2001, "value_count":1  },
          { "id": 2, "value":2003, "value_count":3  },
          { "id": 3, "value":2005, "value_count":1  },
          { "id": 4, "value":2007, "value_count":1  },
          { "id": 2, "value":2003, "value_count":3  },
          { "id": 6, "value":2011, "value_count":2  },
          { "id": 7, "value":2011, "value_count":2  }
]
```

#### Parameters

-   `connectionStringURI` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** MongoDB connection string
-   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to get value to find
-   `field` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name contains the value to find (generaly equals to path) (optional, default `auto`)

### LodexInjectSyndicationFrom

Inject title & description (syndicationà from field what conatsin the uri of one resource

#### Parameters

-   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Field path contains URI
-   `connectionStringURI` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** MongoDB connection string

#### Examples

Output:


```javascript
[
  {
{
      "id": "uri:/ZD44DSQ",
      "id-title": "Titre de la ressource uri:/ZD44DSQ",
      "id-description": "Description de la ressource uri:/ZD44DSQ",
      "value": 10
    }
  }
]
```

### LodexJoinQuery

Take 3 parameters and create a join query (one to many, on sub-ressource)

The input object must contain a `connectionStringURI` property, valued with
the connection string to MongoDB.

#### Parameters

-   `collection` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** collection to use (optional, default `"publishedDataset"`)
-   `referer` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** data injected into every result object
-   `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** MongoDB filter (optional, default `{}`)
-   `sortOn` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Field to sort on
-   `sortOrder` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Oder to sort
-   `matchField` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Lodex field, containing matchable element
-   `matchValue` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Value used with the match field to get items
-   `joinField` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Lodex field used for the join request
-   `limit` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result
-   `skip` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### LodexOutput

Format the output in compliance with LODEX routines format.

#### Parameters

-   `keyName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the `data` property (optional, default `"data"`)
-   `indent` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** indent or not (optional, default `false`)
-   `extract` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>?** fields to put at the root of the output
                                      object

#### Examples

Input


```javascript
[
     { _id: 1, value: 2, total: 2 },
     { _id: 2, value: 4, total: 2 }
]
```

Script


```javascript
.pipe(ezs('LodexOutput', { extract: 'total' }))
```

Output


```javascript
{
    data [
        { _id: 1, value: 2 },
        { _id: 2, value: 4 }
    ],
    total: 2
}
```

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

### LodexReduceQuery

Take an `Object` containing a MongoDB query, and a reducer, then throw the
result.

The input object must contain a `connectionStringURI` property, containing
the connection string to MongoDB.

#### Parameters

-   `reducer` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the reducer to use
-   `referer` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** data injected into every result object
-   `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** MongoDB filter (optional, default `{}`)
-   `field` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** limit the result to some fields (optional, default `"uri"`)
-   `minValue` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result
-   `maxValue` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result
-   `maxSize` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** limit the result (optional, default `1000000`)
-   `orderBy` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** sort the result

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### LodexRunQuery

Take `Object` containing a MongoDB query and throw the result

The input object must contain a `connectionStringURI` property, containing
the connection string to MongoDB.

#### Parameters

-   `collection` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** collection to use (optional, default `"publishedDataset"`)
-   `referer` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** data injected into every result object
-   `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** MongoDB filter
-   `sortOn` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Field to sort on
-   `sortOrder` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Oder to sort
-   `field` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** limit the result to some fields (optional, default `"uri"`)
-   `limit` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result
-   `skip` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** limit the result

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### objects2columns

Take an `Object` and flatten it to get only one level of keys.

<caption>Input:</caption>

```json
[{
  "foo": {
    "hello": "world"
  },
  "bar": "anything else",
  "baz": 1
}]
```

<caption>Output:</caption>

```json
[{
  "foo": "{\"hello\":\"world\"}",
  "bar": "anything else",
  "baz": 1
}]
```

#### Parameters

-   `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### parseNQuads

Take N-Quads string and transform it to Objects.

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

### writeTurtle

Take quad or prefixes object and return turtle string.

<caption>Input:</caption>

```js
[{
   quad: {
     subject: { id: 'http://uri/janedoe' },
     predicate: { id: 'http://schema.org/jobTitle' },
     object: { id: '"Professor"' }
   }
 }, {
     quad: {
     subject: { id: 'http://uri/janedoe' },
     predicate: { id: 'http://schema.org/name' },
     object: { id: '"Jane Doe"' }
   }
 }, {
     quad: {
     subject: { id: 'http://uri/janedoe' },
     predicate: { id: 'http://schema.org/telephone' },
     object: { id: '"(425) 123-4567"' }
     }
 }, {
     quad: {
     subject: { id: 'http://uri/janedoe' },
     predicate: { id: 'http://schema.org/url' },
     object: { id: 'http://www.janedoe.com' }
     }
 }, {
     quad: {
     subject: { id: 'http://uri/janedoe' },
     predicate: { id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' },
     object: { id: 'http://schema.org/Person' }
     }
 }, { prefixes: {} }
]
```

<caption>Output:</caption>

```txt
\@prefix schema: <http://schema.org/>.
\@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.

<http://uri/janedoe> schema:jobTitle "Professor";
    schema:name "Jane Doe";
    schema:telephone "(425) 123-4567";
    schema:url <http://www.janedoe.com>;
    a schema:Person.
```

Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** turtle

---
_Source: https://npm.io/package/@ezs/lodex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
