Parameter Meta-modeling vocabulary .1 ParamerizableType

46 Copyright © 2015 Open Geospatial Consortium. instance of the ParameterizaleObject that binds the value of the parameter. The localName of the property is used a parameter name variable in the query. optional Boolean indicating whether or not the parameter is optional. False by default. xsd:boolean 0..1 valueType The value type is defined by a Resource which can be a Class or a Datatype. Resource 1 defaultValue The default value of the parameter if no value is bound to a parameter Same type than the ValueType 0..1

11.4.3 Modeling Functions

The SPARQL language provides a mechanism to extend the query language with function extensions. For example, GeoSPARQL provides a set of spatial functions that extend the built-in SPARQL functions to support spatial queries. These functions are implemented based on proprietary mechanisms specific to SPARQL engines. For example, both Jena and Sesame APIs provide a Function Registry where you can programmatically register custom functions. The SPARQL Extension ontology provides a vocabulary to express functions in declarative manner that can be shared using Linked Data standards. The extensions can be automatically registered in SPARQL Engine using a wrapper mechanism. If a function encountered in a SPARQL engine is not known in a SPARQL engine, then the engine can follow the link to the function URI to get all the triples needed to understand how to execute it. This assumes that the URI of the function is de-referencable. The vocabulary enables the construction of a web of functions that can be leverage by SPARQL engines to augment their capabilities. Functions play an important role in semantic mediation as many concept and property mappings require some transformations of one or more values to another one. The ability to express these functions declaratively favors reusability of mapping functions across mappings. Copyright © 2015 Open Geospatial Consortium. 47 Best practice Use resolvable URIs for identifying custom functions, so they can be fetched by SPARQL engine when they cannot be resolved locally.

11.4.3.1 Function

The Function concept is a ParameterizableType that can be used to define new SPARQL functions so that these new function can be used in expressions such as FILTER or BIND clauses. Functions are defined by a body and zero or more parameter descriptors sometimes called arguments. The body of a function must be an Ask query, or a Select query with exactly one result variable that is compatible with the return type associated with the function. The function can also be associated with a string symbol. The function themselves are classes that are instances of this metaclass. Function calls are instances of the function classes, with property values for the arguments. Table 16 summarizes the properties of Function. Table 16 Function Properties Name Definition Type Multiplicity body The body of the function expressed as a SPARQL Select or Ask predicate function Ask or Select 1 returnType The value type of the return value of the function. If the body is a Ask instance, the returnType should xsd:boolean. Resource 1 symbol A symbol associated with function used for display or parser. string 0..1 hasParameter Inherited Property from ParameterizableType that define the parameters of the function Parameter 0..n The following listing shows the definition of the function ChangeNamespace which takes two parameters: arg1 and targetNamespace.