Author: fchrist
Date: Tue Aug 30 14:57:50 2011
New Revision: 1163246

URL: http://svn.apache.org/viewvc?rev=1163246&view=rev
Log:
STANBOL-244 Use HTTP POST to send queries, updated online documentation, added 
examples as JSON files

Added:
    
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/factschema.ftl
    
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example2.json
    
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example3.json
    
incubator/stanbol/trunk/factstore/src/test/resources/facts/query-spec-example1.json
    
incubator/stanbol/trunk/factstore/src/test/resources/factschemas/factschema-spec-example2.json
Modified:
    
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/FactsResource.java
    
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/QueryResource.java
    
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/index.ftl
    
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/factstore/FactStoreTest.java

Modified: 
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/FactsResource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/FactsResource.java?rev=1163246&r1=1163245&r2=1163246&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/FactsResource.java
 (original)
+++ 
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/FactsResource.java
 Tue Aug 30 14:57:50 2011
@@ -1,23 +1,23 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.stanbol.factstore.web.resource;
 
-import static javax.ws.rs.core.MediaType.TEXT_HTML;
-
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 import javax.servlet.ServletContext;
@@ -61,13 +61,13 @@ public class FactsResource extends BaseS
     @GET
     @Produces(MediaType.TEXT_HTML)
     public Response get() {
-        return Response.ok(new Viewable("index", this), TEXT_HTML).build();
+        return Response.ok(new Viewable("index", this), 
MediaType.TEXT_HTML).build();
     }
 
     @GET
     @Path("/{factSchemaURN}")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response getFactSchema(@PathParam("factSchemaURN") String 
factSchemaURN) {
+    public Response getFactSchemaAsJSON(@PathParam("factSchemaURN") String 
factSchemaURN) {
         Response validationResponse = standardValidation(factSchemaURN);
         if (validationResponse != null) {
             return validationResponse;
@@ -78,10 +78,35 @@ public class FactsResource extends BaseS
         FactSchema factSchema = this.factStore.getFactSchema(factSchemaURN);
         if (factSchema == null) {
             return Response.status(Status.NOT_FOUND).entity("Could not find 
fact schema " + factSchemaURN)
-                    .build();
+                    .type(MediaType.TEXT_PLAIN).build();
         }
 
-        return Response.ok(factSchema.toJsonLdProfile().toString()).build();
+        return Response.ok(factSchema.toJsonLdProfile().toString(), 
MediaType.APPLICATION_JSON).build();
+    }
+
+    @GET
+    @Path("/{factSchemaURN}")
+    @Produces(MediaType.TEXT_HTML)
+    public Response getFactSchemaAsHtml(@PathParam("factSchemaURN") String 
factSchemaURN) {
+        Response validationResponse = standardValidation(factSchemaURN);
+        if (validationResponse != null) {
+            return validationResponse;
+        }
+
+        logger.info("Request for getting existing fact schema {}", 
factSchemaURN);
+
+        FactSchema factSchema = this.factStore.getFactSchema(factSchemaURN);
+        if (factSchema == null) {
+            return Response.status(Status.NOT_FOUND).entity("Could not find 
fact schema " + factSchemaURN)
+                    .type(MediaType.TEXT_PLAIN).build();
+        }
+
+        Map<String, Object> model = new HashMap<String,Object>();
+        model.put("it", this);
+        model.put("factSchemaURN", factSchemaURN);
+        model.put("factschema", factSchema.toJsonLdProfile().toString(2));
+        
+        return Response.ok(new Viewable("factschema", model), 
MediaType.TEXT_HTML).build();
     }
 
     @PUT
@@ -103,17 +128,19 @@ public class FactsResource extends BaseS
 
         if (profile == null) {
             return Response.status(Status.BAD_REQUEST).entity(
-                "Could not parse provided JSON-LD Profile structure.").build();
+                "Could not parse provided JSON-LD Profile 
structure.").type(MediaType.TEXT_PLAIN).build();
         }
 
         try {
             if (this.factStore.existsFactSchema(factSchemaURN)) {
                 return Response.status(Status.CONFLICT).entity(
-                    "The fact schema " + factSchemaURN + " already 
exists.").build();
+                    "The fact schema " + factSchemaURN + " already 
exists.").type(MediaType.TEXT_PLAIN)
+                        .build();
             }
         } catch (Exception e) {
             return Response.status(Status.INTERNAL_SERVER_ERROR).entity(
-                "Error while checking existence of fact schema " + 
factSchemaURN).build();
+                "Error while checking existence of fact schema " + 
factSchemaURN).type(MediaType.TEXT_PLAIN)
+                    .build();
         }
 
         try {
@@ -121,10 +148,10 @@ public class FactsResource extends BaseS
         } catch (Exception e) {
             logger.error("Error creating new fact schema {}", factSchemaURN, 
e);
             return Response.status(Status.INTERNAL_SERVER_ERROR).entity(
-                "Error while creating new fact in database.").build();
+                "Error while creating new fact in 
database.").type(MediaType.TEXT_PLAIN).build();
         }
 
-        return Response.status(Status.CREATED).build();
+        return 
Response.status(Status.CREATED).type(MediaType.TEXT_PLAIN).build();
     }
 
     @POST
@@ -140,7 +167,7 @@ public class FactsResource extends BaseS
 
         if (jsonLd == null) {
             return Response.status(Status.BAD_REQUEST).entity("Could not parse 
provided JSON-LD structure.")
-                    .build();
+                    .type(MediaType.TEXT_PLAIN).build();
         }
 
         if (jsonLd.getResourceSubjects().size() < 2) {
@@ -152,12 +179,12 @@ public class FactsResource extends BaseS
                     this.factStore.addFact(fact);
                 } catch (Exception e) {
                     logger.error("Error adding new fact", e);
-                    return 
Response.status(Status.INTERNAL_SERVER_ERROR).entity(
-                        e.getMessage()).build();
+                    return 
Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(
+                        MediaType.TEXT_PLAIN).build();
                 }
             } else {
                 return Response.status(Status.BAD_REQUEST).entity(
-                    "Could not extract fact from JSON-LD input.").build();
+                    "Could not extract fact from JSON-LD 
input.").type(MediaType.TEXT_PLAIN).build();
             }
         } else {
             // post multiple facts
@@ -168,16 +195,16 @@ public class FactsResource extends BaseS
                     this.factStore.addFacts(facts);
                 } catch (Exception e) {
                     logger.error("Error adding new facts", e);
-                    return 
Response.status(Status.INTERNAL_SERVER_ERROR).entity(
-                        e.getMessage()).build();
+                    return 
Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(
+                        MediaType.TEXT_PLAIN).build();
                 }
             } else {
                 return Response.status(Status.BAD_REQUEST).entity(
-                    "Could not extract facts from JSON-LD input.").build();
+                    "Could not extract facts from JSON-LD 
input.").type(MediaType.TEXT_PLAIN).build();
             }
         }
 
