Class BaseProtocolProcessor
Abstract Base class for SPARQL Graph Store HTTP Protocol for Graph Management implementations.
Implements
Namespace: VDS.RDF.Update.Protocol
Assembly: dotNetRdf.AspNet.dll
Syntax
public abstract class BaseProtocolProcessor : object, ISparqlHttpProtocolProcessor
Constructors
| Improve this Doc View SourceBaseProtocolProcessor(IUriFactory)
Initialise a new BaseProtocolProcessor instance.
Declaration
protected BaseProtocolProcessor(IUriFactory uriFactory = null)
Parameters
Type | Name | Description |
---|---|---|
IUriFactory | uriFactory | The factory object to use when creating URI instances. If not specified, defaults to Root. |
Fields
| Improve this Doc View SourceDefaultParameterPattern
This is the Pattern that is used to check whether ?default is present in the querystring. This is needed since IIS does not recognize ?default as being a valid querystring key unless it ends in a = which the specification does not mandate so cannot be assumed.
Declaration
public const string DefaultParameterPattern = null
Field Value
Type | Description |
---|---|
System.String |
UriFactory
Get the factory to use when creating / interning URI instances.
Declaration
protected readonly IUriFactory UriFactory
Field Value
Type | Description |
---|---|
IUriFactory |
Properties
| Improve this Doc View SourceDefaultCompressionLevel
Get or set the default compression to use when serializing a response using a writer that implements the ICompressingWriter interface.
Declaration
public int DefaultCompressionLevel { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceGetGraph(Uri)
Retrieves the Graph with the given URI.
Declaration
protected abstract IGraph GetGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | graphUri | Graph URI. |
Returns
Type | Description |
---|---|
IGraph |
Remarks
Helper method intended for use by the ProcessGet(IHttpContext) and ProcessHead(IHttpContext) methods.
HasGraph(Uri)
Determines whether a Graph with the given URI exists.
Declaration
protected abstract bool HasGraph(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | graphUri | Graph URI. |
Returns
Type | Description |
---|---|
System.Boolean |
MintGraphUri(IHttpContext, IGraph)
Generates a new Graph URI that should be used to create a new Graph in the Store in conjunction with the ProcessPostCreate(IHttpContext) operation.
Declaration
protected virtual Uri MintGraphUri(IHttpContext context, IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
IGraph | g | Graph parsed from the request body. |
Returns
Type | Description |
---|---|
Uri |
Remarks
Default behaviour is to mint a URI based on a hash of the Request IP and Date Time. Implementations can override this method to control URI creation as they desire.
ParsePayload(IHttpContext)
Gets the Graph which can be parsed from the request body.
Declaration
protected IGraph ParsePayload(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
Returns
Type | Description |
---|---|
IGraph |
Remarks
In the event that there is no request body a null will be returned.
ProcessDelete(IHttpContext)
Processes a DELETE operation.
Declaration
public abstract void ProcessDelete(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
ProcessGet(IHttpContext)
Processes a GET operation.
Declaration
public abstract void ProcessGet(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
ProcessHead(IHttpContext)
Processes a HEAD operation.
Declaration
public abstract void ProcessHead(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
ProcessPatch(IHttpContext)
Processes a PATCH operation.
Declaration
public abstract void ProcessPatch(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
ProcessPost(IHttpContext)
Processes a POST operation.
Declaration
public abstract void ProcessPost(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
ProcessPostCreate(IHttpContext)
Processes a POST operation which adds triples to a new Graph in the Store and returns the URI of the newly created Graph.
Declaration
public abstract void ProcessPostCreate(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
Remarks
This operation allows clients to POST data to an endpoint and have it create a Graph and assign a URI for them.
ProcessPut(IHttpContext)
Processes a PUT operation.
Declaration
public abstract void ProcessPut(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
ResolveGraphUri(IHttpContext)
Gets the Graph URI that the request should affect.
Declaration
protected Uri ResolveGraphUri(IHttpContext context)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
Returns
Type | Description |
---|---|
Uri |
ResolveGraphUri(IHttpContext, IGraph)
Gets the Graph URI that the request should affect.
Declaration
protected Uri ResolveGraphUri(IHttpContext context, IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
IGraph | g | Graph parsed from the request body. |
Returns
Type | Description |
---|---|
Uri |
Remarks
The Graph parameter may be null in which case the other overload of this method will be invoked.
SendResultsToClient(IHttpContext, IGraph)
Sends the given Graph to the Client via the HTTP Response.
Declaration
protected void SendResultsToClient(IHttpContext context, IGraph g)
Parameters
Type | Name | Description |
---|---|---|
IHttpContext | context | HTTP Context. |
IGraph | g | Graph to send. |