How to use the sparqlalgebrajs.toSparql function in sparqlalgebrajs

To help you get started, we’ve selected a few sparqlalgebrajs 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-rdf-resolve-quad-pattern-sparql-json / lib / ActorRdfResolveQuadPatternSparqlJson.ts View on Github external
public static patternToCountQuery(pattern: RDF.Quad): string {
    return toSparql(ActorRdfResolveQuadPatternSparqlJson.FACTORY.createProject(
      ActorRdfResolveQuadPatternSparqlJson.FACTORY.createExtend(
        ActorRdfResolveQuadPatternSparqlJson.FACTORY.createGroup(
          ActorRdfResolveQuadPatternSparqlJson.patternToBgp(pattern),
          [],
          [ActorRdfResolveQuadPatternSparqlJson.FACTORY.createBoundAggregate(
            variable('var0'),
            'count',
            ActorRdfResolveQuadPatternSparqlJson.FACTORY.createTermExpression(namedNode('*')),
            false,
          )],
        ),
        variable('count'),
        ActorRdfResolveQuadPatternSparqlJson.FACTORY.createTermExpression(variable('var0')),
      ),
      [ variable('count') ],
    ));
github rubensworks / graphql-to-sparql.js / bin / graphql-to-sparql.ts View on Github external
async function run() {
  process.stdout.write(toSparql(await new Converter().graphqlToSparqlAlgebra(query, context)) + '\n');
}
run();
github comunica / comunica / packages / actor-rdf-resolve-quad-pattern-sparql-json / lib / ActorRdfResolveQuadPatternSparqlJson.ts View on Github external
public static patternToSelectQuery(pattern: RDF.Quad): string {
    const variables: RDF.Variable[] = getVariables(getTerms(pattern));
    return toSparql(ActorRdfResolveQuadPatternSparqlJson.FACTORY.createProject(
      ActorRdfResolveQuadPatternSparqlJson.patternToBgp(pattern),
      variables,
    ));
  }

sparqlalgebrajs

Convert SPARQL to SPARQL algebra

MIT
Latest version published 4 months ago

Package Health Score

62 / 100
Full package analysis

Similar packages