-        return Response.status(Status.OK).build();
+        return Response.status(Status.OK).type(MediaType.TEXT_PLAIN).build();
     }
 
     private Response standardValidation(String factSchemaURN) {

Modified: 
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/QueryResource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/QueryResource.java?rev=1163246&r1=1163245&r2=1163246&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/QueryResource.java
 (original)
+++ 
incubator/stanbol/trunk/factstore/src/main/java/org/apache/stanbol/factstore/web/resource/QueryResource.java
 Tue Aug 30 14:57:50 2011
@@ -17,10 +17,10 @@
 package org.apache.stanbol.factstore.web.resource;
 
 import javax.servlet.ServletContext;
-import javax.ws.rs.GET;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
@@ -31,8 +31,8 @@ import org.apache.stanbol.commons.jsonld
 import org.apache.stanbol.commons.web.base.ContextHelper;
 import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
 import org.apache.stanbol.factstore.api.FactStore;
-import org.apache.stanbol.factstore.model.Query;
 import org.apache.stanbol.factstore.model.FactResultSet;
+import org.apache.stanbol.factstore.model.Query;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,24 +48,25 @@ public class QueryResource extends BaseS
                                context);
        }
 
-       @GET
+       @POST
+       @Consumes(MediaType.APPLICATION_JSON)
        @Produces(MediaType.APPLICATION_JSON)
