Add all the quads in pattern, with any variables replaced by the value given for them in the bindings map. Handling of unbound variables is determined by the argument unbound, as in #quadbound.
(any)
(any)
(any)
Add all the properties (except "init") of each mixin. Add init, if it exists, to the the chain of things to call from the constructor.
Or, if it has a prototype, use that.
(...any)
Parse a string of trig/turtle/nquads using (and modifying) our current prefixes.
Array
:
The quads resulting from the parse
kb.parseTrig('x:s x:p 2.')
// =>
[]
Does the pattern quad "match" the data quad? Variables are simply treated as wildcards here, not real variables. Use unify() or solve() if you want real variable handling.
(any)
(any)
Convert a quad to a string representation in the NQuads format. Not called toNQuads because it's converting the argument, not "this".
(any)
Return a new quad, with any variables replace by the matching entry in bindings, or whatever unbound(term) returns if there's no matching entry. As special cases, 'pass' means just let them stay variables and 'skip' means return null instead of a quad. Default is to throw an error.
(any)
(any)
(any)
Set the two arguments to be "equal". We'll hide all but one of the an equated set of terms. We reveal the alphabetically first one, just to be deterministic. (Maybe have a way to override this?)
(any)
(any)
Given some JS value, return a Literal representing it
See also describe() which can handle values that result in multiple triples.
(any)
Watch for the next added quad that matches this pattern, then resolve with that quad.
(...any)
returns the array ['subject', 'predicate', 'object', 'graph'] for all the times you need it.
Line up two quads, one with variables, and see if if there's a binding of the variables that would make the quads equal. This is a classic function in computer science.
We make the Unique Names Assumption for NamedNodes but not BlankNodes, which are basically treated as variables. This allows something like destructuring, but might not always be what you're expecting.
(Quad)
the quad with variables
(Quad)
the quad without variables
(object)
maps varName => value, when already unified
boolean
:
can the two quads be unified? If true, also adds the necessary binding to
bindings
Almost the same as #solve, but calls kb.native() on the resulting values.
(...any)
Given a pattern of 1+ quads, generate all distinct bindings for the return-variables in the pattern, matching data in the kb.
Use #query if you want to receive native values (instead of RDF Literal objects).
(any)
(Object
= {}
)
Name | Description |
---|---|
options.bind Object
|
Pre-set bindings for any variables in the pattern |
options.select any
|
Array or string of names of the variables to return values for, otherwise whichever ones don't start with underscore |
options.returnArrays boolean
|
Flag requesting that return values are arrays [1,2] instead of objects {someVar:1, otherVar:2} |
options.limit int
|
Max number of distinct results returned, in order determined by underlying store |
Fetch content from URL and add the triples to the kb.
if options.graphName === true, then the url is used as the graphname. If it's truthy, its value is used. Otherwise, triples go in the default graph.
(any)
(any
= {}
)
Return the hash of this keyType. If necessary, create it!
(any)
return for example 'sg' if the subject and graphLabel are ruthy specifiedTerms. Variables are not specifiedTerms; there shouldn't be any variables in the store.
(any)
Return a string uniquely identifying the named parts of q, in that order
partNames is like spo, gp, gsop, ...
This is probably a good place to focus for performance improvements.
(any)
(any)