Examples of JenaTripleCallback


Examples of com.github.jsonldjava.impl.JenaTripleCallback

public class JSONLDFormatter  implements Formatter {

  @Override
  public Model format(String raw) throws IOException {
    Object json = JSONUtils.fromString(raw);
    JenaTripleCallback callback = new JenaTripleCallback();
    try {
      JSONLD.toRDF(json, callback);
    } catch (JSONLDProcessingError e) {
      throw new IOException(e);
    }
    return callback.getJenaModel();
  }
View Full Code Here

Examples of com.github.jsonldjava.jena.JenaTripleCallback

                add("<http://localhost:8080/foo1> <http://foo.com/code> \"123\"^^<http://www.w3.org/2001/XMLSchema#string> .");
                add("<http://localhost:8080/foo2> <http://foo.com/code> \"ABC\"^^<http://www.w3.org/2001/XMLSchema#string> .");
            }
        };

        final JSONLDTripleCallback callback = new JenaTripleCallback();
        final Model model = (Model) JsonLdProcessor.toRDF(input, callback);

        final StringWriter w = new StringWriter();
        model.write(w, "N-TRIPLE");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.