-       public Response query(@QueryParam("q") String q) {
-        logger.info("Query for fact: {}", q);
+       public Response query(String queryString) {
+        logger.info("Query for fact: {}", queryString);
                
                if (this.factStore == null) {
                        return 
Response.status(Status.INTERNAL_SERVER_ERROR).entity(
                                        "The FactStore is not configured 
properly").build();
                }
 
-               if (q == null || q.isEmpty()) {
+               if (queryString == null || queryString.isEmpty()) {
                        return Response.status(Status.BAD_REQUEST).entity("No 
query sent.")
                                        .build();
                }
 
                JsonLd jsonLdQuery = null;
                try {
-                       jsonLdQuery = JsonLdParser.parse(q);
+                       jsonLdQuery = JsonLdParser.parse(queryString);
                } catch (Exception e) {
                        logger.info("Could not parse query", e);
                        return Response.status(Status.BAD_REQUEST).entity(

Added: 
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/factschema.ftl
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/factschema.ftl?rev=1163246&view=auto
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/factschema.ftl
 (added)
+++ 
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/factschema.ftl
 Tue Aug 30 14:57:50 2011
@@ -0,0 +1,25 @@
+<#--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<#import "facts_common.ftl" as common>
+<#escape x as x?html>
+<@common.page>
+
+<h4>Fact Schema: ${factSchemaURN}</h4>
+<pre>${factschema}</pre>
+
+</@common.page>
+</#escape>

Modified: 
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/index.ftl
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/index.ftl?rev=1163246&r1=1163245&r2=1163246&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/index.ftl
 (original)
+++ 
incubator/stanbol/trunk/factstore/src/main/resources/org/apache/stanbol/factstore/web/templates/org/apache/stanbol/factstore/web/resource/FactsResource/index.ftl
 Tue Aug 30 14:57:50 2011
@@ -22,6 +22,7 @@
        <li><a href="#Publish_a_New_Fact_Schema">Publish a New Fact 
Schema</a></li>
        <li><a href="#Get_Fact_Schema">Get Fact Schema</a></li>
        <li><a href="#Publish_New_Facts">Publish New Facts</a></li>
+       <li><a href="#Query_for_Facts_of_a_Certain_Type">Query for Facts of a 
Certain Type</a></li>
 </ul>
 
 <a name="Publish_a_New_Fact_Schema" 
id="Publish_a_New_Fact_Schema"></a><h4>Publish a New Fact Schema</h4>
@@ -57,7 +58,7 @@
        </tr>
        <tr>
                <th valign="top">Example 1:</th>
-               <td>PUT 
/factstore/facts/http%3A%2F%2Fwww.schema.org%2FEvent.attendees<br>
+               <td>PUT 
/factstore/facts/http%3A%2F%2Fiks-project.eu%2Font%2FemployeeOf<br>
                with the following data 
 <pre>{
  "@context" :
@@ -379,5 +380,74 @@ schema must exist before one can publish
 </table>
 </form>
 
+<a name="Query_for_Facts_of_a_Certain_Type" 
id="Query_for_Facts_of_a_Certain_Type"></a>
+<h4>Query for Facts of a Certain Type</h4>
+<table>
+       <tr>
+               <th valign="top">Description: </th>
+               <td>Allows clients to query stored facts of a specific type 
defined by the fact's schema. The clients
+               specify the desired fact plus an arbitrary number of entities 
that play some role in the fact. </td>
+       </tr>
+       <tr>
+               <th valign="top">Path: </th>
+               <td>/factstore/query</td>
+       </tr>
+       <tr>
+               <th valign="top">Method:</th>
+               <td>POST with data type application/json returns 
application/json.</td>
+       </tr>
+       <tr>
+               <th valign="top">Consumes:</th>
+               <td>application/json</td>
+       </tr>
+       <tr>
+               <th valign="top">Produces:</th>
+               <td>application/json</td>
+       </tr>   
+       <tr>
+               <th valign="top">Data:</th>
+               <td>The query is specified by a JSON-LD object in the payload 
of the request. The query defines a
+               "select" to specify the desired type of result to be returned 
in the result set. The "from" part
+               specifies the fact type to query and the "where" clause 
specifies constraints to be fulfilled.<br />
+               <br />
+           <i>Note</i>: For the moment constraints only support the equals "=" 
relation. There may be more
+           relations like ">" in future versions of this specification. If 
there is more than one constraint all
+           constraints are concatenated by "AND".</td>
+       </tr>
+       <tr>
+               <th valign="top">Example 1:</th>
+               <td>POST /factstore/query<br>
+               with the following data 
+<pre>{
+ "@context" : {
+   "iks" : "http://iks-project.eu/ont/";
+ },
+ "select" : [ "person" ],
+ "from"   : "iks:employeeOf",
+ "where"  : [
+   {
+     "="  : {
+       "organization" : { "@iri" : "http://uni-paderborn.de"; }
+     }
+   }
+ ]
+}</pre>
+               <p>returns the list of all persons participating in the fact of 
type
+               http://iks-project.eu/ont/employeeOf where the organization is 
http://uni-paderborn.de.</p>
+               <p>To send such a query via cURL, store the query in a JSON 
file and use this command:<p>
+<pre>curl -d @query-spec-example1.json -H "Content-Type: application/json" 
http://localhost:8080/factstore/query</pre>
+               <p>The result is sent back in JSON-LD format with the result 
set specified by the select clause.</p>
+<pre>{
+ "resultset": [
+   { "PERSON" : { "@iri" : "http://upb.de/persons/gengels"; } },
+   { "PERSON" : { "@iri" : "http://upb.de/persons/ssauer";  } },
+   { "PERSON" : { "@iri" : "http://upb.de/persons/bnagel";  } },
+   { "PERSON" : { "@iri" : "http://upb.de/persons/fchrist"; } }
+ ]
+}</pre>                
+               </td>
+       </tr>
+</table>
+
 </@common.page>
 </#escape>

Added: 
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example2.json
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example2.json?rev=1163246&view=auto
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example2.json
 (added)
+++ 
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example2.json
 Tue Aug 30 14:57:50 2011
@@ -0,0 +1,15 @@
+{
+ "@context" : {
+   "iks" : "http://iks-project.eu/ont/";,
+   "upb" : "http://upb.de/persons/";
+ },
+ "@profile"     : "iks:employeeOf",
+ "@" : [
+   { "person"       : { "@iri" : "upb:bnagel" },
+     "organization" : { "@iri" : "http://uni-paderborn.de"; }
+   },
+   { "person"       : { "@iri" : "upb:fchrist" },
+     "organization" : { "@iri" : "http://uni-paderborn.de"; }
+   }
+ ]
+}

Added: 
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example3.json
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example3.json?rev=1163246&view=auto
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example3.json
 (added)
+++ 
incubator/stanbol/trunk/factstore/src/test/resources/facts/fact-spec-example3.json
 Tue Aug 30 14:57:50 2011
@@ -0,0 +1,16 @@
+{
+ "@context" : {
+   "iks" : "http://iks-project.eu/ont/";,
+   "upb" : "http://upb.de/persons/";
+ },
+ "@" : [
+   { "@profile"     : "iks:employeeOf",
+     "person"       : { "@iri" : "upb:bnagel" },
+     "organization" : { "@iri" : "http://uni-paderborn.de"; }
+   },
+   { "@profile"     : "iks:friendOf",
+     "person"       : { "@iri" : "upb:bnagel" },
+     "friend"       : { "@iri" : "upb:fchrist" }
+   }
+ ]
+}

Added: 
incubator/stanbol/trunk/factstore/src/test/resources/facts/query-spec-example1.json
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/test/resources/facts/query-spec-example1.json?rev=1163246&view=auto
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/test/resources/facts/query-spec-example1.json
 (added)
+++ 
incubator/stanbol/trunk/factstore/src/test/resources/facts/query-spec-example1.json
 Tue Aug 30 14:57:50 2011
@@ -0,0 +1,15 @@
+{
+ "@context" : {
+   "iks" : "http://iks-project.eu/ont/";
+ },
+ "select" : [ "person" ],
+ "from"   : "iks:employeeOf",
+ "where"  : [
+   {
+     "="  : {
+       "organization" : { "@iri" : "http://uni-paderborn.de"; }
+     }
+   }
+ ]
+}
+

Added: 
incubator/stanbol/trunk/factstore/src/test/resources/factschemas/factschema-spec-example2.json
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/factstore/src/test/resources/factschemas/factschema-spec-example2.json?rev=1163246&view=auto
==============================================================================
--- 
incubator/stanbol/trunk/factstore/src/test/resources/factschemas/factschema-spec-example2.json
 (added)
+++ 
incubator/stanbol/trunk/factstore/src/test/resources/factschemas/factschema-spec-example2.json
 Tue Aug 30 14:57:50 2011
@@ -0,0 +1,11 @@
+{
+ "@context" :
+ {
+  "sorg"       : "http://www.schema.org/";,
+  "#types"     :
+  {
+    "event"    : "sorg:Event",
+    "attendee" : ["sorg:Person","sorg:Organization"]
+  }
+ }
+}

Modified: 
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/factstore/FactStoreTest.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/factstore/FactStoreTest.java?rev=1163246&r1=1163245&r2=1163246&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/factstore/FactStoreTest.java
 (original)
+++ 
incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/factstore/FactStoreTest.java
 Tue Aug 30 14:57:50 2011
@@ -294,11 +294,14 @@ public class FactStoreTest extends Stanb
         executor.execute(r2).assertStatus(200);
         
         String queryString = 
"{\"@context\":{\"iks\":\"http://iks-project.eu/ont/\"},\"select\":[\"person\"],\"from\":\"iks:employeeOf\",\"where\":[{\"=\":{\"organization\":{\"@iri\":\"http://upb.de\"}}}]}";;
-        Request q1 = builder.buildGetRequest("/factstore/query", "q", 
queryString)
+        Request q = builder
+        .buildOtherRequest(new HttpPost(builder.buildUrl("/factstore/query/")))
+        .withContent(queryString)
+        .withHeader("Content-Type", "application/json")
         .withHeader("Accept", "application/json");
-        
+                
         String expected = 
"{\"resultset\":[{\"PERSON\":\"http:\\/\\/upb.de\\/persons\\/bnagel\"}]}";
-        String actual = executor.execute(q1).assertStatus(200).getContent();
+        String actual = executor.execute(q).assertStatus(200).getContent();
         Assert.assertEquals(expected, actual);
     }
     


Reply via email to