/** * Converts an RDF dataset to JSON-LD, using the default * {@link JsonLdOptions}. * * @param dataset * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert. * @return The JSON-LD object represented by the given RDF dataset * @throws JsonLdError * If there was an error converting from RDF to JSON-LD */ public static Object fromRDF(Object dataset) throws JsonLdError { return fromRDF(dataset, new JsonLdOptions("")); }
/** * Converts an RDF dataset to JSON-LD, using the default * {@link JsonLdOptions}. * * @param dataset * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert. * @return The JSON-LD object represented by the given RDF dataset * @throws JsonLdError * If there was an error converting from RDF to JSON-LD */ public static Object fromRDF(Object dataset) throws JsonLdError { return fromRDF(dataset, new JsonLdOptions("")); }
/** * Converts an RDF dataset to JSON-LD, using the default * {@link JsonLdOptions}. * * @param dataset * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert. * @return The JSON-LD object represented by the given RDF dataset * @throws JsonLdError * If there was an error converting from RDF to JSON-LD */ public static Object fromRDF(Object dataset) throws JsonLdError { return fromRDF(dataset, new JsonLdOptions("")); }
/** * Converts an RDF dataset to JSON-LD, using a specific instance of * {@link RDFParser}, and the default {@link JsonLdOptions}. * * @param input * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert. * @param parser * A specific instance of {@link RDFParser} to use for the * conversion. * @return A JSON-LD object. * @throws JsonLdError * If there is an error converting the dataset to JSON-LD. */ public static Object fromRDF(Object input, RDFParser parser) throws JsonLdError { return fromRDF(input, new JsonLdOptions(""), parser); }
/** * Converts an RDF dataset to JSON-LD, using a specific instance of * {@link RDFParser}, and the default {@link JsonLdOptions}. * * @param input * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert. * @param parser * A specific instance of {@link RDFParser} to use for the * conversion. * @return A JSON-LD object. * @throws JsonLdError * If there is an error converting the dataset to JSON-LD. */ public static Object fromRDF(Object input, RDFParser parser) throws JsonLdError { return fromRDF(input, new JsonLdOptions(""), parser); }
/** * Converts an RDF dataset to JSON-LD, using a specific instance of * {@link RDFParser}, and the default {@link JsonLdOptions}. * * @param input * a serialized string of RDF in a format specified by the format * option or an RDF dataset to convert. * @param parser * A specific instance of {@link RDFParser} to use for the * conversion. * @return A JSON-LD object. * @throws JsonLdError * If there is an error converting the dataset to JSON-LD. */ public static Object fromRDF(Object input, RDFParser parser) throws JsonLdError { return fromRDF(input, new JsonLdOptions(""), parser); }
return fromRDF(dataset, options, parser);
return fromRDF(dataset, options, parser);
return fromRDF(dataset, options, parser);
Object output = JsonLdProcessor.fromRDF(triplesDocument.toString()); JsonLdOptions jlo = new JsonLdOptions(); String result = JsonUtils.toString(JsonLdProcessor.compact(output, null, jlo));
@Override public Object resolve(Context c, Map<String, String[]> parameters, Map<String, InputStream> dataStreams) throws JSONException { try { String obj = getObjAsString(c, parameters, dataStreams); if (obj == null) return null; JsonLdProcessor.registerRDFParser("RDF/XML", new RdfXmlParser(true)); JsonLdOptions options = new JsonLdOptions(); options.outputForm=JsonLdConsts.COMPACTED; options.format="RDF/XML"; Object output = JsonLdProcessor.fromRDF(obj, options); return new JSONObject(JsonUtils.toString(output)); } catch (IOException ex) { Logger.getLogger(CruncherJsonLdExpand.class.getName()).log(Level.SEVERE, null, ex); } catch (JsonLdError ex) { Logger.getLogger(CruncherJsonLdExpand.class.getName()).log(Level.SEVERE, null, ex); } return null; }
try { final long start = System.currentTimeMillis(); Object output = JsonLdProcessor.fromRDF(tc, serializer);
try { long start = System.currentTimeMillis(); Object output = JsonLdProcessor.fromRDF(tc, serializer);
Object output = JsonLdProcessor.fromRDF(obj, options); if(!((Map<String, Object>)output).containsKey("@context")){ Object context;
try { long start = System.currentTimeMillis(); Object output = JsonLdProcessor.fromRDF(tc, serializer);
try { Map<String, Object> rval = (Map<String, Object>) JsonLdProcessor .fromRDF(manifestFile, new JsonLdOptions(manifestURL) {
new ByteArrayInputStream(turtle.getBytes()), "", "TURTLE"); final JenaRDFParser parser = new JenaRDFParser(); final Object json = JsonLdProcessor.fromRDF(modelResult, parser);
final SesameRDFParser serialiser = new SesameRDFParser(); try { Object output = JsonLdProcessor.fromRDF(model, serialiser);
Object output = JsonLdProcessor.fromRDF(model, serialiser);
Object output = JsonLdProcessor.fromRDF(model, serialiser);