OpenRub

Syntax

OpenRubResult OpenRub(OdId tObject, OpenRubArg tArg)

Parameters

tObject. Moniker of the repository object that is a time series database.

tArg. Operation execution parameters.

Description

The OpenRub operation opens a time series database and returns context required to work with its structure.

Comments

To execute the operation, in the tObject field specify moniker of the object that is a time series database, and in the tArg field define opening parameters. Object moniker can be obtained on executing the GetObjects operation. The tArg parameter may contain values of the parameters that will be sent to parametric objects and the metadata getting pattern. The pattern indicates the information to be obtained on opening.

The operation results in the opened time series database instance moniker, and also the metadata if the tArg.metaGet pattern was defined on executing the operation. To further work with the time series database structure, use the GetRubMd operation. The obtained moniker is also used in the OpenHie operation to get access to the hierarchy of indicators stored in the database. To close the opened time series database instance, use the CloseRub operation.

Example

Below is the example of opening time series database. The request contains moniker of the repository object that is a time series database, and the pattern for getting information by time series database attributes and period. The response contains moniker of opened time series database instance and requested information. The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OpenRub xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>S1!M!5472</id>
  </tObject>
<tArg xmlns="">
<args>
  <openForEdit>true</openForEdit>
  </args>
<metaGet>
  <obInst>true</obInst>
  <atts>true</atts>
  <period>true</period>
  </metaGet>
  </tArg>
  </OpenRub>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenRubResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!R1</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="5" hf="0">
  <i>TS_DB</i>
  <n>Time series database</n>
  <k>5472</k>
  <c>2822</c>
  <p>5471</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  <openArgs />
  </obInst>
<atts>
<its>
<it hasMultipleValues="0">
  <k>1</k>
  <id>KEY</id>
  <n>Key</n>
  <vis>0</vis>
  <dt>2</dt>
  <predefined>1</predefined>
  <nullable>0</nullable>
  <primary>0</primary>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>2</k>
  <id>FACTOR</id>
  <n>Fact</n>
  <vis>0</vis>
  <dt>2</dt>
  <predefined>1</predefined>
  <nullable>0</nullable>
  <primary>0</primary>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>3</k>
  <id>REV</id>
  <n>Revision</n>
  <vis>0</vis>
  <dt>2</dt>
  <predefined>1</predefined>
  <nullable>0</nullable>
  <primary>0</primary>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>4</k>
  <id>DL</id>
  <n>Period</n>
  <vis>1</vis>
<valuesObj ds="" isShortcut="0" isLink="0" ver="0" hf="0">
  <i>CALENDAR_LEVELS</i>
  <n>Frequencies</n>
  <k>5482</k>
  <c>1038</c>
  <p>5472</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </valuesObj>
  <dt>2</dt>
  <predefined>1</predefined>
  <nullable>0</nullable>
  <primary>1</primary>
  <dimension>1</dimension>
  <defaultValue>1</defaultValue>
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
<filterInHierarchyByDefault>
  <k>5482</k>
  <id>CALENDAR_LEVELS</id>
  <n>Frequencies</n>
  <vis>1</vis>
  </filterInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>5</k>
  <id>UNIT</id>
  <n>Unit</n>
  <vis>0</vis>
<valuesObj ds="" isShortcut="0" isLink="0" ver="0" hf="0">
  <i>UNITS_D</i>
  <n>Measurement units</n>
  <k>174</k>
  <c>3076</c>
  <p>159</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </valuesObj>
  <dt>2</dt>
  <predefined>1</predefined>
  <nullable>1</nullable>
  <primary>0</primary>
<unitsObj ds="" isShortcut="0" isLink="0" ver="0" hf="0">
  <i>UNITS</i>
  <n>Units</n>
  <k>5483</k>
  <c>1033</c>
  <p>5472</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </unitsObj>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
<filterInHierarchyByDefault>
  <k>174</k>
  <id>UNITS_D</id>
  <n>Measurement units</n>
  <vis>1</vis>
  </filterInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>6</k>
  <id>OBT</id>
  <n>Object</n>
  <vis>0</vis>
  <dt>2</dt>
  <predefined>1</predefined>
  <nullable>1</nullable>
  <primary>0</primary>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>7</k>
  <id>MNEMO</id>
  <n>Mnemonics</n>
  <vis>0</vis>
  <dt>1</dt>
  <predefined>1</predefined>
  <nullable>0</nullable>
  <primary>0</primary>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>8</k>
  <id>DLT</id>
  <n>Deleted</n>
  <vis>0</vis>
  <dt>6</dt>
  <predefined>1</predefined>
  <nullable>0</nullable>
  <primary>0</primary>
  <defaultValue>0</defaultValue>
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
  </it>
<it hasMultipleValues="0">
  <k>9</k>
  <id>COUNTRY</id>
  <n>Country</n>
  <vis>1</vis>
<valuesObj ds="" isShortcut="0" isLink="0" ver="5" hf="0">
  <i>COUNTRIES</i>
  <n>Countries</n>
  <k>208</k>
  <c>3076</c>
  <p>159</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </valuesObj>
  <dt>2</dt>
  <predefined>0</predefined>
  <nullable>0</nullable>
  <primary>1</primary>
  <dimension>1</dimension>
  <defaultValue />
  <dataDomain>0</dataDomain>
  <isInHierarchyByDefault>0</isInHierarchyByDefault>
  <orderInHierarchyByDefault>0</orderInHierarchyByDefault>
