Show / Hide Table of Contents

Interface IUriLoaderCache

Interface for Caches that can be used to cache the result of loading Graphs from URIs.

Namespace: VDS.RDF.Parsing
Assembly: dotNetRdf.dll
Syntax
public interface IUriLoaderCache
Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

Properties

| Improve this Doc View Source

CacheDirectory

Gets/Sets the Cache Directory that is in use.

Declaration
string CacheDirectory { get; set; }
Property Value
Type Description
string
Remarks

Non-filesystem based caches are free to return String.Empty or null but MUST NOT throw any form or error.

| Improve this Doc View Source

CacheDuration

Gets/Sets how long results should be cached.

Declaration
TimeSpan CacheDuration { get; set; }
Property Value
Type Description
System.TimeSpan
Remarks

This only applies to downloaded URIs where an ETag is not available, where ETags are available ETag based caching SHOULD be used.

Methods

| Improve this Doc View Source

Clear()

Clears the Cache.

Declaration
void Clear()
Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

| Improve this Doc View Source

GetETag(Uri)

Gets the ETag for the given URI.

Declaration
string GetETag(Uri u)
Parameters
Type Name Description
System.Uri u

URI.

Returns
Type Description
string
Remarks

Calling code MUST always use the HasETag() method prior to using this method so it should be safe to throw the KeyNotFoundException if there is no ETag for the given URI.

Exceptions
Type Condition
System.Collections.Generic.KeyNotFoundException

Thrown if there is no ETag for the given URI.

| Improve this Doc View Source

GetLocalCopy(Uri)

Gets the path to the locally cached copy of the Graph from the given URI.

Declaration
string GetLocalCopy(Uri u)
Parameters
Type Name Description
System.Uri u

URI.

Returns
Type Description
string
Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

| Improve this Doc View Source

HasETag(Uri)

Gets whether there is an ETag for the given URI.

Declaration
bool HasETag(Uri u)
Parameters
Type Name Description
System.Uri u

URI.

Returns
Type Description
System.Boolean
Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

| Improve this Doc View Source

HasLocalCopy(Uri, bool)

Is there a locally cached copy of the Graph from the given URI which is not expired.

Declaration
bool HasLocalCopy(Uri u, bool requireFreshness)
Parameters
Type Name Description
System.Uri u

URI.

System.Boolean requireFreshness

Whether the local copy is required to meet the Cache Freshness (set by the Cache Duration).

Returns
Type Description
System.Boolean
Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

| Improve this Doc View Source

RemoveETag(Uri)

Remove the ETag record for the given URI.

Declaration
void RemoveETag(Uri u)
Parameters
Type Name Description
System.Uri u

URI.

Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

| Improve this Doc View Source

RemoveLocalCopy(Uri)

Removes a locally cached copy of a URIs results from the Cache.

Declaration
void RemoveLocalCopy(Uri u)
Parameters
Type Name Description
System.Uri u

URI.

Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

| Improve this Doc View Source

ToCache(Uri, Uri, string)

Associates an ETag (if any) with the Request and Response URIs plus returns an IRdfHandler that can be used to write to the cache.

Declaration
IRdfHandler ToCache(Uri requestUri, Uri responseUri, string etag)
Parameters
Type Name Description
System.Uri requestUri

URI from which the RDF Graph was requested.

System.Uri responseUri

The actual URI which responded to the request.

string etag

ETag of the response (if any).

Returns
Type Description
IRdfHandler

Either an instance of an IRdfHandler that will do the caching or null if no caching is possible.

Remarks

Warning: Only available in Builds for which caching is supported e.g. not supported under Silverlight.

Implementors should take care to implement their caches such that any errors in the cache do not bubble up outside of the cache. If the cache encounters any error when caching data or retrieving data from the cache it should indicate that the cached data is not available.

Extension Methods

Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Properties
    • CacheDirectory
    • CacheDuration
  • Methods
    • Clear()
    • GetETag(Uri)
    • GetLocalCopy(Uri)
    • HasETag(Uri)
    • HasLocalCopy(Uri, bool)
    • RemoveETag(Uri)
    • RemoveLocalCopy(Uri)
    • ToCache(Uri, Uri, string)
  • Extension Methods
Back to top Generated by DocFX