public class GSP extends StoreProtocol<GSP>
Client for the SPARQL 1.1 Graph Store Protocol.

This is extended to include operations GET, POST and PUT on datasets.

Examples:

   // Get the default graph.
   Graph graph = GSP.service("http://example/dataset").defaultGraph().GET();
 
   // Get a named graph.
   Graph graph = GSP.service("http://example/dataset").namedGraph("http://my/graph").GET();
 
   // POST (add) to a named graph.
   Graph myData = ...;
   GSP.service("http://example/dataset").namedGraph("http://my/graph").POST(myData);
 

See DSP for operations on datasets.

  • Method Summary

    Modifier and Type
    Method
    Description
    Send request for the default graph (that is, ?default)
    void
    Delete a graph.
    org.apache.jena.graph.Graph
    GET()
    Get a graph
    graphName(String graphName)
    Send request for a named graph (that is, ?graph=)
    graphName(org.apache.jena.graph.Node graphName)
    Send request for a named graph (that is, ?graph=)
    void
    POST(String file)
    POST the contents of a file using the filename extension to determine the Content-Type to use if it is not already set.
    void
    POST(org.apache.jena.graph.Graph graph)
    POST a graph.
    void
    PUT(String file)
    PUT the contents of a file using the filename extension to determine the Content-Type to use if it is not already set.
    void
    PUT(org.apache.jena.graph.Graph graph)
    PUT a graph.
    static GSP
    Create a request to the remote service (without GSP naming).
    static GSP
    service(String service)
    Create a request to the remote serviceURL (without a URL query string).

    Methods inherited from class org.apache.jena.sparql.exec.http.StoreProtocol

    accept, acceptHeader, contentType, contentTypeHeader, copySetup, endpoint, httpClient, httpHeader

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • service

      public static GSP service(String service)
      Create a request to the remote serviceURL (without a URL query string). Call defaultGraph() or graphName(String) to select the target graph. See DSP for dataset operations.
      Parameters:
      service -
    • request

      public static GSP request()
      Create a request to the remote service (without GSP naming). Call StoreProtocol.endpoint(java.lang.String) to set the target. Call defaultGraph() or graphName(String) to select the target graph. See DSP for dataset operations.
    • graphName

      public GSP graphName(String graphName)
      Send request for a named graph (that is, ?graph=)
    • graphName

      public GSP graphName(org.apache.jena.graph.Node graphName)
      Send request for a named graph (that is, ?graph=)
    • defaultGraph

      public GSP defaultGraph()
      Send request for the default graph (that is, ?default)
    • GET

      public org.apache.jena.graph.Graph GET()
      Get a graph
    • POST

      public void POST(String file)
      POST the contents of a file using the filename extension to determine the Content-Type to use if it is not already set.

      This operation does not parse the file.

      If the data may have quads (named graphs), use DSP.POST(String).

    • POST

      public void POST(org.apache.jena.graph.Graph graph)
      POST a graph.
    • PUT

      public void PUT(String file)
      PUT the contents of a file using the filename extension to determine the Content-Type to use if it is not already set.

      This operation does not parse the file.

      If the data may have quads (named graphs), use DSP.PUT(String).

    • PUT

      public void PUT(org.apache.jena.graph.Graph graph)
      PUT a graph.
    • DELETE

      public void DELETE()
      Delete a graph.