How to use the sparqlee.isExpressionError function in sparqlee

To help you get started, we’ve selected a few sparqlee examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github comunica / comunica / packages / actor-query-operation-extend / lib / ActorQueryOperationExtend.ts View on Github external
const transform = async (bindings: Bindings, next: any) => {
      try {
        const result = await evaluator.evaluate(bindings);
        // Extend operation is undefined when the key already exists
        // We just override it here.
        const extended = bindings.set(extendKey, result);
        bindingsStream._push(extended);
      } catch (err) {
        if (isExpressionError(err)) {
          // Errors silently don't actually extend according to the spec
          bindingsStream._push(bindings);
          // But let's warn anyway
          this.logWarn(context, `Expression error for extend operation with bindings '${JSON.stringify(bindings)}'`);
        } else {
          bindingsStream.emit('error', err);
        }
      }
      next();
    };
github comunica / comunica / packages / actor-query-operation-filter-sparqlee / lib / ActorQueryOperationFilterSparqlee.ts View on Github external
const transform = async (item: Bindings, next: any) => {
      try {
        const result = await evaluator.evaluateAsEBV(item);
        if (result) {
          bindingsStream._push(item);
        }
      } catch (err) {
        if (!isExpressionError(err)) {
          bindingsStream.emit('error', err);
        }
      }
      next();
    };
github comunica / comunica / packages / actor-query-operation-leftjoin-nestedloop / lib / ActorQueryOperationLeftJoinNestedLoop.ts View on Github external
transform: async (innerItem: Bindings, nextInner: any) => {
            const joinedBindings = ActorRdfJoin.join(outerItem, innerItem);
            if (!joinedBindings) { nextInner(); return; }
            if (!pattern.expression) {
              joinedStream._push({ joinedBindings, result: true });
              nextInner();
              return;
            }
            try {
              const result = await evaluator.evaluateAsEBV(joinedBindings);
              joinedStream._push({ joinedBindings, result });
            } catch (err) {
              if (!isExpressionError(err)) {
                bindingsStream.emit('error', err);
              }
            }
            nextInner();
          },
        });
github comunica / comunica / packages / actor-query-operation-orderby-sparqlee / lib / ActorQueryOperationOrderBySparqlee.ts View on Github external
const transform = async (bindings: Bindings, next: any) => {
        try {
          const result = await evaluator.evaluate(bindings);
          transformedStream._push({ bindings, result });
        } catch (err) {
          if (!isExpressionError(err)) {
            bindingsStream.emit('error', err);
          }
          transformedStream._push({ bindings, result: undefined });
        }
        next();
      };
      const transformedStream = bindingsStream.transform({ transform });

sparqlee

A simple SPARQL expression evaluator library

MIT
Latest version published 1 year ago

Package Health Score

45 / 100
Full package analysis