@inrupt/solid-client
Version:
Make your web apps work with Solid Pods.
42 lines (41 loc) • 2.13 kB
TypeScript
/**
* Copyright 2020 Inrupt Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { BlankNode, Literal, NamedNode, Quad } from "rdf-js";
import { SolidDataset } from "./interfaces";
/**
* Get Quads matching the given Subject, Predicate, Object and/or Graph.
*
* Note: we only put the 'graph' component as the last param 'cos we don't yet
* assert much on quads in this codebase...
*
* @param dataset the RDF dataset to match against
* @param subject the subject to match (or null to represent a 'wildcard')
* @param predicate the predicate to match (or null to represent a 'wildcard')
* @param object the object to match (or null to represent a 'wildcard')
* @param graph the graph to match (or null to represent a 'wildcard')
* @return if only one matching quad found return that quad, else null
*/
export declare function getMatchingQuads(dataset: SolidDataset, pattern?: {
subject?: string | NamedNode | BlankNode;
predicate?: string | NamedNode;
object?: string | NamedNode | BlankNode | Literal;
graph?: null;
}): Quad[];