Package spark.api

Examples of spark.api.Command


    InetSocketAddress serverAddress = server.getAddress();
   
    try {
      DataSource ds = new SHPDataSource(serverAddress.getHostName(), serverAddress.getPort());
      Connection conn = ds.getConnection(NoCredentials.INSTANCE);
      Command command = conn.createCommand("SELECT ?x ?y WHERE { this should be a real query but the test doesn't actually do anything real. }");
      command.setTimeout(1234);
      command.executeQuery();
     
      // Kind of tricky here - the keys and values are now Avro Utf8 instances which don't compare equal to Strings
      Map<CharSequence,CharSequence> serverProps = (Map<CharSequence,CharSequence>)results.get(0);
      Assert.assertEquals(new Utf8("1234"), serverProps.get(new Utf8(QueryExecution.TIMEOUT)));
     
View Full Code Here


    URL serviceUrl = new URL("http://example.org/sparql");
    // dummy data source to pass the URL down to the parser.
    ProtocolDataSource ds = new ProtocolDataSource(serviceUrl);
    try {
      Connection c = ds.getConnection(NoCredentials.INSTANCE);
      Command cmd = c.createCommand("SELECT foo"); // query isn't actually executed.
     
      metadataTest(cmd, "results-with-metadata",
          "http://sample.org/metadata.rdf", "http://example.org/service-description.rdf");
      metadataTest(cmd, "results-with-base-uri",
          "http://sample.org/metadata.rdf", "http://revelytix.com/ns/service-description.rdf", "http://example.com/sparql.ttl");
View Full Code Here

TOP

Related Classes of spark.api.Command

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.