The D2RML Operators & Functions (D2RML‑OP) Specification

This document describes the D2RML Operators & Functions [[D2RMLOPVoc]] vocabulary.

Introduction

D2RML-OP provides a vocabulary for the description of operators, parameters and functions consuming parameters and producing results.

D2RML-OP descriptions are written in Turtle syntax [[TURTLE]].

Document Conventions

In this document, examples assume the following namespace prefix bindings unless otherwise stated:

Table 1: Namespaces used by this document.
Namespace prefix Namespace URI
drop http://islab.ntua.gr/ns/d2rml-op#
xpfn http://www.w3.org/2005/xpath-functions
xsd http://www.w3.org/2001/XMLSchema#

Overview

The classes defined by D2RML-OP are shown in Figure 1.

D2RML-OP classes
D2RML-OP classes.

Parameters

A parameter represents an entity that can be identified in some way and can be assigned a value. A parameter is an instance the drop:Parameter class. Identification can be done either by position in a list of parameters or by name. If by position, the order should be specified using the drop:position position. The lowest position is assumed to be 0. If by name, the name should be specified using the drop:name. A parameter should have a type, specified using the drop:type property, may be optional, which is specified using the drop:required, and may have a drop:defaultValue. If the type of a parameter is a container type, e.g. rdf:List, the type of its elements are specified by the drop:type.

Results

A result represents an entity that describes an output. A result is an instance the drop:Result class. If may have name, specified using the drop:name. A result should have a type, specified using the drop:type property. If the type of a parameter is a container type, e.g. rdf:List, the type of its elements are specified by the drop:type.

Functions

A function represents an entity that takes some parameters and produces some results. The class of functions is drop:Function.

Function descriptions

A function description provides information about the parameters and the results of a function, either of a D2RML-FN function or of a function defined in another vocabulary.

A function description is an instance of the drop:FunctionDescription class. The function that the description describes is specified by the drop:describes property. The parameters that the function expects are specified by one or more drop:parameter properties with object a drop:Parameter, or by a drop:parameters property with object a list of drop:Parameters.

A parameter specified by a drop:parameter property, should provide its means of identification, i.e. a name or position, or both. The list of parameters specified by a drop:parameters may not provide a means of identifications, as they obtain a position from their position in the list. If thery are provided they should be compatible with their posistion in the list.

The results that the function produces are specified by one or more drop:results properties with object a drop:Result, or by a drop:results property with object a list of drop:Results.

Operator

An operator represents an entity that is applied on some operands. The class of operators is drop:Operator.

Examples

XPath substring function

XPath [[xpath-functions-31]] defines the function substring. Using D2RML-OP, this function could be described by the two ways shown below.


<#XPathSubstringDescription1>  
   a drop:FunctionDescription ;
   drop:describes xpfn:substring ;
   drop:parameter [
      drop:name "sourceString";
      drop:datatype xsd:string ;
   ] ;
   drop:parameter [
      drop:name "start";
      drop:datatype xsd:double ;
   ] ;
   drop:parameter [
      drop:name "length";
      drop:datatype xsd:double ;
      drop:required false ; 
   ] 
   drop:result [
      drop:datatype xsd:string ;
   ] ;
				

<#XPathSubstringDescription2>  
   a drop:FunctionDescription ;
   drop:describes xpfn:substring ;
   drop:parameters ( [
      drop:datatype xsd:string ;
   ] [
      drop:datatype xsd:double ;
   ] [
      drop:datatype xsd:double ;
      drop:required false ; 
   ] ) ;
   drop:result [
      drop:datatype xsd:string ;
   ] .
				

D2RML-OP matches function


<#DropMatchDescription>  
   a drop:FunctionDescription ;
   drop:describes drop:matches ;
   drop:parameter [
      drop:name "input";
      drop:datatype xsd:string ;
   ] ;
   drop:parameter [   
      drop:name "pattern";
      drop:datatype xsd:string ;
   ] ;
   drop:result [
      drop:name "match" ;
      drop:datatype rdf:List ;
      drop:containedDatatype xsd:string ;
   ] .