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 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(Node graphName)
      Send request for a named graph (that is, ?graph=)
    • defaultGraph

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

      @Deprecated public GSP dataset()
      Deprecated.
      Use DSP.
      Send request for the dataset. This is "no GSP naming".
    • GET

      public 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.

    • POST

      public void POST(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 putDataset(String).

    • PUT

      public void PUT(Graph graph)
      PUT a graph.
    • DELETE

      public void DELETE()
      Delete a graph.
    • getDataset

      @Deprecated public DatasetGraph getDataset()
      Deprecated.
    • postDataset

      @Deprecated public void postDataset(String file)
      Deprecated.
    • postDataset

      @Deprecated public void postDataset(DatasetGraph dataset)
      Deprecated.
    • putDataset

      @Deprecated public void putDataset(String file)
      Deprecated.
    • putDataset

      @Deprecated public void putDataset(DatasetGraph dataset)
      Deprecated.
    • clearDataset

      @Deprecated public void clearDataset()
      Deprecated.