Sesame does not support the JSON-LD format out of the box. You will need to install a Sesame-compatible JSON-LD writer library (such as jsonld-java) into your existing Sesame installation.
To do this, get the jsonld-java
and jsonld-java-sesame
jar files plus their dependencies (unfortunately this is a bit of a chore as you will need to include several third party dependencies, such as Apache libraries and Jackson, as well - but you can download everything from Maven Central) and drop them into your Sesame deployment directory inside Tomcat. Typically this directory should be something like [TOMCAT_DIR]/webapps/openrdf-sesame/WEB-INF/lib
. Once you've done this, you'll need to restart Tomcat for Sesame to recognize the new writer.
Once this is done, supplying the correct Accept header (media type application/ld+json
) should get you JSON-LD results on your graph queries.
Alternatively, you can try using the RDF 1.1 JSON Alternate Serialization format, which is not really a standard like JSON-LD is, but is supported by Sesame. Media type application/rdf+json
.