Package org.apache.marmotta.client.clients

Examples of org.apache.marmotta.client.clients.SPARQLClient


        marmotta.shutdown();
    }

    @Test
    public void testSparqlSelect() throws Exception {
        SPARQLClient client = new SPARQLClient(config);

        SPARQLResult result = client.select("SELECT ?r ?n WHERE { ?r <http://xmlns.com/foaf/0.1/name> ?n }");
        Assert.assertEquals(3, result.size());
        Assert.assertThat(result, (Matcher) hasItems(hasKey("r"), hasKey("n")));
        Assert.assertThat(result,(Matcher)hasItem(hasValue(hasProperty("content", equalTo("Sepp Huber")))));
    }
View Full Code Here


        Assert.assertThat(result,(Matcher)hasItem(hasValue(hasProperty("content", equalTo("Sepp Huber")))));
    }

    @Test
    public void testSparqlAsk() throws Exception {
        SPARQLClient client = new SPARQLClient(config);

        boolean result = client.ask("ASK { ?r <http://xmlns.com/foaf/0.1/name> ?n }");
        Assert.assertTrue(result);

    }
View Full Code Here

    }
   
    @Test
    public void testSparqlUpdate() throws Exception {
        SPARQLClient client = new SPARQLClient(config);

        try {
          client.update(
              "INSERT DATA { \n" +
              "    <http://www.dajobe.org/foaf.rdf#i> <http://purl.org/dc/elements/1.1/date> \"1999-04-01T00:00:00\" . \n" +
              "    <http://www.w3.org/People/Berners-Lee/card#i> <http://purl.org/dc/elements/1.1/date> \"1998-05-03T00:00:00\" .  \n" +
              "    <http://www.w3.org/People/Connolly/#me> <http://purl.org/dc/elements/1.1/date> \"2001-02-08T00:00:00\"  \n" +
              "}");
View Full Code Here

        }
    }
   
    @Test
    public void testSparqlUpdateGraph() throws Exception {
        SPARQLClient client = new SPARQLClient(config);

        try {
          client.update(
              "INSERT DATA { \n" +
              "  GRAPH <http://BookStore.com> {  \n" +
              "    <http://www.dajobe.org/foaf.rdf#i> <http://purl.org/dc/elements/1.1/date> \"1999-04-01T00:00:00\" . \n" +
              "    <http://www.w3.org/People/Berners-Lee/card#i> <http://purl.org/dc/elements/1.1/date> \"1998-05-03T00:00:00\" .  \n" +
              "    <http://www.w3.org/People/Connolly/#me> <http://purl.org/dc/elements/1.1/date> \"2001-02-08T00:00:00\"  \n" +
View Full Code Here

    /**
     * Return a client that allows executing SPARQL 1.1 queries and updates on the Marmotta Server.
     * @return
     */
    public SPARQLClient getSPARQLClient() {
        return new SPARQLClient(config);
    }
View Full Code Here

    /**
     * Return a client that allows executing SPARQL 1.1 queries and updates on the Marmotta Server.
     * @return
     */
    public SPARQLClient getSPARQLClient() {
        return new SPARQLClient(config);
    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.client.clients.SPARQLClient

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.