public long postGraphML(final String path) throws Exception {
  final UUID uuid=UUID.randomUUID();
  final ConnectOptions opts=mgr.newConnectOptions(sparqlEndpointURL,uuid,tx);
  opts.addRequestParam("blueprints");
  JettyResponseListener response=null;
  try {
    final File file=new File(path);
    if (!file.exists()) {
      throw new RuntimeException("cannot locate file: " + file.getAbsolutePath());
    }
    final byte[] data=IOUtil.readBytes(file);
    final ByteArrayEntity entity=new ByteArrayEntity(data);
    entity.setContentType(ConnectOptions.MIME_GRAPH_ML);
    opts.entity=entity;
    opts.setAcceptHeader(ConnectOptions.MIME_APPLICATION_XML);
    checkResponseCode(response=doConnect(opts));
    final MutationResult result=mutationResults(response);
    return result.mutationCount;
  }
  finally {
    if (response != null)     response.abort();
  }
}

public long postGraphML ( final String path ) throws Exception { final UUID uuid = UUID . randomUUID ( ) ; final ConnectOptions opts = mgr . newConnectOptions ( sparqlEndpointURL , uuid , tx ) ; opts . addRequestParam ( "blueprints" ) ; JettyResponseListener response = null ; try { final File file = new File ( path ) ; if ( ! file . exists ( ) ) { throw new RuntimeException ( "cannot locate file: " + file . getAbsolutePath ( ) ) ; } final byte [ ] data = IOUtil . readBytes ( file ) ; final ByteArrayEntity entity = new ByteArrayEntity ( data ) ; entity . setContentType ( ConnectOptions . MIME_GRAPH_ML ) ; opts . entity = entity ; opts . setAcceptHeader ( ConnectOptions . MIME_APPLICATION_XML ) ; checkResponseCode ( response = doConnect ( opts ) ) ; final MutationResult result = mutationResults ( response ) ; return result . mutationCount ; } finally { if ( response != null ) response . abort ( ) ; } }
post a graphml file to the blueprints layer of the remote bigdata instance .
