Package org.eclipse.rdf4j.federated.util
Class FedXUtil
- java.lang.Object
-
- org.eclipse.rdf4j.federated.util.FedXUtil
-
public class FedXUtil extends Object
General utility functions- Since:
- 5.0
- Author:
- Andreas Schwarte
-
-
Constructor Summary
Constructors Constructor Description FedXUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyMaxQueryExecutionTime(Operation operation, FederationContext federationContext)Set a maximum execution time corresponding toFedXConfig.getEnforceMaxQueryTime()to this operation.static voidapplyQueryBindings(SailQuery query)Apply query bindings to transfer information from the query into the evaluation routine, e.g.static StringgetIncrementalUUID()Hexadecimal representation of an incremental integer.static IRIiri(String iri)static Literalliteral(String literal)static Resource[]toContexts(StatementPattern stmt, Dataset dataset)Retrieve the contexts from theStatementPatternandDataset.static Resource[]toContexts(Dataset ds)Convert the givenDatasetto an array of contextsstatic DatasettoDataset(Resource[] contexts)Convert the given contexts to aDatasetrepresentation.static DatasettoDataset(StatementPattern stmt, Dataset dataset)static ValueFactoryvalueFactory()
-
-
-
Method Detail
-
literal
public static Literal literal(String literal)
- Parameters:
literal-- Returns:
- the string literal
-
valueFactory
public static ValueFactory valueFactory()
- Returns:
- a
SimpleValueFactoryinstance
-
applyQueryBindings
public static void applyQueryBindings(SailQuery query)
Apply query bindings to transfer information from the query into the evaluation routine, e.g. the query execution time.- Parameters:
query-
-
getIncrementalUUID
public static String getIncrementalUUID()
Hexadecimal representation of an incremental integer.- Returns:
- an incremental hex UUID
-
applyMaxQueryExecutionTime
public static void applyMaxQueryExecutionTime(Operation operation, FederationContext federationContext)
Set a maximum execution time corresponding toFedXConfig.getEnforceMaxQueryTime()to this operation. Note that this is an upper bound only as FedX applies other means for evaluation the maximum query execution time.- Parameters:
operation- theOperationfederationContext- theFederationContext
-
toDataset
public static Dataset toDataset(Resource[] contexts)
Convert the given contexts to aDatasetrepresentation.- Parameters:
contexts-- Returns:
-
toContexts
public static Resource[] toContexts(Dataset ds)
Convert the givenDatasetto an array of contexts- Parameters:
ds-- Returns:
-
toContexts
public static Resource[] toContexts(StatementPattern stmt, Dataset dataset)
Retrieve the contexts from theStatementPatternandDataset.- Parameters:
stmt-dataset-- Returns:
-
toDataset
public static Dataset toDataset(StatementPattern stmt, Dataset dataset)
Returns aDatasetrepresentation of the givenStatementPatternandDataset.If the
StatementPatterndoes not have a context value, theDatasetis returned as-is, which may also benull.Otherwise the newly constructed
Datasetcontains all information from the original one plus the context from the statement.- Parameters:
stmt-dataset-- Returns:
-
-