if (manifestURL.endsWith(".ttl") || manifestURL.endsWith("nq")
|| manifestURL.endsWith("nt")) {
try {
Map<String, Object> rval = (Map<String, Object>) JsonLdProcessor.fromRDF(
manifestFile, new JsonLdOptions(manifestURL) {
{
this.format = "text/turtle";
this.useNamespaces = true;
this.outputForm = "compacted";
}
});
final Map<String, Object> frame = new LinkedHashMap<String, Object>();
frame.put("@context", rval.get("@context"));
frame.put("@type",
"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#Manifest");
// make manifest the base object, embeding any referenced items
// (e.g. the test entries)
rval = JsonLdProcessor.frame(rval, frame, new JsonLdOptions(manifestURL));
// compact to remove the @graph label
this.manifest = JsonLdProcessor.compact(rval, frame.get("@context"),
new JsonLdOptions(manifestURL));
this.tests = (List<Map<String, Object>>) Obj.get(this.manifest, "mf:entries",
"@list");
} catch (final JsonLdError e) {
throw new RuntimeException(e);