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
@@ -168,7 +170,7 @@ It is possible to upload up to 1,000 separate files in this way. When you have a
168
170
| ------------------ | ----------------------- |
169
171
| gzip |`.gz`|
170
172
| bzip2 |`.bz2`|
171
-
| tar |`tar`|
173
+
| tar |`.tar`, `.tgz`|
172
174
| XZ |`.xz`|
173
175
| ZIP |`.zip`|
174
176
@@ -220,6 +222,71 @@ select ?name ?category ?price where {
220
222
When you upload XML files to TriplyDB, they are automatically converted to RDF using the Facade-X data model. This preserves the hierarchical structure of the XML document, making it queryable via SPARQL.
221
223
See [here](https://sparql-anything.readthedocs.io/stable/formats/XML/) for more details on the Facade-X XML data model.
222
224
225
+
### JSON format
226
+
227
+
When you upload JSON files to TriplyDB, they are automatically converted to RDF using the Facade-X
228
+
data model, the same model that is used for [XML](#xml-format) and [tabular](#csv-and-tsv-format)
229
+
uploads. This preserves the structure of the JSON document, making it queryable via SPARQL. See
230
+
[here](https://sparql-anything.readthedocs.io/stable/formats/JSON/) for more details on the Facade-X
231
+
JSON data model.
232
+
233
+
Note that `.json` files are read as plain JSON. Use the `.jsonld` extension for
234
+
[JSON-LD](https://www.w3.org/TR/json-ld11/) documents, so that their `@context` is interpreted.
235
+
236
+
Objects and arrays are both mapped to containers: the members of an object are linked by their key,
237
+
the members of an array by their position.
238
+
239
+
- The document itself is typed `<http://sparql.xyz/facade-x/ns/root>`.
240
+
- Object keys become properties in the `https://triplydb.com/json/def/` namespace. Spaces and
241
+
non-ASCII characters in a key are percent-encoded, so the key `with space` becomes
242
+
`https://triplydb.com/json/def/with%20space`.
243
+
- Array members are linked by the container membership properties `rdf:_1`, `rdf:_2`, and so on, in
244
+
the order in which they appear.
245
+
- Strings become plain literals, booleans become `xsd:boolean` literals, and numbers become
246
+
`xsd:decimal` literals. An exponent is expanded, because it is not part of the lexical space of
247
+
`xsd:decimal`: `1e10` becomes `10000000000`. Digits are never rounded away, so a number that does
248
+
not fit a 64-bit float — `1234567890123456789`, `0.000000000000000001` — keeps its full precision.
249
+
- Uploads are information-preserving: a `null` is kept as the IRI
250
+
`https://triplydb.com/json/def/null` rather than dropped, and a key that occurs twice in the same
The position of an array member is part of its predicate, so a variable in that position —
283
+
`?position` above — iterates over every member, while `rdf:_1` selects only the first one.
284
+
285
+
A single file may hold several JSON documents, one after the other; each becomes its own root
286
+
resource. This is what the `.jsonl` and `.ndjson` extensions of
287
+
[JSON Lines](https://jsonlines.org) are for, but it works for a `.json` file with concatenated
288
+
documents as well.
289
+
223
290
### Adding malformed data
224
291
225
292
TriplyDB only allows valid RDF data to be added. If data is malformed, TriplyDB will show an error message that indicates which part of the RDF data is malformed (see screenshot). If such malformed data is encountered, the RDF file must first be corrected and uploaded again.
0 commit comments