Package lupos.endpoint.server.format

Examples of lupos.endpoint.server.format.XMLFormatter


             */
            if (getP2PNetwork().supportsStreaming()) {
              /*
               * for streaming we use XML als formatter
               */
              final Formatter _formatter = new XMLFormatter();
              /*
               * create header and evaluate the subgraph
               */
              byte[] head = P2PInputStreamMessage.createHeader(
                  _answerId, true);
View Full Code Here


    if(args.length<3 || args.length%2 == 0){
      System.err.println("Wrong number of arguments!");
    }
    final RDF3XQueryEvaluator evaluator = new RDF3XQueryEvaluator();
    evaluator.loadLargeScaleIndices(args[0]);
    final Formatter formatter = new XMLFormatter();
    ServiceApproaches.Semijoin_Approach.setup();
    for(int i=1; i<args.length; i+=2){
      final String query = FileHelper.readFile(args[i]);
      System.out.println("\nProcess SPARQL query:");
      System.out.println(query);
      final QueryResult queryResult = evaluator.getResult(query, true);
      System.out.println("\nSave result into file: "+args[i+1]);
      final OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(args[i+1]));
      formatter.writeResult(outputStream, evaluator.getVariablesOfQuery(), queryResult);
      outputStream.close();
      evaluator.writeOutIndexFileAndModifiedPages(args[0]);
      queryResult.release();
    }
    System.out.println("\nDone!");
View Full Code Here

    Endpoint.registerStandardFormatter();
    Endpoint.registerStandardContexts(directory);
  }

  public static void registerStandardFormatter(){
    Endpoint.registerFormatter(new XMLFormatter());
    Endpoint.registerFormatter(new XMLFormatter(true));
    Endpoint.registerFormatter(new PlainFormatter());
    Endpoint.registerFormatter(new JSONFormatter());
    Endpoint.registerFormatter(new JSONFormatter(true));
    Endpoint.registerFormatter(new CSVFormatter());
    Endpoint.registerFormatter(new TSVFormatter());
View Full Code Here

   * @return a tuple with the mime type of the serialized query result as well as the serialized query result in XML format
   * @throws JSONException
   * @throws IOException
   */
  public static Tuple<String, String> evaluateSubgraphAndReturnSerializedXMLResult(final String subgraphSerializedAsJSONString, final Dataset dataset, final IOperatorCreator operatorCreator) throws JSONException, IOException {
    return LocalExecutor.evaluateSubgraphAndReturnSerializedResult(subgraphSerializedAsJSONString, dataset, operatorCreator, new XMLFormatter());
  }
View Full Code Here

TOP

Related Classes of lupos.endpoint.server.format.XMLFormatter

Copyright © 2018 www.massapicom. 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.