You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Iridium CBOR-LD](https://github.com/filip26/iridium-cbor-ld) - CBOR-based Processor for Linked Data
30
29
31
30
## Table of Contents
32
31
-[Conformance](#conformance)
@@ -52,106 +51,117 @@ See [EARL results from the JSON-LD 1.1 Test Suite](https://w3c.github.io/json-ld
52
51
53
52
## Examples
54
53
55
-
Titanium provides a high-level [JsonLd](https://javadoc.io/doc/com.apicatalog/titanium-json-ld/latest/com/apicatalog/jsonld/JsonLd.html) API to interact with the processor.
54
+
Titanium provides a high-level [JsonLd](https://javadoc.io/doc/com.apicatalog/titanium-json-ld/latest/com/apicatalog/jsonld/JsonLd.html) API for interacting with JSON-LD documents.
56
55
57
56
### Transformations
58
57
58
+
Perform standard JSON-LD operations such as expansion, compaction, flattening, framing, and conversion from/to RDF. The JSON-LD document to process can be remote or local, while context documents may also be local or remote.
Load and process JSON-LD documents directly from an `InputStream` or `Reader`. You can perform expansion or compaction using local documents and contexts.
104
+
98
105
```javascript
99
-
// Create a JSON document from InputStream or Reader
100
-
Documentdocument=JsonDocument.of(InputStream) or JsonDocument.of(Reader) ...
106
+
// Load JSON from InputStream or Reader
107
+
Documentdocument=JsonDocument.of(inputStream);
108
+
Document context =JsonDocument.of(reader);
101
109
102
-
// Expand the document
110
+
// Expand the local document
103
111
JsonLd.expand(document).get();
104
112
105
-
// Compact the document with a context document
106
-
JsonLd.compact(document, contextDocument).get();
107
-
...
113
+
// Compact using a local context
114
+
JsonLd.compact(document, context).get();
108
115
```
109
116
110
117
### Processing Timeout [Experimental]
111
-
The processor will be terminated after a specified duration.
112
-
Please note that the duration does not include the time taken by `DocumentLoader` for processing.
113
-
You must set up a separate read timeout for document loading.
118
+
119
+
Set a maximum processing duration for JSON-LD operations. The timeout does not include time spent loading external documents.
114
120
115
121
```javascript
116
-
// Available since 1.4.0
117
-
JsonLd.expand(...).timeout(duration)...get();
122
+
// Terminates processing after the specified duration (excluding DocumentLoader time)
123
+
JsonLd.expand(document)
124
+
.timeout(Duration.ofSeconds(5))
125
+
.get();
118
126
```
119
127
120
128
### HTTP Document Loader Timeout
121
-
You can configure a custom HTTP document loader instance with a set read timeout.
129
+
130
+
Customize the HTTP loader to apply a read timeout when fetching remote JSON-LD or context documents.
122
131
123
132
```javascript
124
-
//Available since 1.4.0 - Set read timeout for HTTP document loader
133
+
//Configure a custom HTTP loader with a 30-second read timeout
0 commit comments