Package uk.org.ogsadai.client.toolkit

Examples of uk.org.ogsadai.client.toolkit.DataRequestExecutionResource


        }
        ResourceID drerID = new ResourceID(drerIDStr);
        ServerProxy server = new ServerProxy();
        server.setDefaultBaseServicesURL(new URL(url));
        // Get DRER
        DataRequestExecutionResource drer =
            server.getDataRequestExecutionResource(drerID);
        // Execute.
        executeRequest(server, drer);
    }
View Full Code Here


    public static DataRequestExecutionResource getDRER(String service)
    throws MalformedURLException
    {
        ServerProxy server = new ServerProxy();
        server.setDefaultBaseServicesURL(new URL(service));
        DataRequestExecutionResource drer = 
            server.getDataRequestExecutionResource(
                        new ResourceID("DataRequestExecutionResource"));
        return drer;
    }
View Full Code Here

        ResourceID drerId = new ResourceID("DataRequestExecutionResource");

        ServerProxy serverProxy = new ServerProxy();
        serverProxy.setDefaultBaseServicesURL(serverBaseUrl);

        DataRequestExecutionResource drer = serverProxy
                .getDataRequestExecutionResource(drerId);

        StringBuffer inputPE = new StringBuffer();
        inputPE.append("dummyName7");
        inputPE.append(",dummyST2");
        inputPE.append(",BEGIN_INPUT_LIST");
        inputPE.append(",dummyInput1");
        inputPE.append(",dummyInput2");
        inputPE.append(",END_INPUT_LIST");
        inputPE.append(",BEGIN_OUTPUT_LIST");
        inputPE.append(",dummyOutput1");
        inputPE.append(",dummyOutput2");
        inputPE.append(",END_OUTPUT_LIST");

        String rdfData = inputPE.toString();

        RDFUpdate rdfActivity = new RDFUpdate(rdfData);
        DeliverToRequestStatus deliverToRequestStatus = new DeliverToRequestStatus();

        TupleToWebRowSetCharArrays tupleToWebRowSet = new TupleToWebRowSetCharArrays();
        tupleToWebRowSet.connectDataInput(rdfActivity.getDataOutput());

        // Connect the output of RDFResource to DeliverToRequestStatus
        deliverToRequestStatus.connectInput(tupleToWebRowSet.getResultOutput());

        // Create the workflow
        PipelineWorkflow pipeline = new PipelineWorkflow();
        pipeline.add(rdfActivity);
        pipeline.add(tupleToWebRowSet);
        pipeline.add(deliverToRequestStatus);

        // Excecute the workflow
        RequestResource req = null;
        try
        {
            req = drer.execute(pipeline, RequestExecutionType.SYNCHRONOUS);
        }
        catch (RequestExecutionException e)
        {
            System.out.println("There was an error executing the workflow");
            System.out.println(e.getRequestResource().getRequestStatus());
View Full Code Here

        ResourceID drerId = new ResourceID("DataRequestExecutionResource");

        ServerProxy serverProxy = new ServerProxy();
        serverProxy.setDefaultBaseServicesURL(serverBaseUrl);

        DataRequestExecutionResource drer = serverProxy
                .getDataRequestExecutionResource(drerId);

        CreateDataSource createDataSource = new CreateDataSource();
        DeliverToRequestStatus deliverToRequestStatus = new DeliverToRequestStatus();
        deliverToRequestStatus.connectInput(createDataSource.getResultOutput());

        PipelineWorkflow createSourceWorkflow = new PipelineWorkflow();
        createSourceWorkflow.add(createDataSource);
        createSourceWorkflow.add(deliverToRequestStatus);

        drer.execute(createSourceWorkflow, RequestExecutionType.SYNCHRONOUS);

        ResourceID dataSourceID = createDataSource.nextResult();

        DataSourceResource dataSource = serverProxy
                .getDataSourceResource(dataSourceID);

        // String SPARQLquery = "PREFIX p: <http://dbpedia.org/property/> " +
        // "SELECT ?artist ?artwork ?museum ?director " +
        // "WHERE {" +
        // "   ?artwork p:artist ?artist ." +
        // "  ?artwork p:museum ?museum ." +
        // "   ?museum p:director ?director }";

        String SPARQLquery = "PREFIX p: <http://dbpedia.org/property/>"
                + " SELECT ?film1 ?actor1 ?film2 ?actor2 "
                + "WHERE     {"
                + "   ?film1 p:starring <http://dbpedia.org/resource/Kevin_Bacon> ."
                + "   ?film1 p:starring ?actor1 .   ?film2 p:starring ?actor1 ."
                + "   ?film2 p:starring ?actor2 .   }";

        RDFActivity rdfActivity = new RDFActivity(SPARQLquery);
//        rdfActivity.setResourceID("jorge");

        TupleToWebRowSetCharArrays tupleToWebRowSet = new TupleToWebRowSetCharArrays();
        tupleToWebRowSet.connectDataInput(rdfActivity.getDataOutput());

        WriteToDataSource writeToDataSource = new WriteToDataSource();
        writeToDataSource.setResourceID(dataSourceID);
        writeToDataSource.connectInput(tupleToWebRowSet.getResultOutput());

        // Connect the output of RDFResource to DeliverToRequestStatus

        PipelineWorkflow pipeline = new PipelineWorkflow();
        pipeline.add(rdfActivity);
        pipeline.add(tupleToWebRowSet);
        pipeline.add(writeToDataSource);

        RequestResource requestResource = drer.execute(pipeline,
                RequestExecutionType.ASYNCHRONOUS);
        requestResource.pollUntilRequestStarted(1000);

        // Get the data
        TupleToWebRowSetCharArrays tupleToWebRowSet2 = new TupleToWebRowSetCharArrays();
View Full Code Here

        ResourceID drerId = new ResourceID("DataRequestExecutionResource");

        ServerProxy serverProxy = new ServerProxy();
        serverProxy.setDefaultBaseServicesURL(serverBaseUrl);

        DataRequestExecutionResource drer = serverProxy
                .getDataRequestExecutionResource(drerId);

        // Create the activities
        String SPARQLquery;
        // SPARQLquery = "PREFIX p: <http://dbpedia.org/property/>" +
        // " SELECT ?film1 ?actor1 ?film2 ?actor2 " +
        // "WHERE     {" +
        // "   ?film1 p:starring <http://dbpedia.org/resource/Kevin_Bacon> ." +
        // "   ?film1 p:starring ?actor1 .   ?film2 p:starring ?actor1 ." +
        // "   ?film2 p:starring ?actor2 .   }";

        // SPARQLquery =
        // "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>            " +
        // "PREFIX type: <http://dbpedia.org/class/yago/>    " +
        // "PREFIX prop: <http://dbpedia.org/property/>    " +
        // "SELECT ?country_name ?population    " +
        // "WHERE {" +
        // "         ?country a type:LandlockedCountries ;" +
        // "                  rdfs:label ?country_name ;" +
        // "                  prop:populationEstimate ?population ." +
        // "FILTER (?population < 15000000) . }";

        SPARQLquery = "PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> "
                + "PREFIX foaf: <http://xmlns.com/foaf/0.1/> "
                + "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "
                + "PREFIX p: <http://dbpedia.org/property/> "
                + "SELECT ?s ?a ?homepage "
                +
                // "FROM <http://dbpedia.org>  " +
                "WHERE {"
                + "    <http://dbpedia.org/resource/New_York_City> geo:lat ?nyLat ."
                + "    <http://dbpedia.org/resource/New_York_City> geo:long ?nyLong ."
                + "    ?s geo:lat ?lat ."
                + "    ?s geo:long ?long ."
                + "    ?s p:architect ?a ."
                + "    ?a foaf:homepage ?homepage ."
                + "    FILTER (      ?lat        <=     ?nyLat + 0.3190235436 &&"
                + "      ?long       >=     ?nyLong - 0.8679199218 &&"
                + "      ?lat        >=     ?nyLat - 0.3190235436 &&"
                + "  ?long       <=     ?nyLong + 0.8679199218) }";

        SPARQLquery = "SELECT ?p ?o " +
        // "FROM <http://dbpedia.org> " +
                "WHERE {   <http://dbpedia.org/resource/Metropolitan_Museum_of_Art> ?p ?o }";

        SPARQLquery = "PREFIX p: <http://dbpedia.org/property/>          "
                + "SELECT ?artist ?artwork ?museum ?director         "
                + "WHERE {" + "            ?artwork p:artist ?artist ."
                + "            ?artwork p:museum ?museum ."
                + "            ?museum p:director ?director          }";


        // SPARQLquery =
        // "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " +
        // "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
        // "SELECT ?x ?name " +
        // "WHERE {" +
        // // "   ?x rdf:type foaf:Person ." +
        // "   ?x foaf:name ?name ." +
        // "    }";

        SPARQLquery = "PREFIX p: <http://dbpedia.org/property/>  "
                + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"
                + "SELECT * WHERE {"
                + "     ?album p:artist  <http://dbpedia.org/resource/The_Allman_Brothers_Band>."
                + "          OPTIONAL {?album p:released ?dateofrelease}.   }";

        SPARQLquery = "PREFIX mo: <http://purl.org/ontology/mo/>"
                + "PREFIX foaf:  <http://xmlns.com/foaf/0.1/> "
                + "SELECT ?a ?name ?hp " + "WHERE { "
                + "   ?a   foaf:name ?name ."
                + "  OPTIONAL { ?a foaf:homepage ?hp } " + "}";

        SPARQLquery = " SELECT  COUNT(*) "
                + "WHERE "
                + "  { ?player  <http://dbpedia.org/property/currentclub>  ?club .} ";
        // SPARQLquery =
        // "SELECT ?player ?club " +
        // "WHERE {" +
        // "  ?player <http://dbpedia.org/property/currentclub> ?club }";

        SPARQLquery = "SELECT  ?player "
                + "WHERE"
                + "   { ?player  <http://dbpedia.org/property/cityofbirth>  <http://dbpedia.org/resource/Stryn> .}";

        SPARQLquery = "SELECT  ?player ?club "
                + "WHERE"
                + "   { ?player  <http://dbpedia.org/property/currentclub>  ?club .}";

        SPARQLquery = "select * where { ?s ?p ?o . } LIMIT 1000 ";

        SPARQLquery = "PREFIX dmi: <http://www.admire-project.eu/ontologies/CRISP-DMIOntology.owl#> "
                + "SELECT DISTINCT * "
                + "WHERE {"
                + "   ?x dmi:hasStructuralType ?y ."
                + "   ?y dmi:hasInput ?z . "
                + "  ?y dmi:hasOutput ?k . } ORDER BY ?x ";

        SPARQLquery = "select * where {<http://bio2rdf.org/iproclass:Q8KD2> <http://bio2rdf.org/ns/iproclass#xGeneid> ?gene .}";

        SPARQLquery = "PREFIX dmi: <http://www.admire-project.eu/ontologies/CRISP-DMIOntology.owl#> "
            + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
            + "SELECT ?x ?y "
            + "WHERE {      ?x dmi:hasInput ?y .    "
            + "?y rdf:type dmi:SQLSentence .}";
       
        RDFActivity rdfActivity = new RDFActivity(SPARQLquery);
        DeliverToRequestStatus deliverToRequestStatus = new DeliverToRequestStatus();

        TupleToWebRowSetCharArrays tupleToWebRowSet = new TupleToWebRowSetCharArrays();
        tupleToWebRowSet.connectDataInput(rdfActivity.getDataOutput());

        // Connect the output of RDFResource to DeliverToRequestStatus
        deliverToRequestStatus.connectInput(tupleToWebRowSet.getResultOutput());

        // Create the workflow
        PipelineWorkflow pipeline = new PipelineWorkflow();
        pipeline.add(rdfActivity);
        pipeline.add(tupleToWebRowSet);
        pipeline.add(deliverToRequestStatus);

        // Excecute the workflow
        RequestResource req = null;
        try
        {
            req = drer.execute(pipeline, RequestExecutionType.SYNCHRONOUS);
        }
        catch (RequestExecutionException e)
        {
            System.out.println("There was an error executing the workflow");
            System.out.println(e.getRequestResource().getRequestStatus());
View Full Code Here

    public void addExecutionEngine(String name, String address)
    {
        try
        {
            JerseyServer server = new JerseyServer(address);
            DataRequestExecutionResource drer =
                server.getDataRequestExecutionResource(
                        new ResourceID("DataRequestExecutionResource"));
             
            //set EE details
            SimpleLocation location = new SimpleLocation(drer);
View Full Code Here

    public void addExecutionEngine(String name, String address) throws Exception
    {
        try
        {
            JerseyServer server = new JerseyServer(address);
            DataRequestExecutionResource drer =
                server.getDataRequestExecutionResource(
                        new ResourceID("DataRequestExecutionResource"));
                 
            SimpleLocation location = new SimpleLocation(address, drer);
            addExecutionEngine(name, location);
View Full Code Here

        }
        ResourceID drerID = new ResourceID(drerIDStr);
        ServerProxy server = new ServerProxy();
        server.setDefaultBaseServicesURL(new URL(url));
        // Get DRER
        DataRequestExecutionResource drer =
            server.getDataRequestExecutionResource(drerID);
       
        for (int i=0; i<10; i++)
        {
            executeRequest(server, drer);
View Full Code Here

        }
        ResourceID drerID = new ResourceID(drerIDStr);
        ServerProxy server = new ServerProxy();
        server.setDefaultBaseServicesURL(new URL(url));
        // Get DRER
        DataRequestExecutionResource drer =
            server.getDataRequestExecutionResource(drerID);
       
        final int NUM_TESTS = 100;
        for (int i=0; i<NUM_TESTS; i++)
        {
View Full Code Here

        }
        ResourceID drerID = new ResourceID(drerIDStr);
        ServerProxy server = new ServerProxy();
        server.setDefaultBaseServicesURL(new URL(url));
        // Get DRER
        DataRequestExecutionResource drer =
            server.getDataRequestExecutionResource(drerID);
       
        for (int i=0; i<10; i++)
        {
            // Execute.
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.client.toolkit.DataRequestExecutionResource

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.