diff --git a/package-lock.json b/package-lock.json index 15c2e8f..62d0894 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comake/skl-js-engine", - "version": "0.15.3", + "version": "0.15.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@comake/skl-js-engine", - "version": "0.15.3", + "version": "0.15.4", "license": "BSD-4-Clause", "dependencies": { "@comake/openapi-operation-executor": "^0.11.1", diff --git a/package.json b/package.json index 6be84e8..6d7b857 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@comake/skl-js-engine", - "version": "0.15.3", + "version": "0.15.4", "description": "Standard Knowledge Language Javascript Engine", "keywords": [ "skl", diff --git a/src/SklEngine.ts b/src/SklEngine.ts index ed36cd2..d2bbc03 100644 --- a/src/SklEngine.ts +++ b/src/SklEngine.ts @@ -38,6 +38,7 @@ import type { MappingWithParameterReference, RdfList, VerbConfig, + JSONObject, } from './util/Types'; import { convertJsonLdToQuads, @@ -45,7 +46,6 @@ import { getValueIfDefined, ensureArray, } from './util/Util'; -import type { JSONObject } from './util/Util'; import { SKL, SHACL, RDFS, SKL_ENGINE, XSD, RDF } from './util/Vocabularies'; export type VerbHandler = = OrArray>( @@ -290,7 +290,7 @@ export class SKLEngine { verbConfig?: VerbConfig, ): Promise> { const nextVerbMapping = list[0]; - const returnValue = await this.executeVerbFromVerbMapping(nextVerbMapping, args as JSONObject, verbConfig); + const returnValue = await this.executeVerbFromVerbMapping(nextVerbMapping, args, verbConfig); if (list.length > 1) { return await this.executeSeriesFromList( list.slice(1), diff --git a/src/mapping/Mapper.ts b/src/mapping/Mapper.ts index fc3da58..4da039f 100644 --- a/src/mapping/Mapper.ts +++ b/src/mapping/Mapper.ts @@ -2,8 +2,7 @@ import * as RmlParser from '@comake/rmlmapper-js'; import type { NodeObject } from 'jsonld'; import jsonld from 'jsonld'; -import type { OrArray } from '../util/Types'; -import type { JSONObject } from '../util/Util'; +import type { OrArray, JSONObject } from '../util/Types'; export interface MapperArgs { functions?: Record any>; diff --git a/src/storage/FindOptionsTypes.ts b/src/storage/FindOptionsTypes.ts index 1ce7307..0881fae 100644 --- a/src/storage/FindOptionsTypes.ts +++ b/src/storage/FindOptionsTypes.ts @@ -1,28 +1,27 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import type { OrArray } from '../util/Types'; -import type { JSONArray, JSONObject } from '../util/Util'; +import type { OrArray, JSONArray, JSONObject } from '../util/Types'; import type { FindOperator } from './FindOperator'; import type { InverseRelationOperatorValue } from './operator/InverseRelation'; import type { InverseRelationOrderValue } from './operator/InverseRelationOrder'; -export type FindOptionsSelectByString = string[]; - -export type FindOptionsRelationsByString = string[]; - -export type FindOptionsSelect = FindOptionsSelectByString | {[key: string]: boolean | FindOptionsSelect }; +export type FindOptionsSelect = string[] | {[key: string]: boolean | FindOptionsSelect }; export interface FindOneOptions { - search?: string; select?: FindOptionsSelect; where?: FindOptionsWhere; relations?: FindOptionsRelations; order?: FindOptionsOrder; - searchRelations?: boolean; skipFraming?: boolean; } +export type FindOptionsRelationsValue = | +boolean | +FindOptionsRelations | +FindOperator; + +// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style export type FindOptionsRelations = { - [k: string]: boolean | FindOptionsRelations | FindOperator; + [k: string]: FindOptionsRelationsValue; }; export type FindOptionsOrderValue = 'ASC' | 'DESC' | 'asc' | 'desc' | 1 | -1; @@ -48,15 +47,15 @@ export type NonJsonValueObject = { '@type': string; }; -export type ValueObject = +export type ValueWhereFieldObject = | JsonValueObject | LanguageValueObject | NonJsonValueObject; export type FindOptionsWhereField = | OrArray -| ValueObject -| Exclude +| ValueWhereFieldObject +| FindOptionsWhere | OrArray>; export type IdFindOptionsWhereField = @@ -79,17 +78,13 @@ export interface FindAllOptions extends FindOneOptions { } export interface FindExistsOptions { - search?: string; where?: FindOptionsWhere; relations?: FindOptionsRelations; - searchRelations?: boolean; } export interface FindCountOptions { - search?: string; where?: FindOptionsWhere; relations?: FindOptionsRelations; order?: FindOptionsOrder; offset?: number; - searchRelations?: boolean; } diff --git a/src/storage/QueryAdapter.ts b/src/storage/QueryAdapter.ts index fd9e34c..3748c09 100644 --- a/src/storage/QueryAdapter.ts +++ b/src/storage/QueryAdapter.ts @@ -26,13 +26,13 @@ export interface QueryAdapter { */ executeRawEntityQuery(query: string, frame?: Frame): Promise; /** - * Finds first entity by a given find options. - * If entity was not found in the database - returns null. + * Finds the first entity by a given find options. + * If entity was not found in the database it returns null. */ find(options?: FindOneOptions): Promise; /** - * Finds first entity that matches given where condition. - * If entity was not found in the database - returns null. + * Finds the first entity that matches given where condition. + * If entity was not found in the database it returns null. */ findBy(where: FindOptionsWhere): Promise; /** diff --git a/src/storage/memory/MemoryQueryAdapter.ts b/src/storage/memory/MemoryQueryAdapter.ts index 298f41e..7ae539f 100644 --- a/src/storage/memory/MemoryQueryAdapter.ts +++ b/src/storage/memory/MemoryQueryAdapter.ts @@ -4,8 +4,7 @@ import type { ReferenceNodeObject } from '@comake/rmlmapper-js'; import type { GraphObject } from 'jsonld'; import type { Frame } from 'jsonld/jsonld-spec'; import { toJSValueFromDataType } from '../../util/TripleUtil'; -import type { Entity, EntityFieldValue, PossibleArrayFieldValues } from '../../util/Types'; -import type { JSONObject, JSONArray } from '../../util/Util'; +import type { Entity, EntityFieldValue, PossibleArrayFieldValues, JSONObject, JSONArray } from '../../util/Types'; import { ensureArray } from '../../util/Util'; import { RDFS } from '../../util/Vocabularies'; import type { FindOperatorType } from '../FindOperator'; @@ -16,7 +15,7 @@ import type { FindOptionsWhere, FindOptionsWhereField, FieldPrimitiveValue, - ValueObject, + ValueWhereFieldObject, FindCountOptions, FindExistsOptions, } from '../FindOptionsTypes'; @@ -71,9 +70,6 @@ export class MemoryQueryAdapter implements QueryAdapter { } public async findAll(options?: FindAllOptions): Promise { - if (options?.search) { - return []; - } let results: Entity[] = []; if (options?.where?.id && Object.keys(options.where).length === 1 && typeof options.where.id === 'string') { const schema = this.schemas[options.where.id]; @@ -214,7 +210,7 @@ export class MemoryQueryAdapter implements QueryAdapter { if ((field as ReferenceNodeObject)['@id']) { return (field as ReferenceNodeObject)['@id'] === value; } - if ((field as ValueObject)['@value']) { + if ((field as ValueWhereFieldObject)['@value']) { const jsValue = toJSValueFromDataType( (field as any)['@value'], (field as any)['@type'], diff --git a/src/storage/sparql/SparqlQueryAdapter.ts b/src/storage/sparql/SparqlQueryAdapter.ts index 4103da1..79e8214 100644 --- a/src/storage/sparql/SparqlQueryAdapter.ts +++ b/src/storage/sparql/SparqlQueryAdapter.ts @@ -94,9 +94,6 @@ export class SparqlQueryAdapter implements QueryAdapter { } private async findAllAsJsonLd(options?: FindAllOptions): Promise> { - if (options?.search) { - return []; - } const queryBuilder = new SparqlQueryBuilder(); const { where, selectionTriples, entityOrder } = await this.buildFindAllQueryData(queryBuilder, options); if (entityOrder && entityOrder.length === 0) { diff --git a/src/storage/sparql/SparqlQueryBuilder.ts b/src/storage/sparql/SparqlQueryBuilder.ts index 0cf4ba7..5c3a592 100644 --- a/src/storage/sparql/SparqlQueryBuilder.ts +++ b/src/storage/sparql/SparqlQueryBuilder.ts @@ -56,7 +56,7 @@ import type { FindOptionsWhereField, IdFindOptionsWhereField, TypeFindOptionsWhereField, - ValueObject, + ValueWhereFieldObject, } from '../FindOptionsTypes'; import type { InverseRelationOperatorValue } from '../operator/InverseRelation'; import type { InverseRelationOrderValue } from '../operator/InverseRelationOrder'; @@ -341,7 +341,7 @@ export class SparqlQueryBuilder { } if (typeof value === 'object') { if ('@value' in value) { - return this.createWhereQueryDataForValueObject(subject, predicate, value as ValueObject); + return this.createWhereQueryDataForValueObject(subject, predicate, value as ValueWhereFieldObject); } return this.createWhereQueryDataForNestedWhere(subject, predicate, value as FindOptionsWhere); } @@ -499,7 +499,7 @@ export class SparqlQueryBuilder { private createWhereQueryDataForValueObject( subject: Variable, predicate: IriTerm | PropertyPath, - valueObject: ValueObject, + valueObject: ValueWhereFieldObject, ): WhereQueryData { const term = this.valueObjectToTerm(valueObject); return { @@ -512,7 +512,7 @@ export class SparqlQueryBuilder { }; } - private valueObjectToTerm(valueObject: ValueObject): Literal { + private valueObjectToTerm(valueObject: ValueWhereFieldObject): Literal { let typeOrLanguage: string; let value: string; if ('@type' in valueObject && valueObject['@type'] === '@json') { @@ -673,10 +673,10 @@ export class SparqlQueryBuilder { return createSparqlNotEqualOperation(leftSide, rightSide as Expression); } - private resolveValueToTerm(value: FieldPrimitiveValue | ValueObject): NamedNode | Literal { + private resolveValueToTerm(value: FieldPrimitiveValue | ValueWhereFieldObject): NamedNode | Literal { if (typeof value === 'object' && '@value' in value) { return valueToLiteral( - (value as ValueObject)['@value'], + (value as ValueWhereFieldObject)['@value'], '@type' in value ? value['@type'] : undefined, ); } diff --git a/src/util/SparqlUtil.ts b/src/util/SparqlUtil.ts index 1d940e0..e145215 100644 --- a/src/util/SparqlUtil.ts +++ b/src/util/SparqlUtil.ts @@ -32,7 +32,7 @@ import type { import type { RawQueryResult } from '../storage/QueryAdapter'; import type { SelectVariableQueryResult } from '../storage/sparql/SparqlQueryExecutor'; import { toJSValueFromDataType } from './TripleUtil'; -import { BDS, DCTERMS, RDF, RDFS } from './Vocabularies'; +import { DCTERMS, RDF, RDFS } from './Vocabularies'; export const rdfTypeNamedNode = DataFactory.namedNode(RDF.type); export const rdfsSubClassOfNamedNode = DataFactory.namedNode(RDFS.subClassOf); @@ -44,7 +44,6 @@ export const countVariable = DataFactory.variable('count'); export const now = DataFactory.variable('now'); export const created = DataFactory.namedNode(DCTERMS.created); export const modified = DataFactory.namedNode(DCTERMS.modified); -export const searchPredicate = DataFactory.namedNode(BDS.search); export const firstPredicate = DataFactory.namedNode(RDF.first); export const restPredicate = DataFactory.namedNode(RDF.rest); export const nilPredicate = DataFactory.namedNode(RDF.nil); diff --git a/src/util/TripleUtil.ts b/src/util/TripleUtil.ts index 65f6203..09e7a7e 100644 --- a/src/util/TripleUtil.ts +++ b/src/util/TripleUtil.ts @@ -7,8 +7,7 @@ import type { Frame } from 'jsonld/jsonld-spec'; import { FindOperator } from '../storage/FindOperator'; import type { FindOptionsRelations, FindOptionsWhere } from '../storage/FindOptionsTypes'; import type { InverseRelationOperatorValue } from '../storage/operator/InverseRelation'; -import type { OrArray } from './Types'; -import type { JSONArray, JSONObject } from './Util'; +import type { OrArray, JSONArray, JSONObject } from './Types'; import { ensureArray } from './Util'; import { RDF, XSD } from './Vocabularies'; diff --git a/src/util/Types.ts b/src/util/Types.ts index 5089ee5..a8f19d1 100644 --- a/src/util/Types.ts +++ b/src/util/Types.ts @@ -10,56 +10,175 @@ import type { NodeObject, SetObject, TypeMap, - ValueObject, } from 'jsonld'; import type { Callbacks } from '../Callbacks'; -import type { JSONObject } from './Util'; -import type { RDF, SKL } from './Vocabularies'; +import type { RDF, RDFS, SHACL, SKL } from './Vocabularies'; + +export type JSONPrimitive = + | string + | number + | boolean + | null; +// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style +export interface JSONObject { + [key: string]: JSONValue | undefined; +} +export interface JSONArray extends Array {} + +export type JSONValue = + | JSONPrimitive + | JSONObject + | JSONValue[]; export interface RdfList { [RDF.first]: T; [RDF.rest]?: RdfList | typeof RDF.nil | ReferenceNodeObject; } -export interface Verb extends NodeObject { +export interface ValueObject { + ['@type']: string; + ['@value']: T; + ['@language']?: string; + ['@direction']?: string; +} + +export type IRIObject = { '@id': T }; + +export type ShaclIRI = string | IRIObject; +export type ShaclIRIOrLiteral = ShaclIRI | ValueObject; + +export type NodeKindValues = +| typeof SHACL.Literal +| typeof SHACL.IRI +| typeof SHACL.BlankNode +| typeof SHACL.BlankNodeOrIRI +| typeof SHACL.BlankNodeOrLiteral +| typeof SHACL.IRIOrLiteral; + +export type BaseShape = NodeObject & { + [SHACL.targetNode]?: ShaclIRIOrLiteral; + [SHACL.targetClass]?: ShaclIRI; + [SHACL.targetSubjectsOf]?: ShaclIRI; + [SHACL.targetObjectOf]?: ShaclIRI; + [SHACL.severity]?: ShaclIRI; + [SHACL.message]?: OrArray>; + [SHACL.deactivated]?: ValueObject; + [SHACL.and]?: ShapesListShape; + [SHACL.class]?: OrArray; + [SHACL.closed]?: ValueObject; + [SHACL.ignoredProperties]?: ShaclIRI[]; + [SHACL.disjoint]?: OrArray; + [SHACL.equals]?: OrArray; + [SHACL.in]?: ListObject; + [SHACL.languageIn]?: string[]; + [SHACL.maxExclusive]?: ValueObject; + [SHACL.maxInclusive]?: ValueObject; + [SHACL.maxLength]?: ValueObject; + [SHACL.minExclusive]?: ValueObject; + [SHACL.minInclusive]?: ValueObject; + [SHACL.minLength]?: ValueObject; + [SHACL.nodeKind]?: IRIObject; + [SHACL.or]?: ShapesListShape; + [SHACL.pattern]?: ValueObject; + [SHACL.flags]?: ValueObject; + [SHACL.xone]?: ShapesListShape; +}; + +export type ShapesListShape = (PropertyShape | NodeShape)[]; + +export interface PropertyShape extends BaseShape { + [SHACL.path]: PathTypes; + [SHACL.datatype]?: ShaclIRI; + [SHACL.node]?: OrArray; + [SHACL.name]?: ValueObject; + [SHACL.description]?: ValueObject; + [SHACL.minCount]?: ValueObject; + [SHACL.maxCount]?: ValueObject; + [SHACL.lessThanOrEquals]?: OrArray; + [SHACL.lessThan]?: OrArray; + [SHACL.qualifiedValueShape]?: OrArray; + [SHACL.qualifiedMaxCount]?: ValueObject; + [SHACL.qualifiedMinCount]?: ValueObject; + [SHACL.qualifiedValueShapesDisjoint]?: ValueObject; + [SHACL.uniqueLang]?: ValueObject; +} + +export interface NodeShape extends BaseShape { + '@type': typeof SHACL.NodeShape; + [RDFS.label]?: ValueObject; + [SHACL.property]: OrArray; +} + +export interface InverseShaclPath extends NodeShape { + [SHACL.inversePath]: PathShape; +} + +export interface ZeroOrMoreShaclPath extends NodeShape { + [SHACL.zeroOrMorePath]: PathShape; +} + +export interface OneOrMoreShaclPath extends NodeShape { + [SHACL.oneOrMorePath]: PathShape; +} + +export interface ZeroOrOneShaclPath extends NodeShape { + [SHACL.zeroOrOnePath]: PathShape; +} + +export interface AlternativeShaclPath extends NodeShape { + [SHACL.alternativePath]: PathTypes[]; +} + +export type PathTypes = +| ShaclIRI +| AlternativeShaclPath +| ZeroOrMoreShaclPath +| OneOrMoreShaclPath +| ZeroOrOneShaclPath +| InverseShaclPath; + +export type PathShape = OrArray; + +export type Verb = NodeObject & { '@id': string; '@type': typeof SKL.Verb; - [SKL.parametersContext]?: ValueObject; + [SKL.parametersContext]?: ValueObject; + [SKL.parameters]?: NodeShape; [SKL.returnValue]?: NodeObject; - [SKL.returnValueFrame]?: ValueObject; + [SKL.returnValueFrame]?: ValueObject; [SKL.series]?: { '@list': VerbMapping[] } | (RdfList & NodeObject); [SKL.parallel]?: NodeObject; [SKL.returnValueMapping]?: OrArray; -} +}; export interface SeriesVerbArgs extends JSONObject { originalVerbParameters: JSONObject; previousVerbReturnValue: JSONObject; } -export interface MappingWithParameterMapping extends NodeObject { +export type MappingWithParameterMapping = NodeObject & { [SKL.parameterMapping]: OrArray; - [SKL.parameterMappingFrame]: NodeObject; -} + [SKL.parameterMappingFrame]: ValueObject; +}; -export interface MappingWithParameterReference extends NodeObject { - [SKL.parameterReference]: string | ValueObject; -} +export type MappingWithParameterReference = NodeObject & { + [SKL.parameterReference]: string | ValueObject; +}; -export interface MappingWithReturnValueMapping extends NodeObject { +export type MappingWithReturnValueMapping = NodeObject & { [SKL.returnValueMapping]: OrArray; - [SKL.returnValueFrame]: NodeObject; -} + [SKL.returnValueFrame]: ValueObject; +}; -export interface MappingWithVerbMapping extends NodeObject { - [SKL.verbId]?: ValueObject | string; +export type MappingWithVerbMapping = NodeObject & { + [SKL.verbId]?: ValueObject | string; [SKL.verbMapping]?: TriplesMap; -} +}; -export interface MappingWithOperationMapping extends NodeObject { - [SKL.constantOperationId]: ValueObject; +export type MappingWithOperationMapping = NodeObject & { + [SKL.constantOperationId]: ValueObject; [SKL.operationMapping]?: TriplesMap; -} +}; export interface VerbMapping extends MappingWithVerbMapping, @@ -98,7 +217,7 @@ export type PossibleArrayFieldValues = | string | NodeObject | GraphObject - | ValueObject + | ValueObject | ListObject | SetObject; @@ -108,7 +227,7 @@ export type EntityFieldSingularValue = | string | NodeObject | GraphObject - | ValueObject + | ValueObject | ListObject | SetObject; diff --git a/src/util/Util.ts b/src/util/Util.ts index 248f0ee..0a38151 100644 --- a/src/util/Util.ts +++ b/src/util/Util.ts @@ -1,20 +1,7 @@ import * as jsonld from 'jsonld'; import type { NodeObject, ValueObject } from 'jsonld'; import { Parser, Store } from 'n3'; -import type { EntityFieldSingularValue, EntityFieldValue } from './Types'; - -export type JSONPrimitive = - | string - | number - | boolean - | null; -export type JSONObject = Record; -export interface JSONArray extends Array {} - -export type JSONValue = - | JSONPrimitive - | {[x: string]: JSONValue } - | JSONValue[]; +import type { EntityFieldSingularValue, EntityFieldValue, JSONObject } from './Types'; export async function convertJsonLdToQuads(jsonldDoc: any): Promise { const nquads = await jsonld.toRDF(jsonldDoc, { format: 'application/n-quads' }) as unknown as string; diff --git a/src/util/Vocabularies.ts b/src/util/Vocabularies.ts index 4c0d83f..3c65789 100644 --- a/src/util/Vocabularies.ts +++ b/src/util/Vocabularies.ts @@ -145,8 +145,63 @@ export const OWL = createNamespace('http://www.w3.org/2002/07/owl#', [ ]); export const SHACL = createNamespace('http://www.w3.org/ns/shacl#', [ - 'targetClass', + 'NodeShape', + 'PropertyShape', + 'Literal', + 'IRI', + 'BlankNode', + 'BlankNodeOrIRI', + 'BlankNodeOrLiteral', + 'IRIOrLiteral', + 'property', + 'path', + 'name', + 'description', + 'minCount', + 'maxCount', 'targetNode', + 'targetClass', + 'targetSubjectsOf', + 'targetObjectOf', + 'severity', + 'message', + 'deactivated', + 'and', + 'or', + 'class', + 'closed', + 'ignoredProperties', + 'datatype', + 'disjoint', + 'equals', + 'in', + 'languageIn', + 'lessThan', + 'lessThanOrEquals', + 'maxCount', + 'maxExclusive', + 'maxInclusive', + 'maxLength', + 'minCount', + 'minExclusive', + 'minInclusive', + 'minLength', + 'nodeKind', + 'pattern', + 'flags', + 'qualifiedMaxCount', + 'qualifiedMinCount', + 'qualifiedValueShape', + 'qualifiedValueShapesDisjoint', + 'uniqueLang', + 'xone', + 'inversePath', + 'zeroOrMorePath', + 'oneOrMorePath', + 'zeroOrOnePath', + 'alternativePath', + 'name', + 'node', ]); export const SCHEMA = createNamespace('https://schema.org/', [ @@ -157,7 +212,3 @@ export const DCTERMS = createNamespace('http://purl.org/dc/terms/', [ 'created', 'modified', ]); - -export const BDS = createNamespace('http://www.bigdata.com/rdf/search#', [ - 'search', -]); diff --git a/test/deploy/package.json b/test/deploy/package.json index c37abf2..2c952b5 100644 --- a/test/deploy/package.json +++ b/test/deploy/package.json @@ -7,7 +7,7 @@ }, "main": "./dist/index.js", "dependencies": { - "@comake/skl-js-engine": "file:./comake-skl-js-engine-0.15.3.tgz", + "@comake/skl-js-engine": "file:./comake-skl-js-engine-0.15.4.tgz", "jsonld": "^6.0.0" }, "devDependencies": { diff --git a/test/unit/storage/memory/MemoryQueryAdapter.test.ts b/test/unit/storage/memory/MemoryQueryAdapter.test.ts index 3cdeda8..ac96751 100644 --- a/test/unit/storage/memory/MemoryQueryAdapter.test.ts +++ b/test/unit/storage/memory/MemoryQueryAdapter.test.ts @@ -793,22 +793,6 @@ describe('a MemoryQueryAdapter', (): void => { }, })).resolves.toEqual([]); }); - - it('does not support search.', async(): Promise => { - schemas = [ - { - '@id': 'https://example.com/data/2', - '@type': 'https://standardknowledge.com/ontologies/core/File', - 'https://example.com/name': [ - { '@value': 'hello world', '@type': XSD.string }, - ], - }, - ]; - adapter = new MemoryQueryAdapter({ type: 'memory', schemas }); - await expect(adapter.findAll({ - search: 'hello world', - })).resolves.toEqual([]); - }); }); describe('findAllBy', (): void => { diff --git a/test/unit/storage/sparql/SparqlQueryAdapter.test.ts b/test/unit/storage/sparql/SparqlQueryAdapter.test.ts index f2cdf0d..7ab9101 100644 --- a/test/unit/storage/sparql/SparqlQueryAdapter.test.ts +++ b/test/unit/storage/sparql/SparqlQueryAdapter.test.ts @@ -621,19 +621,6 @@ describe('a SparqlQueryAdapter', (): void => { ]); }); - it('does not support search.', - async(): Promise => { - select.mockImplementationOnce( - async(): Promise => streamFrom([]), - ); - await expect( - adapter.findAll({ - search: 'hello world', - }), - ).resolves.toEqual([]); - expect(select).toHaveBeenCalledTimes(0); - }); - it('returns unframed json-ld if skipFraming is set to true.', async(): Promise => { const blankNode = DataFactory.blankNode('c1');