Optional
options: Partial<AutoInitOptions>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
crossStatic
HANDLERSRecords a status message (as a literal node) by appending it to the request's metadata status collection.
DEPRECATED
URI of parent container
Optional folder name (slug)
Optional folder metadata
Create 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
contentType: "text/turtle"Optional
data: stringOptional
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
Tests whether a request is being made to a cross-site URI (for purposes of retrying with a proxy)
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}
{Function}
{RDFlibNamedNode} Referring term, the resource which referred to this (for tracking bad links)
{string} Provided content type (for writes)
{string} Override the incoming header to force the data to be treated as this content-type (for reads)
{boolean} Load the data even if loaded before.
Also sets the Cache-Control:
header to no-cache
{Node|string} Original uri to preserve
through proxying etc (xhr.original
).
{boolean} Whether this request is a retry via a proxy (generally done from an error handler)
{boolean} flag for XHR/CORS etc
{boolean} Before we parse new data, clear old, but only on status 200 responses
{boolean} Prevents the addition of various metadata triples (about the fetch request) to the store
{boolean}
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)
Note two nodes are now smushed If only one was flagged as looked up, then the new node is looked up again, which will make sure all the URIs are dereferenced
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: UserCallbackOptional
options: Partial<AutoInitOptions>Writes back to the web what we have in the store for this uri
Optional
options: Partial<AutoInitOptions>Sends a new request to the specified uri. (Extracted from onerrorFactory()
)
Optional
userCallback: UserCallbackA 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
Optional
options: Partial<AutoInitOptions>Static
crossStatic
offlineStatic
proxyStatic
setDecide on credentials using old XXHR api or new fetch() one
Optional
options: Partial<AutoInitOptions>Static
unsupportedTests whether the uri's protocol is supported by the Fetcher.
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,