SMWP - Parameter
 

Index

Introduction
Differences
Installation I
Installation II
Installation III
Uninstall

Working with SMWP

Parameter
Fragement Class
Page Class
XML Document (Page)



4.4 Create Parameter

There are three types of parameters which can be defined.

  • value parameter defining a new relation
  • value parameter using an existing relation
  • predicate parameter

4.4.1 Create Value Parameter (creating a Reference Relation)

Syntax

"CREATE VALUE BASED PARAMETER" paramName
"ON" className
"CREATE REFERENCE RELATION"
"SYNC-POLICY" ("expansive" | "synchronized")";"

Creates a reference relation with the name "RV_" className "_" paramName. containing one column paramName. The created reference relation provides the parameter domain for the resulting fragments. It gets the values for from column paramName from the corresponding column of the application relation.

Preconditions

  • paramName must match one column in the root fragment class relation
  • parameters can be defined upon root fragment classes only (e.g. wineries<name> is a invalid className while wineries<> is valid)
  • if the root fragment class for className is not defined yet, it will be defined implicit

SNYC-POLICY defines the way the created reference relation is mapped to its corresponding fragment class relation. expansive states, that the parameter values of the fragment class relation are a subset of the parameter values within the reference relation. All parameter values contained in fragment class relation must also exist in its reference relation. Inserted new parameter values into the root fragment class relation are automatically inserted in the corresponding reference relation. synchronized signals that all parameter values of the fragment class relation must match the parameter values in its reference relation and vice versa.


Example 1

CREATE VALUE BASED PARAMETER region
ON wineries<>
CREATE REFERENCE RELATION
SYNC-POLICY expansive;

Creates the parameter region upon root fragment class wineries<>. The name of the root fragment class wineries<> must match the name of the corresponding application relation wineries. The reference relation rv_wineries_region contains the column region which is filled with distinct values from its dependent root fragment class relation.


Figure 5: Create new reference relation for value parameter

The parameter expansive signals that all values contained by column region in fragment class relation wineries<> have to be a subset of the created reference relation. New parameter values in the fragment class relation are automatically being inserted into the reference relation. Deleted parameter values persist within the reference relation.

4.4.2 Create Value Parameter (use existing Relation as Reference Relation)

Syntax

"CREATE VALUE BASED PARAMETER" paramName
"ON" className
"USE REFERENCE RELATION" relationName "(" columnName ");"

An existing relation is being used as reference relation. No new relation is being created. The column columnName of relation relationName will be used as parameter domain. This mapped column columnName is used as parameter paramName which is defined upon root fragment class className.

Preconditions

  • paramName must match one column in the root fragment class relation
  • column columnName of relation tableName has to have the same data type as column paramName in fragment class relation
  • parameters may be defined upon root fragment classes only (e.g. wineries<region> is a invalid className where wineries<> is valid)
  • if the root fragment class className is not defined yet, it will be defined implicit

Example 2

CREATE VALUE BASED PARAMETER region
ON wineries<>
USE REFERENCE RELATION regions (id);

The column id of relation regions is defined as parameter region for fragment class wineries<>. The fragment class relation must have a column named region, which uses the same data type like the column id of reference relation regions.


Figure 6: Use an existing relation as reference relation for value parameter

4.4.3 Create Predicate Parameter

Syntax

"CREATE PREDICATE BASED PARAMETER" paramName
"ON" className
"PREDICATES ('" labelName "',[" labelValue "])"
{ ",('" labelName "',[" labelValue "])" }";"

Creates a reference relation for the parameter paramName with the name "RV_" className "_" paramName and the columns paramName and predicate. The predicate parameter is a special form of the value parameter. Every value parameter can be transformed into a predicate parameter. A value parameter contains all valid parameter values in its reference relation. Predicate parameters detect valid tuples by using SQL-expressions named labelValue. Every labelValue is mapped with a labelName which is used, for tuples of the fragment class relation which comply with the labelValue. Fragment class relations which introduce predicate parameters are used the same way as fragment class relations with value parameters.

Example 3

CREATE PREDICATE BASED PARAMETER rCateg
ON rankings<>
PREDICATES {
('Top10', [rank<=10]),
('Top25', [rank>10 AND rank<26]),
('Top100',[rank>25 AND rank<101])
('other', [rank>100]};

Creates the reference relation rv_rankings_rcateg which contains the columns rcateg and predicate. Label names ('Top10', 'Top25', ...) are stored in column rCateg, while their label predicates SQL-statements (e.g. 'rank<=10') are stored in column predicate.


Figure 7: Create reference relation for value parameter

4.5 Modify Parameter

Modifying parameters is not intended by the SMWP approach. In order to modify a parameter it has to be deleted (see 4.6 Delete Parameter) an newly created (see 4.4 Create Parameter).

4.6 Delete Parameter

Syntax

"DROP PARAMETER" paramName "DEFINED UPON" className ";"

Deleting parameter works the same way for all types of parameters. Parameters which are being used by fragment classes can not be deleted. Deleting a parameter also deletes its reference relation. If the parameter uses an existing relation as reference relation (see 4.4.2 Create Value Parameter (use existing Relation) it will not be deleted.

Example 4

DROP PARAMETER region DEFINED UPON wineries<>;

Deletes the parameter named region which is defined upon root fragment class wineries<>.

4.7 Display Parameters

Syntax

"SHOW PARAMETER" (paramName | "*") ["DEFINED UPON" className ];

Displays generated parameter. The displayed parameters are filtered by providing parameter name and or fragment class name. Thereby is it possible to display:

  • all parameters using a designated name
  • all parameters used by a given fragment class
  • all parameters defined upon a given root fragment class

These options are visualized by the following examples. A single parameter displays itself using following example:

   . PARAMETER NAME:           RCATEG	
. defied on Fragment Class: RANKINGS<>
- Parameter Type: predicate
- Reference Relation: RP_RANKINGS_RCATEG

"PARAMETER NAME" and "defined upon Fragment Class" show parameter name and fragment class. The fragment class is a root fragment class. "Parameter Type" shows if the parameter is a value or a predicate parameter. (see 4.3.1 Parameter)

Example 4

SHOW PARAMETER *;

Displays all defined parameters in a list.

Show all defined Parameters	
---------------------------
. PARAMETER NAME: RCATEG
. defied on Fragment Class: RANKINGS<>
- Parameter Type: predicate
- Reference Relation: RP_RANKINGS_RCATEG
Parameters found: 1

Example 5

SHOW PARAMETER * DEFINED UPON wineries<>;

Shows all parameter which are defined upon root fragment class wineries<>.

Example 6

SHOW PARAMETER * DEFINED UPON wineries<region>;

Shows all parameter which are used in fragment class wineries<region>.

Example 7

SHOW PARAMETER region;

Shows all defined parameter which use the parameter name region.

Example 8

SHOW PARAMETER region DEFINED UPON wineries<>;

Displays one specific parameter, which is designated by name region and defined upon root fragment class wineries<>.

Example 9

SHOW PARAMETER region DEFINED UPON wineries<region>;

Displays one specific parameter, which is designated by name region and is being used by fragment class wineries<region>.