Class SparqlExpressionFactory
Factory Class for generating Expressions for Sparql Extension Functions.
Inherited Members
Namespace: VDS.RDF.Query.Expressions
Assembly: dotNetRdf.dll
Syntax
public static class SparqlExpressionFactory
Remarks
Allows for users of the Library to implement and register Custom Expression Factories which can generate Expressions for their own Extension functions which they wish to use in their SPARQL queries. Custom factories may be globally scoped by registering them with the AddCustomFactory() method or locally by passing them to the four argument constructor of the CreateExpression() method.
Properties
| Edit this page View SourceFactories
Gets the Global Custom Expression Factories that are in use.
Declaration
public static IEnumerable<ISparqlCustomExpressionFactory> Factories { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ISparqlCustomExpressionFactory> |
Methods
| Edit this page View SourceAddCustomFactory(ISparqlCustomExpressionFactory)
Registers a Custom Expression Factory.
Declaration
public static void AddCustomFactory(ISparqlCustomExpressionFactory factory)
Parameters
Type | Name | Description |
---|---|---|
ISparqlCustomExpressionFactory | factory | A Custom Expression Factory. |
CreateExpression(Uri, List<ISparqlExpression>, bool)
Tries to create an Expression from the given function Uri and list of argument expressions.
Declaration
public static ISparqlExpression CreateExpression(Uri u, List<ISparqlExpression> args, bool allowUnknownFunctions)
Parameters
Type | Name | Description |
---|---|---|
Uri | u | Function Uri. |
List<ISparqlExpression> | args | List of Argument Expressions. |
bool | allowUnknownFunctions | Specifies whether functions that cannot be parsed into expressions should be represented by the UnknownFunction. |
Returns
Type | Description |
---|---|
ISparqlExpression |
Remarks
Uses only the globally scoped custom expression factories.
CreateExpression(Uri, List<ISparqlExpression>, Dictionary<string, ISparqlExpression>, IEnumerable<ISparqlCustomExpressionFactory>, bool)
Tries to create an Expression from the given function Uri and list of argument expressions.
Declaration
public static ISparqlExpression CreateExpression(Uri u, List<ISparqlExpression> args, Dictionary<string, ISparqlExpression> scalarArgs, IEnumerable<ISparqlCustomExpressionFactory> factories, bool allowUnknownFunctions)
Parameters
Type | Name | Description |
---|---|---|
Uri | u | Function Uri. |
List<ISparqlExpression> | args | List of Argument Expressions. |
Dictionary<string, ISparqlExpression> | scalarArgs | Scalar Arguments. |
IEnumerable<ISparqlCustomExpressionFactory> | factories | Enumeration of locally scoped expression factories to use. |
bool | allowUnknownFunctions | Specifies whether functions that cannot be parsed into expressions should be represented by the UnknownFunction. |
Returns
Type | Description |
---|---|
ISparqlExpression |
Remarks
Globally scoped custom expression factories are tried first and then any locally scoped expression factories are used.
CreateExpression(Uri, List<ISparqlExpression>, IEnumerable<ISparqlCustomExpressionFactory>, bool)
Tries to create an Expression from the given function Uri and list of argument expressions.
Declaration
public static ISparqlExpression CreateExpression(Uri u, List<ISparqlExpression> args, IEnumerable<ISparqlCustomExpressionFactory> factories, bool allowUnknownFunctions)
Parameters
Type | Name | Description |
---|---|---|
Uri | u | Function Uri. |
List<ISparqlExpression> | args | List of Argument Expressions. |
IEnumerable<ISparqlCustomExpressionFactory> | factories | Enumeration of locally scoped expression factories to use. |
bool | allowUnknownFunctions | Specifies whether functions that cannot be parsed into expressions should be represented by the UnknownFunction. |
Returns
Type | Description |
---|---|
ISparqlExpression |
Remarks
Globally scoped custom expression factories are tried first and then any locally scoped expression factories are used.