<filterInHierarchyByDefault>
  <k>208</k>
  <id>COUNTRIES</id>
  <n>Countries</n>
  <vis>1</vis>
  </filterInHierarchyByDefault>
  </it>
  </its>
  </atts>
<period>
  <startYear>1980</startYear>
  <endYear>2020</endYear>
  </period>
  </meta>
  </OpenRubResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenRub" :
{
"tObject" :
{
"id" : "S1!M!5472"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
},
"metaGet" :
{
"obInst" : "true",
"atts" : "true",
"period" : "true"
}
}
}
}

JSON response:

{
"OpenRubResult" :
{
"id" :
{
"id" : "S1!M!S!R1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "5",
"@hf" : "0",
"i" : "TS_DB",
"n" : "Time series database",
"k" : "5472",
"c" : "2822",
"p" : "5471",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
},
"openArgs" : ""
},
"atts" :
{
"its" :
{
"it" :
[
{
"@hasMultipleValues" : "0",
"k" : "1",
"id" : "KEY",
"n" : "Key",
"vis" : "0",
"dt" : "2",
"predefined" : "1",
"nullable" : "0",
"primary" : "0",
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0"
},
{
"@hasMultipleValues" : "0",
"k" : "2",
"id" : "FACTOR",
"n" : "Fact",
"vis" : "0",
"dt" : "2",
"predefined" : "1",
"nullable" : "0",
"primary" : "0",
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0"
},
{
"@hasMultipleValues" : "0",
"k" : "3",
"id" : "REV",
"n" : "Revision",
"vis" : "0",
"dt" : "2",
"predefined" : "1",
"nullable" : "0",
"primary" : "0",
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0"
},
{
"@hasMultipleValues" : "0",
"k" : "4",
"id" : "DL",
"n" : "Period",
"vis" : "1",
"valuesObj" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "CALENDAR_LEVELS",
"n" : "Frequencies",
"k" : "5482",
"c" : "1038",
"p" : "5472",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"dt" : "2",
"predefined" : "1",
"nullable" : "0",
"primary" : "1",
"dimension" : "1",
"defaultValue" : "1",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0",
"filterInHierarchyByDefault" :
{
"k" : "5482",
"id" : "CALENDAR_LEVELS",
"n" : "Frequencies",
"vis" : "1"
}
},
{
"@hasMultipleValues" : "0",
"k" : "5",
"id" : "UNIT",
"n" : "Measurement unit",
"vis" : "0",
"valuesObj" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "UNITS_D",
"n" : "Measurement units",
"k" : "174",
"c" : "3076",
"p" : "159",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"dt" : "2",
"predefined" : "1",
"nullable" : "1",
"primary" : "0",
"unitsObj" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "UNITS",
"n" : "Measurement units",
"k" : "5483",
"c" : "1033",
"p" : "5472",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0",
"filterInHierarchyByDefault" :
{
"k" : "174",
"id" : "UNITS_D",
"n" : "Measurement units",
"vis" : "1"
}
},
{
"@hasMultipleValues" : "0",
"k" : "6",
"id" : "OBT",
"n" : "Object",
"vis" : "0",
"dt" : "2",
"predefined" : "1",
"nullable" : "1",
"primary" : "0",
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0"
},
{
"@hasMultipleValues" : "0",
"k" : "7",
"id" : "MNEMO",
"n" : "Mnemonic",
"vis" : "0",
"dt" : "1",
"predefined" : "1",
"nullable" : "0",
"primary" : "0",
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0"
},
{
"@hasMultipleValues" : "0",
"k" : "8",
"id" : "DLT",
"n" : "Deleted",
"vis" : "0",
"dt" : "6",
"predefined" : "1",
"nullable" : "0",
"primary" : "0",
"defaultValue" : "0",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0"
},
{
"@hasMultipleValues" : "0",
"k" : "9",
"id" : "COUNTRY",
"n" : "Country",
"vis" : "1",
"valuesObj" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "5",
"@hf" : "0",
"i" : "COUNTRIES",
"n" : "Countries",
"k" : "208",
"c" : "3076",
"p" : "159",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"dt" : "2",
"predefined" : "0",
"nullable" : "0",
"primary" : "1",
"dimension" : "1",
"defaultValue" : "",
"dataDomain" : "0",
"isInHierarchyByDefault" : "0",
"orderInHierarchyByDefault" : "0",
"filterInHierarchyByDefault" :
{
"k" : "208",
"id" : "COUNTRIES",
"n" : "Countries",
"vis" : "1"
}
}
]
}
},
"period" :
{
"startYear" : "1980",
"endYear" : "2020"
}
}
}
}
public static OpenRubResult OpenRub(MbId mb, string rubId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tOpen = new OpenRub()
{
tArg = new OpenRubArg()
{
args = new RubOpenArgs()
{
openForEdit = true
},
//Pattern that will be used to get metadata
metaGet = new RubMdPattern()
{
atts = true
}
},
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, rubId).k }
};
//Open time series database
var result = somClient.OpenRub(tOpen);
return result;
}

See also:

Working with Time Series Database