@comunica/types
Advanced tools
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
| /** | ||
| * A cache policy represents the policy under which certain data can be cached. | ||
| * This is a generalization of the CachePolicy interface from the http-cache-semantics npm package. | ||
| * @param <I> The type of input request this policy applies to. | ||
| */ | ||
| export interface ICachePolicy<I> { | ||
| /** | ||
| * Returns true if the response can be stored in a cache. | ||
| * If it's false then you MUST NOT store either the request or the response. | ||
| */ | ||
| storable: () => boolean; | ||
| /** | ||
| * This is the most important method. Use this method to check whether a cached response is still fresh in the | ||
| * context of the new request. | ||
| * | ||
| * If it returns true, then the given request matches the original response this cache policy has been created with, | ||
| * and the response can be reused without contacting the server. Note that the old response can't be returned without | ||
| * being updated, see responseHeaders(). | ||
| * | ||
| * If it returns false, then the response may not be matching at all (e.g. it's for a different URL or method), | ||
| * or may require to be refreshed first (see revalidationHeaders()). | ||
| * | ||
| * @param input The new input request. | ||
| */ | ||
| satisfiesWithoutRevalidation: (input: I) => Promise<boolean>; | ||
| /** | ||
| * Returns updated, filtered set of response headers to return to clients receiving the cached response. | ||
| * This function is necessary, because proxies MUST always remove hop-by-hop headers (such as TE and Connection) and | ||
| * update response's Age to avoid doubling cache time. | ||
| * Example: | ||
| * `cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse);` | ||
| */ | ||
| responseHeaders: () => Headers; | ||
| /** | ||
| * Returns approximate time in milliseconds until the response becomes stale (i.e. not fresh). | ||
| * | ||
| * After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However, | ||
| * there are exceptions, e.g. a client can explicitly allow stale responses, so always check with | ||
| * `satisfiesWithoutRevalidation()`. | ||
| */ | ||
| timeToLive: () => number; | ||
| /** | ||
| * Returns updated, filtered set of request headers to send to the origin server to check if the cached | ||
| * response can be reused. These headers allow the origin server to return status 304 indicating the | ||
| * response is still fresh. All headers unrelated to caching are passed through as-is. | ||
| * | ||
| * Use this method when updating cache from the origin server. | ||
| * | ||
| * @example | ||
| * updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest); | ||
| */ | ||
| revalidationHeaders: (newInput: I) => Promise<Headers>; | ||
| /** | ||
| * Use this method to update the cache after receiving a new response from the origin server. | ||
| */ | ||
| revalidatedPolicy: (revalidationInput: I, revalidationResponse: ICacheResponseHead) => Promise<IRevalidationPolicy<I>>; | ||
| } | ||
| export interface IRevalidationPolicy<I> { | ||
| /** | ||
| * A new `ICachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace | ||
| * the old cached `ICachePolicy` with the new one. | ||
| */ | ||
| policy: ICachePolicy<I>; | ||
| /** | ||
| * Boolean indicating whether the response body has changed. | ||
| * | ||
| * - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old | ||
| * cached response body. | ||
| * - If `true`, you should use new response's body (if present), or make another request to the origin | ||
| * server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get | ||
| * the new resource. | ||
| */ | ||
| modified: boolean; | ||
| matches: boolean; | ||
| } | ||
| export interface ICacheResponseHead { | ||
| /** | ||
| * The HTTP status code. | ||
| */ | ||
| status: number; | ||
| /** | ||
| * The returned headers of the final URL. | ||
| */ | ||
| headers?: Headers; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=ICachePolicy.js.map |
| {"version":3,"file":"ICachePolicy.js","sourceRoot":"","sources":["ICachePolicy.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A cache policy represents the policy under which certain data can be cached.\n * This is a generalization of the CachePolicy interface from the http-cache-semantics npm package.\n * @param <I> The type of input request this policy applies to.\n */\nexport interface ICachePolicy<I> {\n /**\n * Returns true if the response can be stored in a cache.\n * If it's false then you MUST NOT store either the request or the response.\n */\n storable: () => boolean;\n\n /**\n * This is the most important method. Use this method to check whether a cached response is still fresh in the\n * context of the new request.\n *\n * If it returns true, then the given request matches the original response this cache policy has been created with,\n * and the response can be reused without contacting the server. Note that the old response can't be returned without\n * being updated, see responseHeaders().\n *\n * If it returns false, then the response may not be matching at all (e.g. it's for a different URL or method),\n * or may require to be refreshed first (see revalidationHeaders()).\n *\n * @param input The new input request.\n */\n satisfiesWithoutRevalidation: (input: I) => Promise<boolean>;\n\n /**\n * Returns updated, filtered set of response headers to return to clients receiving the cached response.\n * This function is necessary, because proxies MUST always remove hop-by-hop headers (such as TE and Connection) and\n * update response's Age to avoid doubling cache time.\n * Example:\n * `cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse);`\n */\n responseHeaders: () => Headers;\n\n /**\n * Returns approximate time in milliseconds until the response becomes stale (i.e. not fresh).\n *\n * After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However,\n * there are exceptions, e.g. a client can explicitly allow stale responses, so always check with\n * `satisfiesWithoutRevalidation()`.\n */\n timeToLive: () => number;\n\n /**\n * Returns updated, filtered set of request headers to send to the origin server to check if the cached\n * response can be reused. These headers allow the origin server to return status 304 indicating the\n * response is still fresh. All headers unrelated to caching are passed through as-is.\n *\n * Use this method when updating cache from the origin server.\n *\n * @example\n * updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest);\n */\n revalidationHeaders: (newInput: I) => Promise<Headers>;\n\n /**\n * Use this method to update the cache after receiving a new response from the origin server.\n */\n revalidatedPolicy: (\n revalidationInput: I,\n revalidationResponse: ICacheResponseHead,\n ) => Promise<IRevalidationPolicy<I>>;\n}\n\nexport interface IRevalidationPolicy<I> {\n /**\n * A new `ICachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace\n * the old cached `ICachePolicy` with the new one.\n */\n policy: ICachePolicy<I>;\n /**\n * Boolean indicating whether the response body has changed.\n *\n * - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old\n * cached response body.\n * - If `true`, you should use new response's body (if present), or make another request to the origin\n * server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get\n * the new resource.\n */\n modified: boolean;\n matches: boolean;\n}\n\nexport interface ICacheResponseHead {\n /**\n * The HTTP status code.\n */\n status: number;\n /**\n * The returned headers of the final URL.\n */\n headers?: Headers;\n}\n"]} |
| import type { ILink } from './ILink'; | ||
| /** | ||
| * A datastructure that accepts links, and emits them in an implementation-defined order. | ||
| */ | ||
| export interface ILinkQueue { | ||
| /** | ||
| * Add the given link to the queue. | ||
| * @param link A link. | ||
| * @param parent The parent in which the given link was discovered. | ||
| * @returns If the link was added to the queue. | ||
| */ | ||
| push: (link: ILink, parent?: ILink) => boolean; | ||
| /** | ||
| * The number of links in the queue. | ||
| */ | ||
| getSize: () => number; | ||
| /** | ||
| * If no links are in the queue. | ||
| */ | ||
| isEmpty: () => boolean; | ||
| /** | ||
| * Get and remove the next link from the queue. | ||
| */ | ||
| pop: () => ILink | undefined; | ||
| /** | ||
| * Get (but not remove) the next link from the queue. | ||
| */ | ||
| peek: () => ILink | undefined; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=ILinkQueue.js.map |
| {"version":3,"file":"ILinkQueue.js","sourceRoot":"","sources":["ILinkQueue.ts"],"names":[],"mappings":"","sourcesContent":["import type { ILink } from './ILink';\n\n/**\n * A datastructure that accepts links, and emits them in an implementation-defined order.\n */\nexport interface ILinkQueue {\n /**\n * Add the given link to the queue.\n * @param link A link.\n * @param parent The parent in which the given link was discovered.\n * @returns If the link was added to the queue.\n */\n push: (link: ILink, parent?: ILink) => boolean;\n /**\n * The number of links in the queue.\n */\n getSize: () => number;\n /**\n * If no links are in the queue.\n */\n isEmpty: () => boolean;\n /**\n * Get and remove the next link from the queue.\n */\n pop: () => ILink | undefined;\n /**\n * Get (but not remove) the next link from the queue.\n */\n peek: () => ILink | undefined;\n}\n"]} |
@@ -0,4 +1,4 @@ | ||
| import type { Algebra } from '@comunica/utils-algebra'; | ||
| import type * as RDF from '@rdfjs/types'; | ||
| import type { LRUCache } from 'lru-cache'; | ||
| import type { Algebra } from 'sparqlalgebrajs'; | ||
| import type { ComunicaDataFactory } from './ComunicaDataFactory'; | ||
@@ -5,0 +5,0 @@ import type { IActionContext } from './IActionContext'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ExpressionEvaluator.js","sourceRoot":"","sources":["ExpressionEvaluator.ts"],"names":[],"mappings":";;;AAkFA,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,uCAAqB,CAAA;AACvB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { LRUCache } from 'lru-cache';\nimport type { Algebra } from 'sparqlalgebrajs';\nimport type { ComunicaDataFactory } from './ComunicaDataFactory';\nimport type { IActionContext } from './IActionContext';\n\nexport interface ITimeZoneRepresentation {\n // https://www.w3.org/TR/xpath-functions/#func-implicit-timezone\n // Type is a dayTimeDuration.\n // We use a separate dataType since it makes TS type modifications and JS object copying easier.\n zoneHours: number;\n zoneMinutes: number;\n}\n\nexport interface IDateRepresentation extends Partial<ITimeZoneRepresentation> {\n year: number;\n month: number;\n day: number;\n}\n\nexport interface ITimeRepresentation extends Partial<ITimeZoneRepresentation> {\n hours: number;\n minutes: number;\n seconds: number;\n}\n\nexport interface IDayTimeDurationRepresentation {\n hours: number;\n minutes: number;\n seconds: number;\n day: number;\n}\n\nexport interface IYearMonthDurationRepresentation {\n year: number;\n month: number;\n}\n\nexport type IDurationRepresentation = IYearMonthDurationRepresentation & IDayTimeDurationRepresentation;\nexport type IDateTimeRepresentation = IDateRepresentation & ITimeRepresentation;\nexport type AsyncExtensionFunction = (args: RDF.Term[]) => Promise<RDF.Term>;\nexport type AsyncExtensionFunctionCreator = (functionNamedNode: RDF.NamedNode) =>\nPromise<AsyncExtensionFunction | undefined>;\n\n/**\n * The key 'term' is not included in these keys. Something that is just a term will map to number 0.\n */\nexport type GeneralSuperTypeDict = Record<string, number> & { __depth: number };\nexport type TypeCache = LRUCache<string, GeneralSuperTypeDict>;\nexport type SuperTypeCallback = (unknownType: string) => string;\n\nexport interface ISuperTypeProvider {\n cache: TypeCache;\n discoverer: SuperTypeCallback;\n}\n\n/**\n * An evaluator for RDF expressions.\n */\nexport interface IExpressionEvaluator extends IInternalEvaluator {\n /**\n * Evaluates the provided bindings in terms of the context the evaluator was created.\n * @param mapping the RDF bindings to evaluate against.\n */\n evaluate: (mapping: RDF.Bindings) => Promise<RDF.Term>;\n\n /**\n * Evaluates the provided bindings in terms of the context the evaluator was created,\n * returning the effective boolean value.\n * @param mapping the RDF bindings to evaluate against.\n */\n evaluateAsEBV: (mapping: RDF.Bindings) => Promise<boolean>;\n\n evaluateAsEvaluatorExpression: (mapping: RDF.Bindings) => Promise<TermExpression>;\n}\n\nexport interface IInternalEvaluator {\n evaluatorExpressionEvaluation: (expr: Expression, mapping: RDF.Bindings) => Promise<TermExpression>;\n\n context: IActionContext;\n}\n\nexport enum ExpressionType {\n Aggregate = 'aggregate',\n Existence = 'existence',\n Operator = 'operator',\n Term = 'term',\n Variable = 'variable',\n}\nexport type TermType = 'namedNode' | 'literal' | 'blankNode' | 'quad' | 'defaultGraph';\n\nexport type TermExpression = IExpressionProps & {\n expressionType: ExpressionType.Term;\n termType: TermType;\n str: () => string;\n coerceEBV: () => boolean;\n toRDF: (dataFactory: ComunicaDataFactory) => RDF.Term;\n};\n\nexport type Expression =\n AggregateExpression |\n ExistenceExpression |\n OperatorExpression |\n TermExpression |\n VariableExpression;\n\nexport interface IExpressionProps {\n expressionType: ExpressionType;\n}\n\nexport type AggregateExpression = IExpressionProps & {\n expressionType: ExpressionType.Aggregate;\n name: string;\n expression: Algebra.AggregateExpression;\n};\n\nexport type ExistenceExpression = IExpressionProps & {\n expressionType: ExpressionType.Existence;\n expression: Algebra.ExistenceExpression;\n};\n\nexport type OperatorExpression = IExpressionProps & {\n expressionType: ExpressionType.Operator;\n name: string;\n args: Expression[];\n apply: FunctionApplication;\n};\n\nexport type VariableExpression = IExpressionProps & {\n expressionType: ExpressionType.Variable;\n name: string;\n};\n\nexport type SimpleApplication = (args: TermExpression[]) => TermExpression;\nexport type SimpleApplicationTuple<T> = (args: T) => TermExpression;\n\nexport type FunctionApplication = (evalContext: IEvalContext) => Promise<TermExpression>;\n\nexport type ImplementationFunction = (expressionEvaluator: IInternalEvaluator) => SimpleApplication;\nexport type ImplementationFunctionTuple<T> = (expressionEvaluator: IInternalEvaluator) => SimpleApplicationTuple<T>;\n\nexport interface IFunctionArgumentsCacheObj {\n func?: ImplementationFunction;\n cache?: FunctionArgumentsCache;\n}\nexport type FunctionArgumentsCache = Record<string, IFunctionArgumentsCacheObj>;\n\nexport interface IEvalContext {\n args: Expression[];\n mapping: RDF.Bindings;\n exprEval: IInternalEvaluator;\n}\n"]} | ||
| {"version":3,"file":"ExpressionEvaluator.js","sourceRoot":"","sources":["ExpressionEvaluator.ts"],"names":[],"mappings":";;;AAkFA,IAAY,cAMX;AAND,WAAY,cAAc;IACxB,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,uCAAqB,CAAA;AACvB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB","sourcesContent":["import type { Algebra } from '@comunica/utils-algebra';\nimport type * as RDF from '@rdfjs/types';\nimport type { LRUCache } from 'lru-cache';\nimport type { ComunicaDataFactory } from './ComunicaDataFactory';\nimport type { IActionContext } from './IActionContext';\n\nexport interface ITimeZoneRepresentation {\n // https://www.w3.org/TR/xpath-functions/#func-implicit-timezone\n // Type is a dayTimeDuration.\n // We use a separate dataType since it makes TS type modifications and JS object copying easier.\n zoneHours: number;\n zoneMinutes: number;\n}\n\nexport interface IDateRepresentation extends Partial<ITimeZoneRepresentation> {\n year: number;\n month: number;\n day: number;\n}\n\nexport interface ITimeRepresentation extends Partial<ITimeZoneRepresentation> {\n hours: number;\n minutes: number;\n seconds: number;\n}\n\nexport interface IDayTimeDurationRepresentation {\n hours: number;\n minutes: number;\n seconds: number;\n day: number;\n}\n\nexport interface IYearMonthDurationRepresentation {\n year: number;\n month: number;\n}\n\nexport type IDurationRepresentation = IYearMonthDurationRepresentation & IDayTimeDurationRepresentation;\nexport type IDateTimeRepresentation = IDateRepresentation & ITimeRepresentation;\nexport type AsyncExtensionFunction = (args: RDF.Term[]) => Promise<RDF.Term>;\nexport type AsyncExtensionFunctionCreator = (functionNamedNode: RDF.NamedNode) =>\nPromise<AsyncExtensionFunction | undefined>;\n\n/**\n * The key 'term' is not included in these keys. Something that is just a term will map to number 0.\n */\nexport type GeneralSuperTypeDict = Record<string, number> & { __depth: number };\nexport type TypeCache = LRUCache<string, GeneralSuperTypeDict>;\nexport type SuperTypeCallback = (unknownType: string) => string;\n\nexport interface ISuperTypeProvider {\n cache: TypeCache;\n discoverer: SuperTypeCallback;\n}\n\n/**\n * An evaluator for RDF expressions.\n */\nexport interface IExpressionEvaluator extends IInternalEvaluator {\n /**\n * Evaluates the provided bindings in terms of the context the evaluator was created.\n * @param mapping the RDF bindings to evaluate against.\n */\n evaluate: (mapping: RDF.Bindings) => Promise<RDF.Term>;\n\n /**\n * Evaluates the provided bindings in terms of the context the evaluator was created,\n * returning the effective boolean value.\n * @param mapping the RDF bindings to evaluate against.\n */\n evaluateAsEBV: (mapping: RDF.Bindings) => Promise<boolean>;\n\n evaluateAsEvaluatorExpression: (mapping: RDF.Bindings) => Promise<TermExpression>;\n}\n\nexport interface IInternalEvaluator {\n evaluatorExpressionEvaluation: (expr: Expression, mapping: RDF.Bindings) => Promise<TermExpression>;\n\n context: IActionContext;\n}\n\nexport enum ExpressionType {\n Aggregate = 'aggregate',\n Existence = 'existence',\n Operator = 'operator',\n Term = 'term',\n Variable = 'variable',\n}\nexport type TermType = 'namedNode' | 'literal' | 'blankNode' | 'quad' | 'defaultGraph';\n\nexport type TermExpression = IExpressionProps & {\n expressionType: ExpressionType.Term;\n termType: TermType;\n str: () => string;\n coerceEBV: () => boolean;\n toRDF: (dataFactory: ComunicaDataFactory) => RDF.Term;\n};\n\nexport type Expression =\n AggregateExpression |\n ExistenceExpression |\n OperatorExpression |\n TermExpression |\n VariableExpression;\n\nexport interface IExpressionProps {\n expressionType: ExpressionType;\n}\n\nexport type AggregateExpression = IExpressionProps & {\n expressionType: ExpressionType.Aggregate;\n name: string;\n expression: Algebra.AggregateExpression;\n};\n\nexport type ExistenceExpression = IExpressionProps & {\n expressionType: ExpressionType.Existence;\n expression: Algebra.ExistenceExpression;\n};\n\nexport type OperatorExpression = IExpressionProps & {\n expressionType: ExpressionType.Operator;\n name: string;\n args: Expression[];\n apply: FunctionApplication;\n};\n\nexport type VariableExpression = IExpressionProps & {\n expressionType: ExpressionType.Variable;\n name: string;\n};\n\nexport type SimpleApplication = (args: TermExpression[]) => TermExpression;\nexport type SimpleApplicationTuple<T> = (args: T) => TermExpression;\n\nexport type FunctionApplication = (evalContext: IEvalContext) => Promise<TermExpression>;\n\nexport type ImplementationFunction = (expressionEvaluator: IInternalEvaluator) => SimpleApplication;\nexport type ImplementationFunctionTuple<T> = (expressionEvaluator: IInternalEvaluator) => SimpleApplicationTuple<T>;\n\nexport interface IFunctionArgumentsCacheObj {\n func?: ImplementationFunction;\n cache?: FunctionArgumentsCache;\n}\nexport type FunctionArgumentsCache = Record<string, IFunctionArgumentsCacheObj>;\n\nexport interface IEvalContext {\n args: Expression[];\n mapping: RDF.Bindings;\n exprEval: IInternalEvaluator;\n}\n"]} |
@@ -1,2 +0,2 @@ | ||
| import type { Algebra } from 'sparqlalgebrajs'; | ||
| import type { Algebra } from '@comunica/utils-algebra'; | ||
| import type { QueryResultCardinality } from './IMetadata'; | ||
@@ -21,3 +21,3 @@ /** | ||
| */ | ||
| getCardinality: (operation: Algebra.Operation) => QueryResultCardinality | undefined; | ||
| getCardinality: (operation: Algebra.Operation) => Promise<QueryResultCardinality | undefined>; | ||
| } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"IDataset.js","sourceRoot":"","sources":["IDataset.ts"],"names":[],"mappings":"","sourcesContent":["import type { Algebra } from 'sparqlalgebrajs';\nimport type { QueryResultCardinality } from './IMetadata';\n\n/**\n * Abstraction to allow grouping of metadata by dataset, in case multiple datasets\n * expose their metadata through the same source URI and thus the same stream.\n */\nexport interface IDataset {\n /**\n * The unique URI of this dataset.\n */\n uri: string;\n /**\n * The URI from which this dataset was discovered.\n */\n source: string;\n /**\n * Calculate the cardinality of the given operation within this dataset.\n * @param {Algebra.Operation} operation SPARQL algebra operation.\n * @returns {QueryResultCardinality} Upper bound for the cardinality.\n */\n getCardinality: (operation: Algebra.Operation) => QueryResultCardinality | undefined;\n}\n"]} | ||
| {"version":3,"file":"IDataset.js","sourceRoot":"","sources":["IDataset.ts"],"names":[],"mappings":"","sourcesContent":["import type { Algebra } from '@comunica/utils-algebra';\nimport type { QueryResultCardinality } from './IMetadata';\n\n/**\n * Abstraction to allow grouping of metadata by dataset, in case multiple datasets\n * expose their metadata through the same source URI and thus the same stream.\n */\nexport interface IDataset {\n /**\n * The unique URI of this dataset.\n */\n uri: string;\n /**\n * The URI from which this dataset was discovered.\n */\n source: string;\n /**\n * Calculate the cardinality of the given operation within this dataset.\n * @param {Algebra.Operation} operation SPARQL algebra operation.\n * @returns {QueryResultCardinality} Upper bound for the cardinality.\n */\n getCardinality: (operation: Algebra.Operation) => Promise<QueryResultCardinality | undefined>;\n}\n"]} |
@@ -1,2 +0,2 @@ | ||
| import type { Algebra } from 'sparqlalgebrajs'; | ||
| import type { Algebra } from '@comunica/utils-algebra'; | ||
| import type { MetadataBindings } from './IMetadata'; | ||
@@ -3,0 +3,0 @@ import type { IQueryOperationResultBindings } from './IQueryOperationResult'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"IJoinEntry.js","sourceRoot":"","sources":["IJoinEntry.ts"],"names":[],"mappings":"","sourcesContent":["import type { Algebra } from 'sparqlalgebrajs';\nimport type { MetadataBindings } from './IMetadata';\nimport type { IQueryOperationResultBindings } from './IQueryOperationResult';\n\n/**\n * A joinable entry.\n */\nexport interface IJoinEntry {\n /**\n * A (lazy) resolved bindings stream, from which metadata may be obtained.\n */\n output: IQueryOperationResultBindings;\n /**\n * The original query operation from which the bindings stream was produced.\n */\n operation: Algebra.Operation;\n /**\n * If the operation is not the original operation,\n * but is only created to simulate the output stream.\n * If this field is set, this usually means that the output should be directly used,\n * while using the operation would lead to sub-optimal performance.\n * This is for example set in bind-join-like actors.\n */\n operationModified?: true;\n /**\n * If pushing the join into the given operation must be preferred over using the output stream directly.\n * This will for example prefer bind-join-like actors.\n */\n operationRequired?: true;\n}\n\n/**\n * A joinable entry with resolved metadata.\n */\nexport type IJoinEntryWithMetadata = IJoinEntry & { metadata: MetadataBindings };\n\n/**\n * Represents a logical join type.\n */\nexport type LogicalJoinType = 'inner' | 'optional' | 'minus';\n"]} | ||
| {"version":3,"file":"IJoinEntry.js","sourceRoot":"","sources":["IJoinEntry.ts"],"names":[],"mappings":"","sourcesContent":["import type { Algebra } from '@comunica/utils-algebra';\nimport type { MetadataBindings } from './IMetadata';\nimport type { IQueryOperationResultBindings } from './IQueryOperationResult';\n\n/**\n * A joinable entry.\n */\nexport interface IJoinEntry {\n /**\n * A (lazy) resolved bindings stream, from which metadata may be obtained.\n */\n output: IQueryOperationResultBindings;\n /**\n * The original query operation from which the bindings stream was produced.\n */\n operation: Algebra.Operation;\n /**\n * If the operation is not the original operation,\n * but is only created to simulate the output stream.\n * If this field is set, this usually means that the output should be directly used,\n * while using the operation would lead to sub-optimal performance.\n * This is for example set in bind-join-like actors.\n */\n operationModified?: true;\n /**\n * If pushing the join into the given operation must be preferred over using the output stream directly.\n * This will for example prefer bind-join-like actors.\n */\n operationRequired?: true;\n}\n\n/**\n * A joinable entry with resolved metadata.\n */\nexport type IJoinEntryWithMetadata = IJoinEntry & { metadata: MetadataBindings };\n\n/**\n * Represents a logical join type.\n */\nexport type LogicalJoinType = 'inner' | 'optional' | 'minus';\n"]} |
+4
-0
@@ -12,2 +12,6 @@ import type * as RDF from '@rdfjs/types'; | ||
| /** | ||
| * If the source type must be set to something. | ||
| */ | ||
| forceSourceType?: string; | ||
| /** | ||
| * An optional stream modifier. | ||
@@ -14,0 +18,0 @@ * This transformation will be applied on the stream of data quads that is obtained from dereferencing the given URL. |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ILink.js","sourceRoot":"","sources":["ILink.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { IActionContext } from './IActionContext';\n\n/**\n * A link holder that can expose additional properties.\n */\n\nexport interface ILink {\n /**\n * The URL identifying this link.\n */\n url: string;\n /**\n * An optional stream modifier.\n * This transformation will be applied on the stream of data quads that is obtained from dereferencing the given URL.\n * @param input The stream of data quads on the given URL.\n * @returns The stream of data quads to be used for this link instead of the given stream.\n */\n transform?: (input: RDF.Stream) => Promise<RDF.Stream>;\n /**\n * Optional context to apply onto mediators when handling this link as source.\n * All entries of this context will be added (or overwritten) into the existing context.\n */\n context?: IActionContext;\n /**\n * An optional link-specific metadata object.\n * This may be used to keep track of data that is relevant to links,\n * which could be used across actors.\n */\n metadata?: Record<string, any>;\n}\n"]} | ||
| {"version":3,"file":"ILink.js","sourceRoot":"","sources":["ILink.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { IActionContext } from './IActionContext';\n\n/**\n * A link holder that can expose additional properties.\n */\nexport interface ILink {\n /**\n * The URL identifying this link.\n */\n url: string;\n /**\n * If the source type must be set to something.\n */\n forceSourceType?: string;\n /**\n * An optional stream modifier.\n * This transformation will be applied on the stream of data quads that is obtained from dereferencing the given URL.\n * @param input The stream of data quads on the given URL.\n * @returns The stream of data quads to be used for this link instead of the given stream.\n */\n transform?: (input: RDF.Stream) => Promise<RDF.Stream>;\n /**\n * Optional context to apply onto mediators when handling this link as source.\n * All entries of this context will be added (or overwritten) into the existing context.\n */\n context?: IActionContext;\n /**\n * An optional link-specific metadata object.\n * This may be used to keep track of data that is relevant to links,\n * which could be used across actors.\n */\n metadata?: Record<string, any>;\n}\n"]} |
+2
-1
| export * from './Bindings'; | ||
| export * from './ComunicaDataFactory'; | ||
| export * from './IActionContext'; | ||
| export * from './IAggregatedStore'; | ||
| export * from './ICachePolicy'; | ||
| export * from './ICliArgsHandler'; | ||
@@ -20,3 +20,4 @@ export * from './IDataDestination'; | ||
| export * from './ILink'; | ||
| export * from './ILinkQueue'; | ||
| export * from './Logger'; | ||
| export * from './ExpressionEvaluator'; |
+2
-1
@@ -20,3 +20,3 @@ "use strict"; | ||
| __exportStar(require("./IActionContext"), exports); | ||
| __exportStar(require("./IAggregatedStore"), exports); | ||
| __exportStar(require("./ICachePolicy"), exports); | ||
| __exportStar(require("./ICliArgsHandler"), exports); | ||
@@ -37,4 +37,5 @@ __exportStar(require("./IDataDestination"), exports); | ||
| __exportStar(require("./ILink"), exports); | ||
| __exportStar(require("./ILinkQueue"), exports); | ||
| __exportStar(require("./Logger"), exports); | ||
| __exportStar(require("./ExpressionEvaluator"), exports); | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,wDAAsC;AACtC,mDAAiC;AACjC,qDAAmC;AACnC,oDAAkC;AAClC,qDAAmC;AACnC,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,0DAAwC;AACxC,iDAA+B;AAC/B,8DAA4C;AAC5C,kEAAgD;AAChD,8DAA4C;AAC5C,0CAAwB;AACxB,2CAAyB;AACzB,wDAAsC","sourcesContent":["export * from './Bindings';\nexport * from './ComunicaDataFactory';\nexport * from './IActionContext';\nexport * from './IAggregatedStore';\nexport * from './ICliArgsHandler';\nexport * from './IDataDestination';\nexport * from './IDataset';\nexport * from './IJoinEntry';\nexport * from './IMetadata';\nexport * from './IPhysicalQueryPlanLogger';\nexport * from './IProxyHandler';\nexport * from './IQueryContext';\nexport * from './IQueryEngine';\nexport * from './IQueryOperationResult';\nexport * from './IQuerySource';\nexport * from './statistics/IStatisticBase';\nexport * from './statistics/IDiscoverEventData';\nexport * from './statistics/IPartialResult';\nexport * from './ILink';\nexport * from './Logger';\nexport * from './ExpressionEvaluator';\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,wDAAsC;AACtC,mDAAiC;AACjC,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,6CAA2B;AAC3B,+CAA6B;AAC7B,8CAA4B;AAC5B,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,0DAAwC;AACxC,iDAA+B;AAC/B,8DAA4C;AAC5C,kEAAgD;AAChD,8DAA4C;AAC5C,0CAAwB;AACxB,+CAA6B;AAC7B,2CAAyB;AACzB,wDAAsC","sourcesContent":["export * from './Bindings';\nexport * from './ComunicaDataFactory';\nexport * from './IActionContext';\nexport * from './ICachePolicy';\nexport * from './ICliArgsHandler';\nexport * from './IDataDestination';\nexport * from './IDataset';\nexport * from './IJoinEntry';\nexport * from './IMetadata';\nexport * from './IPhysicalQueryPlanLogger';\nexport * from './IProxyHandler';\nexport * from './IQueryContext';\nexport * from './IQueryEngine';\nexport * from './IQueryOperationResult';\nexport * from './IQuerySource';\nexport * from './statistics/IStatisticBase';\nexport * from './statistics/IDiscoverEventData';\nexport * from './statistics/IPartialResult';\nexport * from './ILink';\nexport * from './ILinkQueue';\nexport * from './Logger';\nexport * from './ExpressionEvaluator';\n"]} |
| import type * as RDF from '@rdfjs/types'; | ||
| import type { ComunicaDataFactory } from './ComunicaDataFactory'; | ||
| import type { FunctionArgumentsCache } from './ExpressionEvaluator'; | ||
@@ -25,4 +26,6 @@ import type { IDataDestination } from './IDataDestination'; | ||
| datetime?: Date; | ||
| queryTimestampHighResolution?: DOMHighResTimeStamp; | ||
| httpProxyHandler?: IProxyHandler; | ||
| lenient?: boolean; | ||
| parseUnsupportedVersions?: boolean; | ||
| httpIncludeCredentials?: boolean; | ||
@@ -35,11 +38,19 @@ httpAuth?: string; | ||
| httpRetryDelayLimit?: number; | ||
| httpRetryStatusCodes?: number[]; | ||
| httpAbortSignal?: AbortSignal; | ||
| httpCache?: boolean; | ||
| fetch?: typeof fetch; | ||
| recoverBrokenLinks?: boolean; | ||
| readOnly?: boolean; | ||
| extensionFunctions?: Record<string, (args: RDF.Term[]) => Promise<RDF.Term>>; | ||
| extensionFunctionsAlwaysPushdown?: boolean; | ||
| extensionFunctionCreator?: (functionNamedNode: RDF.NamedNode) => ((args: RDF.Term[]) => Promise<RDF.Term>) | undefined; | ||
| functionArgumentsCache?: FunctionArgumentsCache; | ||
| extensionFunctions?: Record<string, (args: RDF.Term[]) => Promise<RDF.Term>>; | ||
| explain?: QueryExplainMode; | ||
| recoverBrokenLinks?: boolean; | ||
| unionDefaultGraph?: boolean; | ||
| traverse?: boolean; | ||
| invalidateCache?: boolean; | ||
| dataFactory?: ComunicaDataFactory; | ||
| distinctConstruct?: boolean; | ||
| sources: SourceType[]; | ||
| } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"IQueryContext.js","sourceRoot":"","sources":["IQueryContext.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { FunctionArgumentsCache } from './ExpressionEvaluator';\nimport type { IDataDestination } from './IDataDestination';\nimport type { IProxyHandler } from './IProxyHandler';\nimport type { SourceType } from './IQueryEngine';\nimport type { QueryExplainMode } from './IQueryOperationResult';\nimport type { Logger } from './Logger';\n\n// We omit `& RDF.QuerySourceContext<SourceType>` in the following two types\n// as the QuerySourceContext proved to be too developer-unfriendly.\n\n/**\n * Query context when a string-based query was passed.\n */\nexport type QueryStringContext = RDF.QueryStringContext & IQueryContextCommon;\n/**\n * Query context when an algebra-based query was passed.\n */\nexport type QueryAlgebraContext = RDF.QueryAlgebraContext & IQueryContextCommon;\n\n/**\n * Common query context interface\n */\nexport interface IQueryContextCommon {\n // Types of these entries should be aligned with contextKeyShortcuts in ActorInitQueryBase\n // and Keys in @comunica/context-entries\n\n // Inherited from RDF.QueryStringContext: sources\n destination?: IDataDestination;\n initialBindings?: RDF.Bindings;\n // Inherited from RDF.QueryStringContext: queryFormat?: string;\n // Inherited from RDF.QueryStringContext: baseIRI?: string;\n fileBaseIRI?: string;\n log?: Logger;\n datetime?: Date;\n // Inherited from RDF.QueryStringContext: queryTimestamp?: Date;\n httpProxyHandler?: IProxyHandler;\n lenient?: boolean;\n httpIncludeCredentials?: boolean;\n httpAuth?: string;\n httpTimeout?: number;\n httpBodyTimeout?: boolean;\n httpRetryCount?: number;\n httpRetryDelayFallback?: number;\n httpRetryDelayLimit?: number;\n fetch?: typeof fetch;\n readOnly?: boolean;\n extensionFunctionCreator?: (functionNamedNode: RDF.NamedNode)\n => ((args: RDF.Term[]) => Promise<RDF.Term>) | undefined;\n functionArgumentsCache?: FunctionArgumentsCache;\n extensionFunctions?: Record<string, (args: RDF.Term[]) => Promise<RDF.Term>>;\n explain?: QueryExplainMode;\n recoverBrokenLinks?: boolean;\n distinctConstruct?: boolean;\n\n sources: SourceType[];\n}\n"]} | ||
| {"version":3,"file":"IQueryContext.js","sourceRoot":"","sources":["IQueryContext.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { ComunicaDataFactory } from './ComunicaDataFactory';\nimport type { FunctionArgumentsCache } from './ExpressionEvaluator';\nimport type { IDataDestination } from './IDataDestination';\nimport type { IProxyHandler } from './IProxyHandler';\nimport type { SourceType } from './IQueryEngine';\nimport type { QueryExplainMode } from './IQueryOperationResult';\nimport type { Logger } from './Logger';\n\n// We omit `& RDF.QuerySourceContext<SourceType>` in the following two types\n// as the QuerySourceContext proved to be too developer-unfriendly.\n\n/**\n * Query context when a string-based query was passed.\n */\nexport type QueryStringContext = RDF.QueryStringContext & IQueryContextCommon;\n/**\n * Query context when an algebra-based query was passed.\n */\nexport type QueryAlgebraContext = RDF.QueryAlgebraContext & IQueryContextCommon;\n\n/**\n * Common query context interface\n */\nexport interface IQueryContextCommon {\n // Types of these entries should be aligned with contextKeyShortcuts in ActorContextPreprocessConvertShortcuts,\n // Keys in @comunica/context-entries, and possibly the CliArgsHandlers in @comunica/actor-init-query.\n\n // Inherited from RDF.QueryStringContext: sources\n destination?: IDataDestination;\n initialBindings?: RDF.Bindings;\n // Inherited from RDF.QueryStringContext: queryFormat?: string;\n // Inherited from RDF.QueryStringContext: baseIRI?: string;\n fileBaseIRI?: string;\n log?: Logger;\n datetime?: Date;\n // Inherited from RDF.QueryStringContext: queryTimestamp?: Date;\n queryTimestampHighResolution?: DOMHighResTimeStamp;\n httpProxyHandler?: IProxyHandler;\n lenient?: boolean;\n parseUnsupportedVersions?: boolean;\n httpIncludeCredentials?: boolean;\n httpAuth?: string;\n httpTimeout?: number;\n httpBodyTimeout?: boolean;\n httpRetryCount?: number;\n httpRetryDelayFallback?: number;\n httpRetryDelayLimit?: number;\n httpRetryStatusCodes?: number[];\n httpAbortSignal?: AbortSignal;\n httpCache?: boolean;\n fetch?: typeof fetch;\n recoverBrokenLinks?: boolean;\n readOnly?: boolean;\n extensionFunctions?: Record<string, (args: RDF.Term[]) => Promise<RDF.Term>>;\n extensionFunctionsAlwaysPushdown?: boolean;\n extensionFunctionCreator?: (functionNamedNode: RDF.NamedNode)\n => ((args: RDF.Term[]) => Promise<RDF.Term>) | undefined;\n functionArgumentsCache?: FunctionArgumentsCache;\n explain?: QueryExplainMode;\n unionDefaultGraph?: boolean;\n traverse?: boolean;\n invalidateCache?: boolean;\n dataFactory?: ComunicaDataFactory;\n distinctConstruct?: boolean;\n\n sources: SourceType[];\n}\n"]} |
@@ -0,4 +1,4 @@ | ||
| import type { Algebra } from '@comunica/utils-algebra'; | ||
| import type * as RDF from '@rdfjs/types'; | ||
| import type { AsyncIterator } from 'asynciterator'; | ||
| import type { Algebra } from 'sparqlalgebrajs'; | ||
| import type { BindingsStream } from './Bindings'; | ||
@@ -5,0 +5,0 @@ import type { IActionContext } from './IActionContext'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"IQueryEngine.js","sourceRoot":"","sources":["IQueryEngine.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { Algebra } from 'sparqlalgebrajs';\nimport type { BindingsStream } from './Bindings';\nimport type { IActionContext } from './IActionContext';\nimport type { QueryAlgebraContext, QueryStringContext } from './IQueryContext';\nimport type { IQueryExplained, QueryEnhanced, QueryExplainMode } from './IQueryOperationResult';\nimport type { QuerySourceUnidentified } from './IQuerySource';\n\nexport type QueryFormatType = string | Algebra.Operation;\nexport type SourceType = QuerySourceUnidentified;\nexport type QueryType = QueryEnhanced & { context?: IActionContext };\n\n/**\n * Base interface for a Comunica query engine.\n */\nexport interface IQueryEngine<\n QueryStringContextInner extends RDF.QueryStringContext = QueryStringContext,\n QueryAlgebraContextInner extends RDF.QueryAlgebraContext = QueryAlgebraContext,\n> extends\n RDF.StringQueryable<RDF.AllMetadataSupport, QueryStringContextInner>,\n RDF.AlgebraQueryable<Algebra.Operation, RDF.AllMetadataSupport, QueryAlgebraContextInner>,\n RDF.StringSparqlQueryable<RDF.SparqlResultSupport, QueryStringContextInner>,\n RDF.AlgebraSparqlQueryable<Algebra.Operation, RDF.SparqlResultSupport, QueryAlgebraContextInner> {\n\n /**\n * Query the bindings results of a SELECT query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryBindings: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<BindingsStream>;\n\n /**\n * Query the quad results of a CONSTRUCT or DESCRIBE query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryQuads: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<AsyncIterator<RDF.Quad> & RDF.ResultStream<RDF.Quad>>;\n\n /**\n * Query the boolean result of an ASK query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryBoolean: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<boolean>;\n\n /**\n * Execute an UPDATE query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryVoid: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<void>;\n\n /**\n * Initiate a given query.\n * This will produce a future to a query result, which has to be executed to obtain the query results.\n * This can reject given an unsupported or invalid query.\n *\n * This method is prefered in case you don't know beforehand what type of query will be executed,\n * or if you require access to the metadata of the results.\n *\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n query: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<QueryType>;\n\n /**\n * Explain the given query\n * @param {string | Algebra.Operation} query A query string or algebra.\n * Algebra objects must not contain blank nodes.\n * They should be converted to variables.\n * @param context A query context.\n * @param explainMode The explain mode.\n * @return {Promise<IQueryExplained>}\n * A promise that resolves to the query output.\n */\n explain: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n explainMode: QueryExplainMode,\n ) => Promise<IQueryExplained>;\n /**\n * @param context An optional context.\n * @return {Promise<{[p: string]: number}>} All available SPARQL (weighted) result media types.\n */\n getResultMediaTypes: (context?: IActionContext) => Promise<Record<string, number>>;\n /**\n * @param context An optional context.\n * @return {Promise<{[p: string]: number}>} All available SPARQL result media type formats.\n */\n getResultMediaTypeFormats: (context?: IActionContext) => Promise<Record<string, string>>;\n /**\n * Convert a query result to a string stream based on a certain media type.\n * @param {QueryType} queryResult A query result.\n * @param {string} mediaType A media type.\n * @param {IActionContext} context An optional context.\n * @return {Promise<IActorQueryResultSerializeOutput>} A text stream.\n */\n resultToString: (queryResult: QueryType, mediaType?: string, context?: any) => any;\n /**\n * Invalidate all internal caches related to the given page URL.\n * If no page URL is given, then all pages will be invalidated.\n * @param {string} url The page URL to invalidate.\n * @return {Promise<any>} A promise resolving when the caches have been invalidated.\n */\n invalidateHttpCache: (url?: string) => Promise<any>;\n}\n"]} | ||
| {"version":3,"file":"IQueryEngine.js","sourceRoot":"","sources":["IQueryEngine.ts"],"names":[],"mappings":"","sourcesContent":["import type { Algebra } from '@comunica/utils-algebra';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { BindingsStream } from './Bindings';\nimport type { IActionContext } from './IActionContext';\nimport type { QueryAlgebraContext, QueryStringContext } from './IQueryContext';\nimport type { IQueryExplained, QueryEnhanced, QueryExplainMode } from './IQueryOperationResult';\nimport type { QuerySourceUnidentified } from './IQuerySource';\n\nexport type QueryFormatType = string | Algebra.Operation;\nexport type SourceType = QuerySourceUnidentified;\nexport type QueryType = QueryEnhanced & { context?: IActionContext };\n\n/**\n * Base interface for a Comunica query engine.\n */\nexport interface IQueryEngine<\n QueryStringContextInner extends RDF.QueryStringContext = QueryStringContext,\n QueryAlgebraContextInner extends RDF.QueryAlgebraContext = QueryAlgebraContext,\n> extends\n RDF.StringQueryable<RDF.AllMetadataSupport, QueryStringContextInner>,\n RDF.AlgebraQueryable<Algebra.Operation, RDF.AllMetadataSupport, QueryAlgebraContextInner>,\n RDF.StringSparqlQueryable<RDF.SparqlResultSupport, QueryStringContextInner>,\n RDF.AlgebraSparqlQueryable<Algebra.Operation, RDF.SparqlResultSupport, QueryAlgebraContextInner> {\n\n /**\n * Query the bindings results of a SELECT query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryBindings: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<BindingsStream>;\n\n /**\n * Query the quad results of a CONSTRUCT or DESCRIBE query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryQuads: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<AsyncIterator<RDF.Quad> & RDF.ResultStream<RDF.Quad>>;\n\n /**\n * Query the boolean result of an ASK query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryBoolean: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<boolean>;\n\n /**\n * Execute an UPDATE query.\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n queryVoid: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<void>;\n\n /**\n * Initiate a given query.\n * This will produce a future to a query result, which has to be executed to obtain the query results.\n * This can reject given an unsupported or invalid query.\n *\n * This method is prefered in case you don't know beforehand what type of query will be executed,\n * or if you require access to the metadata of the results.\n *\n * @param query A query string or algebra object.\n * Algebra objects must not contain blank nodes. They should be converted to variables.\n * @param context A context.\n */\n query: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context?: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n ) => Promise<QueryType>;\n\n /**\n * Explain the given query\n * @param {string | Algebra.Operation} query A query string or algebra.\n * Algebra objects must not contain blank nodes.\n * They should be converted to variables.\n * @param context A query context.\n * @param explainMode The explain mode.\n * @return {Promise<IQueryExplained>}\n * A promise that resolves to the query output.\n */\n explain: <QueryFormatTypeInner extends QueryFormatType>(\n query: QueryFormatTypeInner,\n context: QueryFormatTypeInner extends string ? QueryStringContextInner : QueryAlgebraContextInner,\n explainMode: QueryExplainMode,\n ) => Promise<IQueryExplained>;\n /**\n * @param context An optional context.\n * @return {Promise<{[p: string]: number}>} All available SPARQL (weighted) result media types.\n */\n getResultMediaTypes: (context?: IActionContext) => Promise<Record<string, number>>;\n /**\n * @param context An optional context.\n * @return {Promise<{[p: string]: number}>} All available SPARQL result media type formats.\n */\n getResultMediaTypeFormats: (context?: IActionContext) => Promise<Record<string, string>>;\n /**\n * Convert a query result to a string stream based on a certain media type.\n * @param {QueryType} queryResult A query result.\n * @param {string} mediaType A media type.\n * @param {IActionContext} context An optional context.\n * @return {Promise<IActorQueryResultSerializeOutput>} A text stream.\n */\n resultToString: (queryResult: QueryType, mediaType?: string, context?: any) => any;\n /**\n * Invalidate all internal caches related to the given page URL.\n * If no page URL is given, then all pages will be invalidated.\n * @param {string} url The page URL to invalidate.\n * @return {Promise<any>} A promise resolving when the caches have been invalidated.\n */\n invalidateHttpCache: (url?: string) => Promise<any>;\n}\n"]} |
@@ -123,3 +123,3 @@ import type * as RDF from '@rdfjs/types'; | ||
| */ | ||
| export type QueryExplainMode = 'parsed' | 'logical' | 'physical' | 'physical-json'; | ||
| export type QueryExplainMode = 'parsed' | 'logical' | 'query' | 'physical' | 'physical-json'; | ||
| /** | ||
@@ -126,0 +126,0 @@ * An interface marking an explained query. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"IQueryOperationResult.js","sourceRoot":"","sources":["IQueryOperationResult.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { BindingsStream } from './Bindings';\nimport type { IActionContext } from './IActionContext';\nimport type { IMetadata, MetadataQuads, MetadataBindings } from './IMetadata';\n\nexport interface IQueryOperationResultBase {\n /**\n * The type of output.\n */\n type: string;\n /**\n * The resulting action context.\n */\n context?: IActionContext;\n}\n\n/**\n * Super interface for query operation results that represent some for of stream.\n * @see IQueryableResultBindings, IQueryableResultQuads\n */\nexport interface IQueryOperationResultStream<\n M extends IMetadata<OrderItemsType>,\n OrderItemsType extends RDF.Variable | RDF.QuadTermName,\n> extends IQueryOperationResultBase {\n /**\n * Callback that returns a promise that resolves to the metadata about the stream.\n *\n * This can contain things like the estimated number of total stream elements,\n * or the order in which the bindings appear.\n *\n * This callback can be invoked multiple times.\n * Each invocation can return a different metadata object,\n * if the previous one would have become invalidated (see `metadata.state`).\n * The actors that return this metadata will make sure that multiple calls properly cache this promise,\n * and that the cached object is properly invalidated if needed.\n * Metadata will not be collected until this callback is invoked.\n *\n * This callback should resolve quickly, so it is safe to call and immediately `await` it.\n */\n metadata: () => Promise<M>;\n}\n\n/**\n * Query operation output for a bindings stream.\n * For example: SPARQL SELECT results\n */\nexport interface IQueryOperationResultBindings extends IQueryOperationResultStream<MetadataBindings, RDF.Variable> {\n /**\n * The type of output.\n */\n type: 'bindings';\n /**\n * The stream of bindings resulting from the given operation.\n */\n bindingsStream: BindingsStream;\n}\n\n/**\n * Query operation output for quads.\n * For example: SPARQL CONSTRUCT results\n */\nexport interface IQueryOperationResultQuads extends IQueryOperationResultStream<MetadataQuads, RDF.QuadTermName> {\n /**\n * The type of output.\n */\n type: 'quads';\n /**\n * The stream of quads.\n */\n quadStream: RDF.Stream & AsyncIterator<RDF.Quad> & RDF.ResultStream<RDF.Quad>;\n}\n\n/**\n * Query operation output for boolean results.\n * For example: SPARQL ASK results\n */\nexport interface IQueryOperationResultBoolean extends IQueryOperationResultBase {\n /**\n * The type of output.\n */\n type: 'boolean';\n /**\n * An async function resolving to the boolean output of the operation.\n */\n execute: () => Promise<boolean>;\n}\n\n/**\n * Query operation output for boolean results.\n * For example: SPARQL UPDATE results\n */\nexport interface IQueryOperationResultVoid extends IQueryOperationResultBase {\n /**\n * The type of output.\n */\n type: 'void';\n /**\n * An async function resolving when the update has finished.\n */\n execute: () => Promise<void>;\n}\n\n/**\n * Query operation output.\n * @see IQueryableResultBindings, IQueryableResultQuads, IQueryableResultBoolean, IQueryableResultVoid\n */\nexport type IQueryOperationResult =\n IQueryOperationResultBindings |\n IQueryOperationResultQuads |\n IQueryOperationResultBoolean |\n IQueryOperationResultVoid;\n\n/**\n * Enhanced query operation output for a bindings stream.\n * For example: SPARQL SELECT results\n */\nexport interface IQueryBindingsEnhanced extends QueryBindings {\n // Override with more specific return type\n execute: (opts?: RDF.QueryExecuteOptions<RDF.Variable>) => Promise<BindingsStream>;\n}\n\n/**\n * Enhanced query operation output for quads.\n * For example: SPARQL CONSTRUCT results\n */\nexport interface IQueryQuadsEnhanced extends QueryQuads {\n // Override with more specific return type\n execute: (opts?: RDF.QueryExecuteOptions<RDF.QuadTermName>)\n => Promise<AsyncIterator<RDF.Quad> & RDF.ResultStream<RDF.Quad>>;\n}\n\nexport type QueryBindings = RDF.QueryBindings<RDF.AllMetadataSupport>;\nexport type QueryQuads = RDF.QueryQuads<RDF.AllMetadataSupport>;\n\n/**\n * Enhanced query operation output.\n * @see IQueryableResultBindingsEnhanced, IQueryableResultQuadsEnhanced, IQueryableResultBoolean, IQueryableResultVoid\n */\nexport type QueryEnhanced =\n IQueryBindingsEnhanced |\n IQueryQuadsEnhanced |\n RDF.QueryBoolean |\n RDF.QueryVoid;\n\n/**\n * Different manners in which a query can be explained.\n */\nexport type QueryExplainMode = 'parsed' | 'logical' | 'physical' | 'physical-json';\n\n/**\n * An interface marking an explained query.\n * WARNING: this API is experimental, and might be changed inbetween major versions.\n */\nexport interface IQueryExplained {\n explain: true;\n /**\n * The mode of explanation\n */\n type: QueryExplainMode;\n /**\n * The raw explanation data\n */\n data: any;\n}\n"]} | ||
| {"version":3,"file":"IQueryOperationResult.js","sourceRoot":"","sources":["IQueryOperationResult.ts"],"names":[],"mappings":"","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { BindingsStream } from './Bindings';\nimport type { IActionContext } from './IActionContext';\nimport type { IMetadata, MetadataQuads, MetadataBindings } from './IMetadata';\n\nexport interface IQueryOperationResultBase {\n /**\n * The type of output.\n */\n type: string;\n /**\n * The resulting action context.\n */\n context?: IActionContext;\n}\n\n/**\n * Super interface for query operation results that represent some for of stream.\n * @see IQueryableResultBindings, IQueryableResultQuads\n */\nexport interface IQueryOperationResultStream<\n M extends IMetadata<OrderItemsType>,\n OrderItemsType extends RDF.Variable | RDF.QuadTermName,\n> extends IQueryOperationResultBase {\n /**\n * Callback that returns a promise that resolves to the metadata about the stream.\n *\n * This can contain things like the estimated number of total stream elements,\n * or the order in which the bindings appear.\n *\n * This callback can be invoked multiple times.\n * Each invocation can return a different metadata object,\n * if the previous one would have become invalidated (see `metadata.state`).\n * The actors that return this metadata will make sure that multiple calls properly cache this promise,\n * and that the cached object is properly invalidated if needed.\n * Metadata will not be collected until this callback is invoked.\n *\n * This callback should resolve quickly, so it is safe to call and immediately `await` it.\n */\n metadata: () => Promise<M>;\n}\n\n/**\n * Query operation output for a bindings stream.\n * For example: SPARQL SELECT results\n */\nexport interface IQueryOperationResultBindings extends IQueryOperationResultStream<MetadataBindings, RDF.Variable> {\n /**\n * The type of output.\n */\n type: 'bindings';\n /**\n * The stream of bindings resulting from the given operation.\n */\n bindingsStream: BindingsStream;\n}\n\n/**\n * Query operation output for quads.\n * For example: SPARQL CONSTRUCT results\n */\nexport interface IQueryOperationResultQuads extends IQueryOperationResultStream<MetadataQuads, RDF.QuadTermName> {\n /**\n * The type of output.\n */\n type: 'quads';\n /**\n * The stream of quads.\n */\n quadStream: RDF.Stream & AsyncIterator<RDF.Quad> & RDF.ResultStream<RDF.Quad>;\n}\n\n/**\n * Query operation output for boolean results.\n * For example: SPARQL ASK results\n */\nexport interface IQueryOperationResultBoolean extends IQueryOperationResultBase {\n /**\n * The type of output.\n */\n type: 'boolean';\n /**\n * An async function resolving to the boolean output of the operation.\n */\n execute: () => Promise<boolean>;\n}\n\n/**\n * Query operation output for boolean results.\n * For example: SPARQL UPDATE results\n */\nexport interface IQueryOperationResultVoid extends IQueryOperationResultBase {\n /**\n * The type of output.\n */\n type: 'void';\n /**\n * An async function resolving when the update has finished.\n */\n execute: () => Promise<void>;\n}\n\n/**\n * Query operation output.\n * @see IQueryableResultBindings, IQueryableResultQuads, IQueryableResultBoolean, IQueryableResultVoid\n */\nexport type IQueryOperationResult =\n IQueryOperationResultBindings |\n IQueryOperationResultQuads |\n IQueryOperationResultBoolean |\n IQueryOperationResultVoid;\n\n/**\n * Enhanced query operation output for a bindings stream.\n * For example: SPARQL SELECT results\n */\nexport interface IQueryBindingsEnhanced extends QueryBindings {\n // Override with more specific return type\n execute: (opts?: RDF.QueryExecuteOptions<RDF.Variable>) => Promise<BindingsStream>;\n}\n\n/**\n * Enhanced query operation output for quads.\n * For example: SPARQL CONSTRUCT results\n */\nexport interface IQueryQuadsEnhanced extends QueryQuads {\n // Override with more specific return type\n execute: (opts?: RDF.QueryExecuteOptions<RDF.QuadTermName>)\n => Promise<AsyncIterator<RDF.Quad> & RDF.ResultStream<RDF.Quad>>;\n}\n\nexport type QueryBindings = RDF.QueryBindings<RDF.AllMetadataSupport>;\nexport type QueryQuads = RDF.QueryQuads<RDF.AllMetadataSupport>;\n\n/**\n * Enhanced query operation output.\n * @see IQueryableResultBindingsEnhanced, IQueryableResultQuadsEnhanced, IQueryableResultBoolean, IQueryableResultVoid\n */\nexport type QueryEnhanced =\n IQueryBindingsEnhanced |\n IQueryQuadsEnhanced |\n RDF.QueryBoolean |\n RDF.QueryVoid;\n\n/**\n * Different manners in which a query can be explained.\n */\nexport type QueryExplainMode = 'parsed' | 'logical' | 'query' | 'physical' | 'physical-json';\n\n/**\n * An interface marking an explained query.\n * WARNING: this API is experimental, and might be changed inbetween major versions.\n */\nexport interface IQueryExplained {\n explain: true;\n /**\n * The mode of explanation\n */\n type: QueryExplainMode;\n /**\n * The raw explanation data\n */\n data: any;\n}\n"]} |
@@ -0,6 +1,7 @@ | ||
| import type { Algebra } from '@comunica/utils-algebra'; | ||
| import type * as RDF from '@rdfjs/types'; | ||
| import type { AsyncIterator } from 'asynciterator'; | ||
| import type { Algebra } from 'sparqlalgebrajs'; | ||
| import type { BindingsStream } from './Bindings'; | ||
| import type { IActionContext } from './IActionContext'; | ||
| import type { ILink } from './ILink'; | ||
| import type { MetadataBindings } from './IMetadata'; | ||
@@ -12,2 +13,3 @@ export interface IQuerySourceSerialized extends IQuerySourceUnidentifiedExpanded { | ||
| baseIRI?: string; | ||
| version?: string; | ||
| } | ||
@@ -24,4 +26,9 @@ export interface IQuerySourceUnidentifiedExpanded { | ||
| } | ||
| export interface IQuerySourceTraverse { | ||
| type: 'traverse'; | ||
| value: ILink[]; | ||
| context?: IActionContext | Record<string, any>; | ||
| } | ||
| export type QuerySourceUnidentifiedExpanded = IQuerySourceUnidentifiedExpanded | IQuerySourceSerialized; | ||
| export type QuerySourceUnidentified = string | RDF.Source | RDF.Store | RDF.DatasetCore | QuerySourceUnidentifiedExpanded | IQuerySourceUnidentifiedExpandedRawContext; | ||
| export type QuerySourceUnidentified = string | RDF.Source | RDF.Store | RDF.DatasetCore | QuerySourceUnidentifiedExpanded | IQuerySourceUnidentifiedExpandedRawContext | IQuerySourceTraverse; | ||
| /** | ||
@@ -44,2 +51,11 @@ * Attaches a context to a query target. | ||
| /** | ||
| * @return A value from 0 to 1 indicating to what respect a source type is | ||
| * able to pre-filter the source based on the pattern. | ||
| * 1 indicates that the source can apply the whole pattern, | ||
| * and 0 indicates that the source can not apply the pattern at all (and local filtering must happen). | ||
| * Plain RDF documents for example have a filter factor of 0, | ||
| * while SPARQL endpoints have a filter factor of 1. | ||
| */ | ||
| getFilterFactor: (context: IActionContext) => Promise<number>; | ||
| /** | ||
| * Get the selector type that is supported by this source. | ||
@@ -101,3 +117,3 @@ * @param context The action context. | ||
| */ | ||
| queryVoid: (operation: Algebra.Update, context: IActionContext) => Promise<void>; | ||
| queryVoid: (operation: Algebra.Operation, context: IActionContext) => Promise<void>; | ||
| /** | ||
@@ -144,3 +160,3 @@ * Returns a string representation of this source. | ||
| operationType: 'type'; | ||
| type: Algebra.types; | ||
| type: Algebra.Types; | ||
| } | { | ||
@@ -151,3 +167,3 @@ operationType: 'pattern'; | ||
| operationType: 'type'; | ||
| type: Algebra.types.EXPRESSION; | ||
| type: Algebra.Types.EXPRESSION; | ||
| /** | ||
@@ -154,0 +170,0 @@ * The extension functions this source supports. |
@@ -43,19 +43,19 @@ "use strict"; | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.PROJECT }, | ||
| // operation: { type: Algebra.Types.PROJECT }, | ||
| // }, | ||
| // { | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.CONSTRUCT }, | ||
| // operation: { type: Algebra.Types.CONSTRUCT }, | ||
| // }, | ||
| // { | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.DESCRIBE }, | ||
| // operation: { type: Algebra.Types.DESCRIBE }, | ||
| // }, | ||
| // { | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.ASK }, | ||
| // operation: { type: Algebra.Types.ASK }, | ||
| // }, | ||
| // { | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.COMPOSITE_UPDATE }, | ||
| // operation: { type: Algebra.Types.COMPOSITE_UPDATE }, | ||
| // }, | ||
@@ -69,3 +69,3 @@ // ], | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.BGP }, | ||
| // operation: { type: Algebra.Types.BGP }, | ||
| // scopedVariables: [ | ||
@@ -110,3 +110,3 @@ // DF.variable('s'), | ||
| // type: 'operation', | ||
| // operation: { type: Algebra.types.BGP }, | ||
| // operation: { type: Algebra.Types.BGP }, | ||
| // children: [ | ||
@@ -113,0 +113,0 @@ // { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"IQuerySource.js","sourceRoot":"","sources":["IQuerySource.ts"],"names":[],"mappings":";;AA8NA,iDAAiD;AACjD,4BAA4B;AAC5B,gCAAgC;AAChC,4CAA4C;AAC5C,uBAAuB;AACvB,oGAAoG;AACpG,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,OAAO;AACP,KAAK;AACL,EAAE;AACF,4CAA4C;AAC5C,uBAAuB;AACvB,sHAAsH;AACtH,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,OAAO;AACP,KAAK;AACL,EAAE;AACF,8CAA8C;AAC9C,uBAAuB;AACvB,oGAAoG;AACpG,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,OAAO;AACP,uBAAuB;AACvB,KAAK;AACL,EAAE;AACF,iEAAiE;AACjE,yBAAyB;AACzB,gBAAgB;AAChB,QAAQ;AACR,2BAA2B;AAC3B,oDAAoD;AACpD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,sDAAsD;AACtD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,qDAAqD;AACrD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,gDAAgD;AAChD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,6DAA6D;AAC7D,SAAS;AACT,OAAO;AACP,KAAK;AACL,EAAE;AACF,yBAAyB;AACzB,6FAA6F;AAC7F,4CAA4C;AAC5C,uBAAuB;AACvB,4CAA4C;AAC5C,uBAAuB;AACvB,wBAAwB;AACxB,OAAO;AACP,gBAAgB;AAChB,QAAQ;AACR,uBAAuB;AACvB,gBAAgB;AAChB,uCAAuC;AACvC,iBAAiB;AACjB,6BAA6B;AAC7B,0GAA0G;AAC1G,+BAA+B;AAC/B,8BAA8B;AAC9B,8BAA8B;AAC9B,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,uBAAuB;AACvB,KAAK;AACL,EAAE;AACF,0BAA0B;AAC1B,eAAe;AACf,wDAAwD;AACxD,gDAAgD;AAChD,yBAAyB;AACzB,gBAAgB;AAChB,QAAQ;AACR,2BAA2B;AAC3B,wGAAwG;AACxG,6BAA6B;AAC7B,4BAA4B;AAC5B,4BAA4B;AAC5B,4BAA4B;AAC5B,WAAW;AACX,2BAA2B;AAC3B,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,gDAAgD;AAChD,oBAAoB;AACpB,YAAY;AACZ,2BAA2B;AAC3B,oBAAoB;AACpB,2CAA2C;AAC3C,qBAAqB;AACrB,iCAAiC;AACjC,8GAA8G;AAC9G,mCAAmC;AACnC,kCAAkC;AAClC,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK","sourcesContent":["import type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { Algebra } from 'sparqlalgebrajs';\nimport type { BindingsStream } from './Bindings';\nimport type { IActionContext } from './IActionContext';\nimport type { MetadataBindings } from './IMetadata';\n\nexport interface IQuerySourceSerialized extends IQuerySourceUnidentifiedExpanded {\n type?: 'serialized';\n value: string;\n mediaType: string;\n baseIRI?: string;\n}\n\nexport interface IQuerySourceUnidentifiedExpanded {\n type?: string;\n value: string | RDF.Source | RDF.Store | RDF.DatasetCore;\n context?: IActionContext;\n}\n\nexport interface IQuerySourceUnidentifiedExpandedRawContext {\n type?: string;\n value: string | RDF.Source | RDF.Store | RDF.DatasetCore;\n context?: Record<string, any>;\n}\n\nexport type QuerySourceUnidentifiedExpanded = IQuerySourceUnidentifiedExpanded | IQuerySourceSerialized;\nexport type QuerySourceUnidentified = string | RDF.Source | RDF.Store | RDF.DatasetCore |\nQuerySourceUnidentifiedExpanded | IQuerySourceUnidentifiedExpandedRawContext;\n\n/**\n * Attaches a context to a query target.\n */\nexport interface IQuerySourceWrapper<Q extends IQuerySource = IQuerySource> {\n source: Q;\n context?: IActionContext;\n}\n\nexport type QuerySourceReference = string | RDF.Source | RDF.DatasetCore;\n\n/**\n * A lazy query source.\n */\nexport interface IQuerySource {\n /**\n * The URL of RDF source of this source.\n */\n referenceValue: QuerySourceReference;\n\n /**\n * Get the selector type that is supported by this source.\n * @param context The action context.\n */\n getSelectorShape: (context: IActionContext) => Promise<FragmentSelectorShape>;\n\n /**\n * Returns a (possibly lazy) stream that returns all bindings matching the operation.\n *\n * Passed operations MUST conform to the query shape exposed by the selector type returned from `getSelectorShape`.\n * The given operation represents a Linked Data Fragments selector.\n *\n * The returned stream MUST expose the property 'metadata' of type `MetadataBindings`.\n * The implementor is reponsible for handling cases where 'metadata'\n * is being called without the stream being in flow-mode.\n * This metadata object can become invalidated (see `metadata.state`),\n * in which case the 'metadata' property must and will be updated.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @param {BindingsStream} options Options for querying bindings\n * @return {AsyncIterator<RDF.Quad>} The resulting bindings stream.\n *\n * @see https://linkeddatafragments.org/specification/linked-data-fragments/#selectors\n */\n queryBindings: (\n operation: Algebra.Operation,\n context: IActionContext,\n options?: IQueryBindingsOptions,\n ) => BindingsStream;\n\n /**\n * Returns a (possibly lazy) stream that returns all quads matching the operation.\n *\n * This method should only be supported if the selector type returned from `getSelectorShape`\n * supports construct queries.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @return {AsyncIterator<RDF.Quad>} The resulting quads stream.\n */\n queryQuads: (\n operation: Algebra.Operation,\n context: IActionContext,\n ) => AsyncIterator<RDF.Quad>;\n\n /**\n * Returns a promise resolving to the ask response of the given operation.\n *\n * This method should only be supported if the selector type returned from `getSelectorShape`\n * supports ask queries.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @return {Promise<boolean>} The resulting ask reply.\n */\n queryBoolean: (\n operation: Algebra.Ask,\n context: IActionContext,\n ) => Promise<boolean>;\n\n /**\n * Returns a promise resolving when the given update operation succeeds.\n *\n * This method should only be supported if the selector type returned from `getSelectorShape`\n * supports update queries.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @return {Promise<boolean>} The void response.\n */\n queryVoid: (\n operation: Algebra.Update,\n context: IActionContext,\n ) => Promise<void>;\n\n /**\n * Returns a string representation of this source.\n */\n toString: () => string;\n}\n\nexport interface IQueryBindingsOptions {\n /**\n * Bindings that must be joined by the source together with the operation.\n * This can only be done if the source accepts joinBindings in the selector shape.\n *\n * The passed bindings may optionally apply to different variables than the query.\n * If this is not the case, then `filterBindings` should be used instead.\n */\n joinBindings?: { bindings: BindingsStream; metadata: MetadataBindings };\n /**\n * Bindings to filter the query operation's result by.\n * This can only be done if the source accepts filterBindings in the selector shape.\n *\n * The caller of this function should ensure that only bindings are being passed that are applicable to the query,\n * which means that a projection and filtering step might be needed beforehand.\n */\n filterBindings?: { bindings: BindingsStream; metadata: MetadataBindings };\n}\n\n/**\n * A fragment selector shape determines the shape of selectors that can be executed by a query source.\n * Selectors conforming to this shape represent boolean functions to decide if triples belong to a query response.\n * @see https://linkeddatafragments.org/specification/linked-data-fragments/#selectors\n */\nexport type FragmentSelectorShape = {\n type: 'operation';\n /**\n * The supported operation.\n */\n operation: {\n operationType: 'type';\n type: Algebra.types;\n } | {\n operationType: 'pattern';\n pattern: Algebra.Operation;\n } | {\n operationType: 'type';\n type: Algebra.types.EXPRESSION;\n /**\n * The extension functions this source supports.\n */\n extensionFunctions?: string[];\n } | {\n /**\n * All possible operations are accepted by this shape.\n * As exception, extension functions are not accepted through wildcards, and must be\n * explicitly listed via `extensionFunctions`.\n */\n operationType: 'wildcard';\n };\n /**\n * Variables that are in-scope in this operation and its children.\n */\n scopedVariables?: RDF.Variable[];\n /**\n * Variables that must be passed to the selector when instantiated.\n */\n variablesRequired?: RDF.Variable[];\n /**\n * Variables that may be passed to the selector when instantiated.\n */\n variablesOptional?: RDF.Variable[];\n /**\n * Children of this operation.\n * If this field is not set, then all operations defined at the top level of the shape are allowed as children.\n */\n children?: FragmentSelectorShape[];\n /**\n * If bindings can be passed into the source as a join.\n */\n joinBindings?: true;\n /**\n * If bindings can be passed into the source as a filter.\n */\n filterBindings?: true;\n} | {\n type: 'conjunction';\n children: FragmentSelectorShape[];\n} | {\n type: 'disjunction';\n children: FragmentSelectorShape[];\n} | {\n type: 'negation';\n child: FragmentSelectorShape;\n} | {\n type: 'arity';\n min?: number;\n max?: number;\n child: FragmentSelectorShape;\n};\n\n// ----- Examples of FragmentSelectorShapes -----\n// const AF = new Factory();\n// const DF = new DataFactory();\n// const shapeTpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// };\n//\n// const shapeQpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o'), DF.variable('g')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// DF.variable('g'),\n// ],\n// };\n//\n// const shapeBrTpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// addBindings: true,\n// };\n//\n// const shapeSparqlEp: FragmentSelectorShape = { // Same as SaGe\n// type: 'disjunction',\n// children: [\n// {\n// type: 'operation',\n// operation: { type: Algebra.types.PROJECT },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.types.CONSTRUCT },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.types.DESCRIBE },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.types.ASK },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.types.COMPOSITE_UPDATE },\n// },\n// ],\n// };\n//\n// // Example of request:\n// // Find ?s matching \"?s dbo:country dbr:norway. ?s dbo:award ?o2. ?s dbo:birthDate ?o3.\"\n// const shapeSpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { type: Algebra.types.BGP },\n// scopedVariables: [\n// DF.variable('s'),\n// ],\n// children: [\n// {\n// type: 'arity',\n// min: 1,\n// max: Number.POSITIVE_INFINITY,\n// child: {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// },\n// },\n// ],\n// addBindings: true,\n// };\n//\n// // Example of requests:\n// // - brTPF\n// // - Find all ?s and ?o matching \"?s db:country ?o\"\n// const shapeSmartKg: FragmentSelectorShape = {\n// type: 'disjunction',\n// children: [\n// {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// addBindings: true,\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.types.BGP },\n// children: [\n// {\n// type: 'arity',\n// min: 1,\n// max: Number.POSITIVE_INFINITY,\n// child: {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesRequired: [\n// DF.variable('p'),\n// ],\n// },\n// },\n// ],\n// },\n// ],\n// };\n"]} | ||
| {"version":3,"file":"IQuerySource.js","sourceRoot":"","sources":["IQuerySource.ts"],"names":[],"mappings":";;AAgPA,iDAAiD;AACjD,4BAA4B;AAC5B,gCAAgC;AAChC,4CAA4C;AAC5C,uBAAuB;AACvB,oGAAoG;AACpG,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,OAAO;AACP,KAAK;AACL,EAAE;AACF,4CAA4C;AAC5C,uBAAuB;AACvB,sHAAsH;AACtH,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,OAAO;AACP,KAAK;AACL,EAAE;AACF,8CAA8C;AAC9C,uBAAuB;AACvB,oGAAoG;AACpG,yBAAyB;AACzB,wBAAwB;AACxB,wBAAwB;AACxB,wBAAwB;AACxB,OAAO;AACP,uBAAuB;AACvB,KAAK;AACL,EAAE;AACF,iEAAiE;AACjE,yBAAyB;AACzB,gBAAgB;AAChB,QAAQ;AACR,2BAA2B;AAC3B,oDAAoD;AACpD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,sDAAsD;AACtD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,qDAAqD;AACrD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,gDAAgD;AAChD,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,6DAA6D;AAC7D,SAAS;AACT,OAAO;AACP,KAAK;AACL,EAAE;AACF,yBAAyB;AACzB,6FAA6F;AAC7F,4CAA4C;AAC5C,uBAAuB;AACvB,4CAA4C;AAC5C,uBAAuB;AACvB,wBAAwB;AACxB,OAAO;AACP,gBAAgB;AAChB,QAAQ;AACR,uBAAuB;AACvB,gBAAgB;AAChB,uCAAuC;AACvC,iBAAiB;AACjB,6BAA6B;AAC7B,0GAA0G;AAC1G,+BAA+B;AAC/B,8BAA8B;AAC9B,8BAA8B;AAC9B,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,uBAAuB;AACvB,KAAK;AACL,EAAE;AACF,0BAA0B;AAC1B,eAAe;AACf,wDAAwD;AACxD,gDAAgD;AAChD,yBAAyB;AACzB,gBAAgB;AAChB,QAAQ;AACR,2BAA2B;AAC3B,wGAAwG;AACxG,6BAA6B;AAC7B,4BAA4B;AAC5B,4BAA4B;AAC5B,4BAA4B;AAC5B,WAAW;AACX,2BAA2B;AAC3B,SAAS;AACT,QAAQ;AACR,2BAA2B;AAC3B,gDAAgD;AAChD,oBAAoB;AACpB,YAAY;AACZ,2BAA2B;AAC3B,oBAAoB;AACpB,2CAA2C;AAC3C,qBAAqB;AACrB,iCAAiC;AACjC,8GAA8G;AAC9G,mCAAmC;AACnC,kCAAkC;AAClC,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK","sourcesContent":["import type { Algebra } from '@comunica/utils-algebra';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { BindingsStream } from './Bindings';\nimport type { IActionContext } from './IActionContext';\nimport type { ILink } from './ILink';\nimport type { MetadataBindings } from './IMetadata';\n\nexport interface IQuerySourceSerialized extends IQuerySourceUnidentifiedExpanded {\n type?: 'serialized';\n value: string;\n mediaType: string;\n baseIRI?: string;\n version?: string;\n}\n\nexport interface IQuerySourceUnidentifiedExpanded {\n type?: string;\n value: string | RDF.Source | RDF.Store | RDF.DatasetCore;\n context?: IActionContext;\n}\n\nexport interface IQuerySourceUnidentifiedExpandedRawContext {\n type?: string;\n value: string | RDF.Source | RDF.Store | RDF.DatasetCore;\n context?: Record<string, any>;\n}\n\nexport interface IQuerySourceTraverse {\n type: 'traverse';\n value: ILink[];\n context?: IActionContext | Record<string, any>;\n}\n\nexport type QuerySourceUnidentifiedExpanded = IQuerySourceUnidentifiedExpanded | IQuerySourceSerialized;\nexport type QuerySourceUnidentified = string | RDF.Source | RDF.Store | RDF.DatasetCore |\nQuerySourceUnidentifiedExpanded | IQuerySourceUnidentifiedExpandedRawContext | IQuerySourceTraverse;\n\n/**\n * Attaches a context to a query target.\n */\nexport interface IQuerySourceWrapper<Q extends IQuerySource = IQuerySource> {\n source: Q;\n context?: IActionContext;\n}\n\nexport type QuerySourceReference = string | RDF.Source | RDF.DatasetCore;\n\n/**\n * A lazy query source.\n */\nexport interface IQuerySource {\n /**\n * The URL of RDF source of this source.\n */\n referenceValue: QuerySourceReference;\n\n /**\n * @return A value from 0 to 1 indicating to what respect a source type is\n * able to pre-filter the source based on the pattern.\n * 1 indicates that the source can apply the whole pattern,\n * and 0 indicates that the source can not apply the pattern at all (and local filtering must happen).\n * Plain RDF documents for example have a filter factor of 0,\n * while SPARQL endpoints have a filter factor of 1.\n */\n getFilterFactor: (context: IActionContext) => Promise<number>;\n\n /**\n * Get the selector type that is supported by this source.\n * @param context The action context.\n */\n getSelectorShape: (context: IActionContext) => Promise<FragmentSelectorShape>;\n\n /**\n * Returns a (possibly lazy) stream that returns all bindings matching the operation.\n *\n * Passed operations MUST conform to the query shape exposed by the selector type returned from `getSelectorShape`.\n * The given operation represents a Linked Data Fragments selector.\n *\n * The returned stream MUST expose the property 'metadata' of type `MetadataBindings`.\n * The implementor is reponsible for handling cases where 'metadata'\n * is being called without the stream being in flow-mode.\n * This metadata object can become invalidated (see `metadata.state`),\n * in which case the 'metadata' property must and will be updated.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @param {BindingsStream} options Options for querying bindings\n * @return {AsyncIterator<RDF.Quad>} The resulting bindings stream.\n *\n * @see https://linkeddatafragments.org/specification/linked-data-fragments/#selectors\n */\n queryBindings: (\n operation: Algebra.Operation,\n context: IActionContext,\n options?: IQueryBindingsOptions,\n ) => BindingsStream;\n\n /**\n * Returns a (possibly lazy) stream that returns all quads matching the operation.\n *\n * This method should only be supported if the selector type returned from `getSelectorShape`\n * supports construct queries.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @return {AsyncIterator<RDF.Quad>} The resulting quads stream.\n */\n queryQuads: (\n operation: Algebra.Operation,\n context: IActionContext,\n ) => AsyncIterator<RDF.Quad>;\n\n /**\n * Returns a promise resolving to the ask response of the given operation.\n *\n * This method should only be supported if the selector type returned from `getSelectorShape`\n * supports ask queries.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @return {Promise<boolean>} The resulting ask reply.\n */\n queryBoolean: (\n operation: Algebra.Ask,\n context: IActionContext,\n ) => Promise<boolean>;\n\n /**\n * Returns a promise resolving when the given update operation succeeds.\n *\n * This method should only be supported if the selector type returned from `getSelectorShape`\n * supports update queries.\n *\n * @param {Algebra.Operation} operation The query operation to execute.\n * @param {IActionContext} context The query context.\n * @return {Promise<boolean>} The void response.\n */\n queryVoid: (\n operation: Algebra.Operation,\n context: IActionContext,\n ) => Promise<void>;\n\n /**\n * Returns a string representation of this source.\n */\n toString: () => string;\n}\n\nexport interface IQueryBindingsOptions {\n /**\n * Bindings that must be joined by the source together with the operation.\n * This can only be done if the source accepts joinBindings in the selector shape.\n *\n * The passed bindings may optionally apply to different variables than the query.\n * If this is not the case, then `filterBindings` should be used instead.\n */\n joinBindings?: { bindings: BindingsStream; metadata: MetadataBindings };\n /**\n * Bindings to filter the query operation's result by.\n * This can only be done if the source accepts filterBindings in the selector shape.\n *\n * The caller of this function should ensure that only bindings are being passed that are applicable to the query,\n * which means that a projection and filtering step might be needed beforehand.\n */\n filterBindings?: { bindings: BindingsStream; metadata: MetadataBindings };\n}\n\n/**\n * A fragment selector shape determines the shape of selectors that can be executed by a query source.\n * Selectors conforming to this shape represent boolean functions to decide if triples belong to a query response.\n * @see https://linkeddatafragments.org/specification/linked-data-fragments/#selectors\n */\nexport type FragmentSelectorShape = {\n type: 'operation';\n /**\n * The supported operation.\n */\n operation: {\n operationType: 'type';\n type: Algebra.Types;\n } | {\n operationType: 'pattern';\n pattern: Algebra.Operation;\n } | {\n operationType: 'type';\n type: Algebra.Types.EXPRESSION;\n /**\n * The extension functions this source supports.\n */\n extensionFunctions?: string[];\n } | {\n /**\n * All possible operations are accepted by this shape.\n * As exception, extension functions are not accepted through wildcards, and must be\n * explicitly listed via `extensionFunctions`.\n */\n operationType: 'wildcard';\n };\n /**\n * Variables that are in-scope in this operation and its children.\n */\n scopedVariables?: RDF.Variable[];\n /**\n * Variables that must be passed to the selector when instantiated.\n */\n variablesRequired?: RDF.Variable[];\n /**\n * Variables that may be passed to the selector when instantiated.\n */\n variablesOptional?: RDF.Variable[];\n /**\n * Children of this operation.\n * If this field is not set, then all operations defined at the top level of the shape are allowed as children.\n */\n children?: FragmentSelectorShape[];\n /**\n * If bindings can be passed into the source as a join.\n */\n joinBindings?: true;\n /**\n * If bindings can be passed into the source as a filter.\n */\n filterBindings?: true;\n} | {\n type: 'conjunction';\n children: FragmentSelectorShape[];\n} | {\n type: 'disjunction';\n children: FragmentSelectorShape[];\n} | {\n type: 'negation';\n child: FragmentSelectorShape;\n} | {\n type: 'arity';\n min?: number;\n max?: number;\n child: FragmentSelectorShape;\n};\n\n// ----- Examples of FragmentSelectorShapes -----\n// const AF = new Factory();\n// const DF = new DataFactory();\n// const shapeTpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// };\n//\n// const shapeQpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o'), DF.variable('g')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// DF.variable('g'),\n// ],\n// };\n//\n// const shapeBrTpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// addBindings: true,\n// };\n//\n// const shapeSparqlEp: FragmentSelectorShape = { // Same as SaGe\n// type: 'disjunction',\n// children: [\n// {\n// type: 'operation',\n// operation: { type: Algebra.Types.PROJECT },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.Types.CONSTRUCT },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.Types.DESCRIBE },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.Types.ASK },\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.Types.COMPOSITE_UPDATE },\n// },\n// ],\n// };\n//\n// // Example of request:\n// // Find ?s matching \"?s dbo:country dbr:norway. ?s dbo:award ?o2. ?s dbo:birthDate ?o3.\"\n// const shapeSpf: FragmentSelectorShape = {\n// type: 'operation',\n// operation: { type: Algebra.Types.BGP },\n// scopedVariables: [\n// DF.variable('s'),\n// ],\n// children: [\n// {\n// type: 'arity',\n// min: 1,\n// max: Number.POSITIVE_INFINITY,\n// child: {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// },\n// },\n// ],\n// addBindings: true,\n// };\n//\n// // Example of requests:\n// // - brTPF\n// // - Find all ?s and ?o matching \"?s db:country ?o\"\n// const shapeSmartKg: FragmentSelectorShape = {\n// type: 'disjunction',\n// children: [\n// {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesOptional: [\n// DF.variable('s'),\n// DF.variable('p'),\n// DF.variable('o'),\n// ],\n// addBindings: true,\n// },\n// {\n// type: 'operation',\n// operation: { type: Algebra.Types.BGP },\n// children: [\n// {\n// type: 'arity',\n// min: 1,\n// max: Number.POSITIVE_INFINITY,\n// child: {\n// type: 'operation',\n// operation: { pattern: AF.createPattern(DF.variable('s'), DF.variable('p'), DF.variable('o')) },\n// variablesRequired: [\n// DF.variable('p'),\n// ],\n// },\n// },\n// ],\n// },\n// ],\n// };\n"]} |
+12
-12
@@ -10,2 +10,14 @@ "use strict"; | ||
| /** | ||
| * All available logging levels. | ||
| * @type {{trace: number; debug: number; info: number; warn: number; error: number; fatal: number}} | ||
| */ | ||
| static LEVELS = { | ||
| trace: 0, | ||
| debug: 1, | ||
| info: 2, | ||
| warn: 3, | ||
| error: 4, | ||
| fatal: 5, | ||
| }; | ||
| /** | ||
| * Convert a string-based logging level to a numerical logging level. | ||
@@ -20,14 +32,2 @@ * @param level A string-based logging level | ||
| exports.Logger = Logger; | ||
| /** | ||
| * All available logging levels. | ||
| * @type {{trace: number; debug: number; info: number; warn: number; error: number; fatal: number}} | ||
| */ | ||
| Logger.LEVELS = { | ||
| trace: 0, | ||
| debug: 1, | ||
| info: 2, | ||
| warn: 3, | ||
| error: 4, | ||
| fatal: 5, | ||
| }; | ||
| //# sourceMappingURL=Logger.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Logger.js","sourceRoot":"","sources":["Logger.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAsB,MAAM;IAe1B;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,KAAa;QACzC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;;AAtBH,wBA8BC;AA7BC;;;GAGG;AAEoB,aAAM,GAA2B;IACtD,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACT,CAAC","sourcesContent":["/**\n * A logger accepts messages from different levels\n * and emits them in a certain way.\n */\nexport abstract class Logger {\n /**\n * All available logging levels.\n * @type {{trace: number; debug: number; info: number; warn: number; error: number; fatal: number}}\n */\n\n public static readonly LEVELS: Record<string, number> = {\n trace: 0,\n debug: 1,\n info: 2,\n warn: 3,\n error: 4,\n fatal: 5,\n };\n\n /**\n * Convert a string-based logging level to a numerical logging level.\n * @param level A string-based logging level\n * @return The numerical logging level, or undefined.\n */\n public static getLevelOrdinal(level: string): number {\n return Logger.LEVELS[level];\n }\n\n public abstract trace(message: string, data?: any): void;\n public abstract debug(message: string, data?: any): void;\n public abstract info(message: string, data?: any): void;\n public abstract warn(message: string, data?: any): void;\n public abstract error(message: string, data?: any): void;\n public abstract fatal(message: string, data?: any): void;\n}\n"]} | ||
| {"version":3,"file":"Logger.js","sourceRoot":"","sources":["Logger.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAsB,MAAM;IAC1B;;;OAGG;IAEI,MAAM,CAAU,MAAM,GAA2B;QACtD,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;KACT,CAAC;IAEF;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAC,KAAa;QACzC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;;AAtBH,wBA8BC","sourcesContent":["/**\n * A logger accepts messages from different levels\n * and emits them in a certain way.\n */\nexport abstract class Logger {\n /**\n * All available logging levels.\n * @type {{trace: number; debug: number; info: number; warn: number; error: number; fatal: number}}\n */\n\n public static readonly LEVELS: Record<string, number> = {\n trace: 0,\n debug: 1,\n info: 2,\n warn: 3,\n error: 4,\n fatal: 5,\n };\n\n /**\n * Convert a string-based logging level to a numerical logging level.\n * @param level A string-based logging level\n * @return The numerical logging level, or undefined.\n */\n public static getLevelOrdinal(level: string): number {\n return Logger.LEVELS[level];\n }\n\n public abstract trace(message: string, data?: any): void;\n public abstract debug(message: string, data?: any): void;\n public abstract info(message: string, data?: any): void;\n public abstract warn(message: string, data?: any): void;\n public abstract error(message: string, data?: any): void;\n public abstract fatal(message: string, data?: any): void;\n}\n"]} |
+5
-5
| { | ||
| "name": "@comunica/types", | ||
| "version": "4.5.0", | ||
| "version": "5.0.0", | ||
| "description": "Typings module for Comunica", | ||
@@ -45,9 +45,9 @@ "lsd:module": true, | ||
| "dependencies": { | ||
| "@comunica/utils-algebra": "^5.0.0", | ||
| "@rdfjs/types": "*", | ||
| "@types/yargs": "^17.0.24", | ||
| "asynciterator": "^3.9.0", | ||
| "lru-cache": "^10.0.1", | ||
| "sparqlalgebrajs": "^5.0.2" | ||
| "asynciterator": "^3.10.0", | ||
| "lru-cache": "^11.2.2" | ||
| }, | ||
| "gitHead": "2bcd98c387a021fc5c08d375793c205ca3d1bf0d" | ||
| "gitHead": "0b1756fdb9bef014133432489627c1bd71779bd0" | ||
| } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
| /// <reference types="node" /> | ||
| import type { EventEmitter } from 'node:events'; | ||
| import type * as RDF from '@rdfjs/types'; | ||
| import type { AsyncIterator } from 'asynciterator'; | ||
| import type { MetadataBindings } from './IMetadata'; | ||
| /** | ||
| * A StreamingStore allows data lookup and insertion to happen in parallel. | ||
| * Concretely, this means that `match()` calls happening before `import()` calls, will still consider those triples that | ||
| * are inserted later, which is done by keeping the response streams of `match()` open. | ||
| * Only when the `end()` method is invoked, all response streams will close, and the StreamingStore will be considered | ||
| * immutable. | ||
| * | ||
| * WARNING: `end()` MUST be called at some point, otherwise all `match` streams will remain unended. | ||
| */ | ||
| export interface IAggregatedStore<Q extends RDF.BaseQuad = RDF.Quad> extends RDF.Source<Q>, RDF.Sink<RDF.Stream<Q>, EventEmitter> { | ||
| /** | ||
| * If this aggregated has started processing. | ||
| */ | ||
| started: boolean; | ||
| /** | ||
| * The sources that are indexed in this store. | ||
| */ | ||
| containedSources: Set<string>; | ||
| /** | ||
| * If iterators created during the `match` call are still running. | ||
| */ | ||
| hasRunningIterators: () => boolean; | ||
| /** | ||
| * Mark this store as ended. | ||
| * | ||
| * This will make sure that all running and future `match` calls will end, | ||
| * and all next `import` calls to this store will throw an error. | ||
| */ | ||
| end: () => void; | ||
| /** | ||
| * Indicate whether or not an IAggregatedStore has ended. | ||
| * @returns {boolean} return true if the store has ended | ||
| */ | ||
| hasEnded: () => boolean; | ||
| /** | ||
| * Register a listener that will be invoked when the store has ended. | ||
| * @param listener A listener. | ||
| */ | ||
| addEndListener: (listener: () => void) => void; | ||
| /** | ||
| * Update the metadata of the base iterator, from which the aggregated store is being populated. | ||
| * @param metadata The metadata object. | ||
| * @param updateState If the metadata state of derived iterators should be immediately updated. | ||
| */ | ||
| setBaseMetadata: (metadata: MetadataBindings, updateStates: boolean) => void; | ||
| /** | ||
| * Register a listener that will be invoked when a new iterator is returned from match(). | ||
| * @param listener A listener. | ||
| */ | ||
| addIteratorCreatedListener: (listener: () => void) => void; | ||
| /** | ||
| * Remove the given iterator creation listener. | ||
| * @param listener A listener. | ||
| */ | ||
| removeIteratorCreatedListener: (listener: () => void) => void; | ||
| match: (subject?: RDF.Term | null, predicate?: RDF.Term | null, object?: RDF.Term | null, graph?: RDF.Term | null) => AsyncIterator<Q>; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=IAggregatedStore.js.map |
| {"version":3,"file":"IAggregatedStore.js","sourceRoot":"","sources":["IAggregatedStore.ts"],"names":[],"mappings":"","sourcesContent":["// eslint-disable-next-line import/no-nodejs-modules\nimport type { EventEmitter } from 'node:events';\nimport type * as RDF from '@rdfjs/types';\nimport type { AsyncIterator } from 'asynciterator';\nimport type { MetadataBindings } from './IMetadata';\n\n/**\n * A StreamingStore allows data lookup and insertion to happen in parallel.\n * Concretely, this means that `match()` calls happening before `import()` calls, will still consider those triples that\n * are inserted later, which is done by keeping the response streams of `match()` open.\n * Only when the `end()` method is invoked, all response streams will close, and the StreamingStore will be considered\n * immutable.\n *\n * WARNING: `end()` MUST be called at some point, otherwise all `match` streams will remain unended.\n */\nexport interface IAggregatedStore<Q extends RDF.BaseQuad = RDF.Quad>\n extends RDF.Source<Q>, RDF.Sink<RDF.Stream<Q>, EventEmitter> {\n /**\n * If this aggregated has started processing.\n */\n started: boolean;\n\n /**\n * The sources that are indexed in this store.\n */\n containedSources: Set<string>;\n\n /**\n * If iterators created during the `match` call are still running.\n */\n hasRunningIterators: () => boolean;\n\n /**\n * Mark this store as ended.\n *\n * This will make sure that all running and future `match` calls will end,\n * and all next `import` calls to this store will throw an error.\n */\n end: () => void;\n\n /**\n * Indicate whether or not an IAggregatedStore has ended.\n * @returns {boolean} return true if the store has ended\n */\n hasEnded: () => boolean;\n\n /**\n * Register a listener that will be invoked when the store has ended.\n * @param listener A listener.\n */\n addEndListener: (listener: () => void) => void;\n\n /**\n * Update the metadata of the base iterator, from which the aggregated store is being populated.\n * @param metadata The metadata object.\n * @param updateState If the metadata state of derived iterators should be immediately updated.\n */\n setBaseMetadata: (metadata: MetadataBindings, updateStates: boolean) => void;\n\n /**\n * Register a listener that will be invoked when a new iterator is returned from match().\n * @param listener A listener.\n */\n addIteratorCreatedListener: (listener: () => void) => void;\n /**\n * Remove the given iterator creation listener.\n * @param listener A listener.\n */\n removeIteratorCreatedListener: (listener: () => void) => void;\n\n match: (\n subject?: RDF.Term | null,\n predicate?: RDF.Term | null,\n object?: RDF.Term | null,\n graph?: RDF.Term | null,\n ) => AsyncIterator<Q>;\n}\n"]} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
178380
7.06%92
4.55%1435
6.45%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated