Skip to content
Permalink
Browse files
Merge branch 'main' of github.com:apache/jena-site
  • Loading branch information
afs committed Sep 16, 2021
2 parents 2bf1d6f + 4710c6d commit ec4adaf90ca237680e6f1f2828a7c3f32c5ab862
Showing 3 changed files with 60 additions and 3 deletions.
@@ -8,9 +8,10 @@ This page describes how to achieve certain common tasks in the most direct way p

1. Unpack the distribution.
2. Copy the WAR file into the Apache tomcat webapp directory, under the name 'fuseki'
3. In a browser, go to `[http://localhost:8080/fuseki/](http://localhost:8080/fuseki)` (details such as port number depend on the Tomcat setup).
4. Click on "Add one", choose "in-memory", choose a name for the URL for the dataset.
5. Go to "add data" and load the file (single graph).
3. If the user under which Apache tomcat is running does not have write access to `/etc`, then please make sure to set the environment variable FUSEKI_BASE, whereas the value should be a directory where the user running Apache tomcat is able to write to.
4. In a browser, go to `[http://localhost:8080/fuseki/](http://localhost:8080/fuseki)` (details such as port number depend on the Tomcat setup).
5. Click on "Add one", choose "in-memory", choose a name for the URL for the dataset.
6. Go to "add data" and load the file (single graph).

## Publish an RDF file as a SPARQL endpoint.

@@ -30,6 +30,9 @@ can be integrated into both the parser and writer registries.
RDF/JSON is different from JSON-LD - it is a direct encoding of RDF triples in JSON.
See the [description of RDF/JSON](rdf-json.html).

See "[Reading JSON-LD 1.1](json-ld-11.html)" for additional setup and use for
reading JSON-LD 1.1. JSON-LD 1.0 is the current default in Jena.

RDF Binary is a binary encoding of RDF (graphs and datasets) that can be useful
for fast parsing. See [RDF Binary using Apache Thrift](rdf-binary.html).

@@ -0,0 +1,53 @@
---
title: Reading JSON-LD 1.1
---

See "[Reading RDF](./rdf-input.html)" for details of Jena's support JSON-LD v1.0
using the
[jsonld-java project](https://github.com/jsonld-java/jsonld-java)
for both reading and writing. This is the principle support for JSON-LD.

This page details support for reading JSON-LD 1.1 using
[Titanium JSON-LD](https://github.com/filip26/titanium-json-ld/).

While Titanium is licensed under the Apache License, it has a dependency on
the Eclipse Jakarta JSON Processing API, which is licensed under the Eclipse
Public License 2.0.

## Additional Dependencies

The Titanium engine (`com.apicatalog:titanium-json-ld`) uses the Eclispe Jakarta JSON Processing
licnesed under the
[Eclipse Public License 2.0](https://www.eclipse.org/legal/epl-2.0/) with dependencies:

* jakarta.json:jakarta.json-api
* org.glassfish:jakarta.json

Failure to add these dependencies will result in `UnsupportedOperationException`
```
Need both titanium-json-ld (1.1.0 or later) and org.glassfish:jakarta on the classpath
```

## Usage

Jena currently (from version 4.2.0) offers both JSON-LD 1.0 and also JSON-LD 1.1.

The file extension for JSONLD 1.1 is `.jsonld11`.

If not reading from a file with this file extension, the application needs to
force the language choice to be JSON-LD 1.1 with
[`RDFParser`](https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFParser.html)
using `forceLang(Lang.JSONLD11)`:

```
RDFParser.source(...)
.forceLang(Lang.JSONLD11)
...
.build()
```
or short-cut form:
```
RDFParser.source(URL or InputStream)
.forceLang(Lang.JSONLD11)
.parse(dataset);
```

0 comments on commit ec4adaf

Please sign in to comment.