Class SPARQLSubstitutions

java.lang.Object
org.topbraid.shacl.validation.sparql.SPARQLSubstitutions

public class SPARQLSubstitutions extends Object
Collects various helper algorithms currently used by the SPARQL execution language.
Author:
Holger Knublauch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addMessageVarNames(String labelTemplate, Set<String> results)
     
    static org.apache.jena.query.QueryExecution
    createQueryExecution(org.apache.jena.query.Query query, org.apache.jena.query.Dataset dataset, org.apache.jena.query.QuerySolution bindings)
     
    static org.apache.jena.query.Query
    substitutePaths(org.apache.jena.query.Query query, String pathString, org.apache.jena.rdf.model.Model model)
     
    static String
    withPrefixes(String str, org.apache.jena.rdf.model.Resource executable)
    Gets a parsable SPARQL string based on a fragment and prefix declarations.
    static org.apache.jena.rdf.model.Literal
    withSubstitutions(org.apache.jena.rdf.model.Literal template, org.apache.jena.query.QuerySolution bindings, Function<org.apache.jena.rdf.model.RDFNode,String> labelFunction)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • useGraphPrefixes

      public static boolean useGraphPrefixes
  • Constructor Details

    • SPARQLSubstitutions

      public SPARQLSubstitutions()
  • Method Details

    • addMessageVarNames

      public static void addMessageVarNames(String labelTemplate, Set<String> results)
    • createQueryExecution

      public static org.apache.jena.query.QueryExecution createQueryExecution(org.apache.jena.query.Query query, org.apache.jena.query.Dataset dataset, org.apache.jena.query.QuerySolution bindings)
    • substitutePaths

      public static org.apache.jena.query.Query substitutePaths(org.apache.jena.query.Query query, String pathString, org.apache.jena.rdf.model.Model model)
    • withSubstitutions

      public static org.apache.jena.rdf.model.Literal withSubstitutions(org.apache.jena.rdf.model.Literal template, org.apache.jena.query.QuerySolution bindings, Function<org.apache.jena.rdf.model.RDFNode,String> labelFunction)
    • withPrefixes

      public static String withPrefixes(String str, org.apache.jena.rdf.model.Resource executable)
      Gets a parsable SPARQL string based on a fragment and prefix declarations. Depending on the setting of the flag useGraphPrefixes, this either uses the prefixes from the Jena graph of the given executable, or strictly uses sh:prefixes.
      Parameters:
      str - the query fragment (e.g. starting with SELECT)
      executable - the sh:SPARQLExecutable potentially holding the sh:prefixes
      Returns:
      the parsable SPARQL string