Denoting this session
fetchCallbacks[uri].push(callback)
Methods added by calling Util.callbackify in the constructor
Keep track of explicit 404s -> we can overwrite etc
Redirected from key uri to value uri
this.requested[uri] states: undefined no record of web access or records reset true has been requested, fetch in progress 'done' received, Ok 401 Not logged in 403 HTTP status unauthorized 404 Resource does not exist. Can be created etc. 'redirected' In attempt to counter CORS problems retried. 'parse_error' Parse error 'unsupported_protocol' URI is not a protocol Fetcher can deal with other strings mean various other errors.
List of timeouts associated with a requested URL
Static
CONTENT_Static
HANDLERSStatic
crossCreate an empty resource if it really does not exist Be absolutely sure something does not exist before creating a new empty file as otherwise existing could be deleted.
The resource
Optional
options: Partial<AutoInitOptions>Records errors in the system on failure:
Optional
response: ExtendedResponse(The promise chain ends in either a failFetch()
or a doneFetch()
)
{string}
{Object}
fetch() result or an { error, status } object
Looks up response header.
a list of header values found in a stored HTTP response, or [] if response was found but no header found, or undefined if no response is available. Looks for { [] link:requestedURI ?uri; link:response [ httph:header-name ?value ] }
Called when there's a network error in fetch(), or a response with status of 0.
Handle fetch() response
Promise-based load function
Loads a web resource or resources into the store.
A resource may be given as NamedNode object, or as a plain URI. an array of resources will be given, in which they will be fetched in parallel. By default, the HTTP headers are recorded also, in the same store, in a separate graph. This allows code like editable() for example to test things about the resource.
{Array
Optional
options: Partial<AutoInitOptions> = {}{Object}
Looks up something. Looks up all the URIs a things has.
canonical term for the thing whose URI is to be dereferenced
the resource which referred to this (for tracking bad links)
Asks for a doc to be loaded if necessary then calls back
Calling methods: nowOrWhenFetched (uri, userCallback) nowOrWhenFetched (uri, options, userCallback) nowOrWhenFetched (uri, referringTerm, userCallback, options) <-- old nowOrWhenFetched (uri, referringTerm, userCallback) <-- old
Options include: referringTerm The document in which this link was found. this is valuable when finding the source of bad URIs force boolean. Never mind whether you have tried before, load this from scratch. forceContentType Override the incoming header to force the data to be treated as this content-type.
Callback function takes:
ok True if the fetch worked, and got a 200 response. False if any error happened
errmessage Text error message if not OK.
response The fetch Response object (was: XHR) if there was was one includes response.status as the HTTP status if any.
Optional
p2: Partial<AutoInitOptions> | UserCallbackOptional
userCallback: UserCallbackWrites back to the web what we have in the store for this uri
Sends a new request to the specified uri. (Extracted from onerrorFactory()
)
A generic web operation, at the fetch() level. does not involve the quad store.
Returns promise of Response If data is returned, copies it to response.responseText before returning
Static
crossStatic
offlineStatic
proxyStatic
setDecide on credentials using old XXHR api or new fetch() one
Static
unsupported
Fetcher
The Fetcher object is a helper object for a quadstore which turns it from an offline store to an online store. The fetcher deals with loading data files rom the web,