How to use the platform/api/sparql.SparqlUtil.parseQuerySync function in platform

To help you get started, we’ve selected a few platform 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 researchspace / researchspace / researchspace / web / src / main / components / arguments / BeliefsUtil.ts View on Github external
function propSetForAssertedBelief(
  belief: AssertedBelief
): Kefir.Property {
  const query =
    buildQueryForAssertedBelief(
      SparqlUtil.parseQuerySync(belief.field.insertPattern), belief.isCanonical
    );
  return SparqlClient.construct(
    SparqlClient.setBindings(query, {'subject': belief.target, 'value': belief.targetValue})
  );
}
github researchspace / researchspace / researchspace / web / src / main / components / arguments / BeliefsUtil.ts View on Github external
function propSetForArgumentsBelief(belief: ArgumentsFieldBelief): Kefir.Property {
  const query =
    buildQueryForArgumentsBelief(
      SparqlUtil.parseQuerySync(belief.field.insertPattern)
    );
  return SparqlClient.construct(
    SparqlClient.setBindings(query, {'subject': belief.target})
  );

}
github researchspace / researchspace / metaphactory / web / src / main / components / semantic / lazy-tree / SemanticTreeInput.ts View on Github external
private createQueryModel(props: SemanticTreeInputProps): State {
    try {
      const model = new SparqlNodeModel({
        rootsQuery: SparqlUtil.parseQuerySync(props.rootsQuery),
        childrenQuery: SparqlUtil.parseQuerySync(props.childrenQuery),
        parentsQuery: SparqlUtil.parseQuerySync(props.parentsQuery),
        limit: ITEMS_LIMIT,
        sparqlOptions: () => ({context: this.context.semanticContext}),
      });
      const searchQuery = SparqlUtil.parseQuerySync(props.searchQuery);
      return {model, searchQuery};
    } catch (loadError) {
      return {loadError};
    }
  }
github researchspace / researchspace / metaphacts-platform / web / src / main / components / semantic / search / data / search / SparqlQueryGenerator.ts View on Github external
function parseQueryPattern(queryPattern: string, projectionVariable: string): SparqlJs.SelectQuery {
  const query = SparqlUtil.parseQuerySync(`SELECT * {{ ${queryPattern} }}`);
  return rewriteProjectionVariable(query, projectionVariable);
}
github researchspace / researchspace / metaphactory / web / src / main / components / semantic / lazy-tree / SemanticTreeInput.ts View on Github external
private createQueryModel(props: SemanticTreeInputProps): State {
    try {
      const model = new SparqlNodeModel({
        rootsQuery: SparqlUtil.parseQuerySync(props.rootsQuery),
        childrenQuery: SparqlUtil.parseQuerySync(props.childrenQuery),
        parentsQuery: SparqlUtil.parseQuerySync(props.parentsQuery),
        limit: ITEMS_LIMIT,
        sparqlOptions: () => ({context: this.context.semanticContext}),
      });
      const searchQuery = SparqlUtil.parseQuerySync(props.searchQuery);
      return {model, searchQuery};
    } catch (loadError) {
      return {loadError};
    }
  }