Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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') ],
));
async function run() {
process.stdout.write(toSparql(await new Converter().graphqlToSparqlAlgebra(query, context)) + '\n');
}
run();
public static patternToSelectQuery(pattern: RDF.Quad): string {
const variables: RDF.Variable[] = getVariables(getTerms(pattern));
return toSparql(ActorRdfResolveQuadPatternSparqlJson.FACTORY.createProject(
ActorRdfResolveQuadPatternSparqlJson.patternToBgp(pattern),
variables,
));
}