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 booleanuseGraphPrefixes
-
Constructor Summary
Constructors Constructor Description SPARQLSubstitutions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddMessageVarNames(String labelTemplate, Set<String> results)static org.apache.jena.query.QueryExecutioncreateQueryExecution(org.apache.jena.query.Query query, org.apache.jena.query.Dataset dataset, org.apache.jena.query.QuerySolution bindings)static org.apache.jena.query.QuerysubstitutePaths(org.apache.jena.query.Query query, String pathString, org.apache.jena.rdf.model.Model model)static StringwithPrefixes(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.LiteralwithSubstitutions(org.apache.jena.rdf.model.Literal template, org.apache.jena.query.QuerySolution bindings, Function<org.apache.jena.rdf.model.RDFNode,String> labelFunction)
-
-
-
Method Detail
-
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
-
-