本文整理汇总了C#中IDataStructureObject.GetDimensions方法的典型用法代码示例。如果您正苦于以下问题:C# IDataStructureObject.GetDimensions方法的具体用法?C# IDataStructureObject.GetDimensions怎么用?C# IDataStructureObject.GetDimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataStructureObject
的用法示例。
在下文中一共展示了IDataStructureObject.GetDimensions方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartDataset
public void StartDataset(string dsdName, IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
{
string appPath = System.Web.HttpRuntime.AppDomainAppPath;
string giorno = System.Web.HttpContext.Current.Timestamp.Day.ToString();
string ora = System.Web.HttpContext.Current.Timestamp.Hour.ToString();
string min = System.Web.HttpContext.Current.Timestamp.Minute.ToString();
string secondi = System.Web.HttpContext.Current.Timestamp.Second.ToString();
string ms = System.Web.HttpContext.Current.Timestamp.Millisecond.ToString();
string namedir = giorno + ora + min + secondi + ms;
dirPath = appPath + namedir;
DirectoryInfo MyRoot = new DirectoryInfo(@appPath);
MyRoot.CreateSubdirectory(namedir);
IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
string[] ordinamento1 = new string[dimensions.Count];
string[] ordinamento2 = new string[dsd.Components.Count];
ordine = new string[dimensions.Count];
ordineser = new string[dimensions.Count];
int indord = 0;
string valoredati = "";
IList<IDimension> dimensions1 = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
foreach (IDimension dim in dimensions1)
{
_CsvZipDataWriter.WriteValue(dim.Id + "_code,");
valoredati += dim.Id + "_code,";
ordine[indord] = dim.Id;
indord++;
}
valoredati += "VALUE,date";
string newLinedati = string.Format("{0}{1}", valoredati, Environment.NewLine);
csvdati.Append(newLinedati);
}
示例2: BuildConceptSchemeRequest
/// <summary>
/// Build concept scheme requests from the concept scheme references of the specified KeyFamilyBean object
/// </summary>
/// <param name="kf">
/// The KeyFamily to look for concept Scheme references
/// </param>
/// <returns>
/// A list of concept scheme requests
/// </returns>
public static IEnumerable<IStructureReference> BuildConceptSchemeRequest(IDataStructureObject kf)
{
var conceptSchemeSet = new Dictionary<string, object>();
var ret = new List<IStructureReference>();
var crossDsd = kf as ICrossSectionalDataStructureObject;
List<IComponent> components = new List<IComponent>();
components.AddRange(kf.GetDimensions());
components.AddRange(kf.Attributes);
if (kf.PrimaryMeasure != null)
{
components.Add(kf.PrimaryMeasure);
}
if (crossDsd != null)
{
components.AddRange(crossDsd.CrossSectionalMeasures);
}
ICollection<IComponent> comps = components;
foreach (IComponent comp in comps)
{
string key = Utils.MakeKey(comp.ConceptRef.MaintainableReference.MaintainableId, comp.ConceptRef.MaintainableReference.Version, comp.ConceptRef.MaintainableReference.AgencyId);
if (!conceptSchemeSet.ContainsKey(key))
{
// create concept ref
var conceptSchemeRef = new StructureReferenceImpl(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConceptScheme))
{
MaintainableId = comp.ConceptRef.MaintainableReference.MaintainableId,
AgencyId = comp.ConceptRef.MaintainableReference.AgencyId,
Version = comp.ConceptRef.MaintainableReference.Version
};
// add it to request
ret.Add(conceptSchemeRef);
// added it to set of visited concept schemes
conceptSchemeSet.Add(key, null);
}
}
return ret;
}
示例3: SetCurrentDsd
/// <summary>
/// Sets the current DSD.
/// </summary>
/// <param name="currentDsd">
/// The current DSD.
/// </param>
/// <exception cref="SdmxNotImplementedException">
/// Time series without time dimension
/// </exception>
protected override void SetCurrentDsd(IDataStructureObject currentDsd)
{
base.SetCurrentDsd(currentDsd);
// reset all maps
this._dimensionConcepts = new List<string>();
this._datasetAttributes = new HashSet<string>(StringComparer.Ordinal);
this._seriesAttributes = new HashSet<string>(StringComparer.Ordinal);
this._observationAttributes = new HashSet<string>(StringComparer.Ordinal);
this._groups = new List<string>();
this._groupConcepts = new Dictionary<string, List<string>>(StringComparer.Ordinal);
if (this.DatasetHeader.DataStructureReference != null)
{
this.SetDimensionAtObservation(this.DatasetHeader.DataStructureReference.DimensionAtObservation);
}
else
{
this.SetDimensionAtObservation(DimensionObject.TimeDimensionFixedId);
}
// Roll up any attribute values
foreach (var valuePair in this._attributesOnDatasetNode)
{
var component = currentDsd.GetComponent(valuePair.Key);
if (component != null)
{
this._rolledUpAttributes.Add(valuePair);
}
}
// Create a list of dimension concepts
foreach (var dimension in currentDsd.GetDimensions(SdmxStructureEnumType.Dimension, SdmxStructureEnumType.MeasureDimension))
{
this._dimensionConcepts.Add(dimension.Id);
}
// Create a list of dataset attribute concepts
foreach (var datasetAttribute in currentDsd.DatasetAttributes)
{
this._datasetAttributes.Add(datasetAttribute.Id);
}
// Create a list of dimension group attribute concepts
foreach (var dimensionGroupAttribute in currentDsd.DimensionGroupAttributes)
{
this._seriesAttributes.Add(dimensionGroupAttribute.Id);
}
// Create a list of observation attribute concepts
foreach (var observationAttribute in currentDsd.ObservationAttributes)
{
this._observationAttributes.Add(observationAttribute.Id);
}
this._primaryMeasureConcept = currentDsd.PrimaryMeasure.Id;
if (currentDsd.TimeDimension == null)
{
throw new SdmxNotImplementedException(string.Format(CultureInfo.InvariantCulture, "The DSD: {0} has no time dimension. This is unsupported!", currentDsd.Id));
}
this._timeConcept = currentDsd.TimeDimension.Id;
foreach (var dsdGroup in currentDsd.Groups)
{
string groupId = dsdGroup.Id;
this._groups.Add(groupId);
ISet<string> groupAttributes = new HashSet<string>(currentDsd.GetGroupAttributes(groupId, true).Select(o => o.Id), StringComparer.Ordinal);
this._groupAttributeConcepts.Add(groupId, groupAttributes);
var groups = new List<string>();
PopulateGroupContents(dsdGroup, groups);
this._groupConcepts.Add(groupId, groups);
}
}
示例4: GetSeriesKeyConcepts
/// <summary>
/// Returns the series key concepts.
/// </summary>
/// <param name="dataStructureObject">
/// The data structure object.
/// </param>
/// <returns>
/// The series key concepts.
/// </returns>
public static IList<string> GetSeriesKeyConcepts(IDataStructureObject dataStructureObject)
{
IList<string> keyConcepts = new List<string>();
foreach (IDimension currentDimension in dataStructureObject.GetDimensions(SdmxStructureEnumType.Dimension, SdmxStructureEnumType.MeasureDimension))
{
keyConcepts.Add(currentDimension.Id);
}
return keyConcepts;
}
示例5: GetDimensionAtObservationLevel
/**
* It returns the default value for the dimension at observation in accordance with the DSD. <br>
* For a time series DSD, the return value Equals to the Time Dimension. For a crossX DSD it returns the <br>
* measure dimension value
* @param dataStructure
* @return
*/
private string GetDimensionAtObservationLevel(IDataStructureObject dataStructure)
{
//// Change from the SdmxSource Java.
//// MAT-675 : Not all DSD have either time or measure dimension. The standard says in that case
//// use all (flat).
if (dataStructure.TimeDimension != null)
return Api.Constants.DimensionAtObservation.GetFromEnum(DimensionAtObservationEnumType.Time).Value;
var measureDimension = dataStructure.GetDimensions(SdmxStructureEnumType.MeasureDimension).FirstOrDefault();
if (measureDimension != null)
{
return measureDimension.Id;
}
return Api.Constants.DimensionAtObservation.GetFromEnum(DimensionAtObservationEnumType.All).Value;
}
示例6: StartDataset
public void StartDataset(string dsdName, IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
{
myDsplStructure._info.Names = new List<DsplStructure.Name>();
myDsplStructure._info.Descriptions = new List<DsplStructure.Name>();
myDsplStructure._info.Languages = new List<DsplStructure.Languages>();
myDsplStructure._provider.Names = new List<DsplStructure.Name>();
foreach (var item in dataflow.Names)
{
var names = new DsplStructure.Name();
names.name = item.Value;
names.lang = item.Locale;
//info
myDsplStructure._info.Names.Add(names);
myDsplStructure._info.url = GetWebConfigInfo("urlAddress");
//provider
myDsplStructure._provider.Names.Add(names);
myDsplStructure._provider.url = GetWebConfigInfo("urlAddress");
}
myDsplStructure._info.Languages = VerifyNames(dataflow);
myDsplStructure._info.description= dsdName;
var topic = new DsplStructure.Topic();
topic.id = dataflow.Name.PadRight(64);
topic.Names = new List<DsplStructure.Name>();
foreach (var item in dataflow.Names)
{
var names = new DsplStructure.Name();
names.name = item.Value;
names.lang = item.Locale;
topic.Names.Add(names);
}
myDsplStructure._topics.Add(topic);
var table = new DsplStructure.Table();
var colonne = new DsplStructure.Column();
string appPath = System.Web.HttpRuntime.AppDomainAppPath;
string giorno = System.Web.HttpContext.Current.Timestamp.Day.ToString();
string ora = System.Web.HttpContext.Current.Timestamp.Hour.ToString();
string min = System.Web.HttpContext.Current.Timestamp.Minute.ToString();
string secondi = System.Web.HttpContext.Current.Timestamp.Second.ToString();
string ms = System.Web.HttpContext.Current.Timestamp.Millisecond.ToString();
string namedir = giorno + ora + min + secondi + ms;
dirPath = appPath + namedir;
DirectoryInfo MyRoot = new DirectoryInfo(@appPath);
MyRoot.CreateSubdirectory(namedir);
IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
string[] ordinamento1 = new string[dimensions.Count];
string[] ordinamento2 = new string[dsd.Components.Count];
string codelist = "";
string agenzia = "";
string versione = "";
var concept = new DsplStructure.Concept();
// metrics
concept.id = "VALUE";
concept.type = "float";
//Pietro
concept.infoconcept.Names = new List<DsplStructure.Name>();
concept.infoconcept.Descriptions = new List<DsplStructure.Name>();
foreach (var item in dataflow.Names)
{
var names = new DsplStructure.Name();
names.lang = item.Locale;
names.name = item.Value;
concept.infoconcept.Names.Add(names);
}
myDsplStructure._concepts.Add(concept);
var slices = new DsplStructure.Slice();
slices.id = "DATI";
slices.dimension = new List<String>();
int indord = 0;
foreach (IDimension dim in dimensions)
{
ISet<ICrossReference> isr = dim.Representation.CrossReferences;
foreach (var x in isr)
{
codelist = x.MaintainableReference.MaintainableId;
agenzia = x.MaintainableReference.AgencyId;
versione = x.MaintainableReference.Version;
//.........这里部分代码省略.........
示例7: SetDsdOrder
public void SetDsdOrder(IDataStructureObject dsd)
{
IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
ordine = new string[dimensions.Count];
ordineser = new string[dimensions.Count];
}
示例8: StartDataset
/// <summary>
/// Starts a dataset with the data conforming to the DSD
/// </summary>
/// <param name="dataflow">Optional. The dataflow can be provided to give extra information about the dataset.</param>
/// <param name="dsd">The data structure is used to know the dimensionality of the data</param>
/// <param name="header">Dataset header containing, amongst others, the dataset action, reporting dates,
/// dimension at observation if null then the dimension at observation is assumed to be TIME_PERIOD and the dataset action is assumed to be INFORMATION</param>
/// <param name="annotations">Any additional annotations that are attached to the dataset, can be null if no annotations exist</param>
/// <exception cref="T:System.ArgumentException">if the DSD is null</exception>
public void StartDataset(string dsdName, IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
{
this._actions.Enqueue(() => this._dataWriterEngine.StartDataset(dsdName, dataflow, dsd, header, annotations));
IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
string[] ordinamento1 = new string[dimensions.Count];
string[] ordinamento2 = new string[dsd.Components.Count];
}