OpenRubResult OpenRub(OdId tObject, OpenRubArg tArg)
tObject. Moniker of the repository object that is a time series database.
tArg. Operation execution parameters.
The OpenRub operation opens a time series database and returns context required to work with its structure.
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 extraction 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 factors stored in the database. To close the opened time series database instance, use the CloseRub operation.
{ "OpenRub" : { "tObject" : { "id" : "S1!M!5472" }, "tArg" :
{ "args" : "", "metaGet" : { "obInst" : "true", "atts" : "true", "period" : "true" } } } }
{ "OpenRubResult" : { "id" : { "id" : "S1!M!S!R1" },
"meta" : { "obInst" : { "obDesc" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "TS_DB", "n" : "Time series database",
"k" : "5472", "c" : "2822", "p" : "5471", "h" : "0" }, "openArgs" : "" }, "atts" : { "its" :
{ "it" : [ { "@hasMultipleValues" : "0", "k" : "1", "id" : "KEY", "n" : "Key", "vis" : "0", "value" : "",
"dt" : "2", "predefined" : "1", "primary" : "0" }, { "@hasMultipleValues" : "0", "k" : "2", "id" : "FACTOR", "n" : "Fact", "vis" : "0"
"value" : "", "dt" : "2", "predefined" : "1", "primary" : "0" }, { "@hasMultipleValues" : "0", "k" : "3", "id" : "REV", "n" : "Revision"
"vis" : "0", "value" : "", "dt" : "2", "predefined" : "1", "primary" : "0" }, { "@hasMultipleValues" : "0", "k" : "4", "id" : "DL",
"n" : "Period", "vis" : "1", "value" : "", "valuesObj" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "CALENDAR_LEVELS", "n" : "Frequencies", "k" : "5482"
"c" : "1038", "p" : "5472", "h" : "0" }, "dt" : "2", "predefined" : "1", "primary" : "1" }, { "@hasMultipleValues" : "0",
"k" : "5", "id" : "UNIT", "n" : "Unit", "vis" : "0", "value" : "", "valuesObj" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "UNITS"
"n" : "Units", "k" : "174", "c" : "4354", "p" : "159", "h" : "0" }, "dt" : "2", "predefined" : "1", "primary" : "0", "unitsObj"
{ "@isShortcut" : "0", "@isLink" : "0", "i" : "UNITS", "n" : "Units", "k" : "5483", "c" : "1033", "p" : "5472", "h" : "0" }
}, { "@hasMultipleValues" : "0", "k" : "6", "id" : "OBT", "n" : "OBject", "vis" : "0", "value" : "", "dt" : "2", "predefined" : "1"
"primary" : "0" }, { "@hasMultipleValues" : "0", "k" : "7", "id" : "MNEMO", "n" : "Mnemonic", "vis" : "0", "value" : "", "dt" : "1"
"predefined" : "1", "primary" : "0" }, { "@hasMultipleValues" : "0", "k" : "8", "id" : "DLT", "n" : "Deleted", "vis" : "0", "value" : ""
"dt" : "6", "predefined" : "1", "primary" : "0" }, { "@hasMultipleValues" : "0", "k" : "9", "id" : "COUNTRY", "n" : "Country", "vis" : "1"
"value" : "", "valuesObj" : { "@isShortcut" : "0", "@isLink" : "0", "i" : "COUNTRY", "n" : "Country", "k" : "208", "c" : "4354", "p" : "159",
"h" : "0" }, "dt" : "2", "predefined" : "0", "primary" : "1" } ] } }, "period" :
{ "startYear" : "1980", "endYear" : "2020" }, "properties" : { "@lightWeight" : "0", "@valuesOnQuery" : "0", "@factsOnQuery" : "0", "@hasMnemonics" : "1",
"@revisionsOnQuery" : "0", "@keepHistory" : "1", "@autoUpdateStat" : "1", "@useDistinctSequence" : "0", "@unitIsRequired" : "0", "@compoundFactorKey" : "0", "@hasEmptyAttribute" : "0" } } } }
The OpenRub function specified below opens a time series database. The repository connection moniker and time series database identifier are sent as input parameters. The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example. The result of the operation is the result of the function.
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(), //The pattern, according to which the metadata will be extracted 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