Esempio n. 1
0
        public void FiledOrNot()
        {
            var instance = new Instance();

            instance.SchemaReference = new SchemaReference("simple", "http://eiopa.europa.eu/eu/xbrl/s2md/fws/solvency/solvency2/2014-12-23/mod/ars.xsd");
            instance.TaxonomyVersion = "1.5.2.c";
            instance.SetMetricNamespace("s2md_met", "http://eiopa.europa.eu/xbrl/s2md/dict/met");
            instance.SetDimensionNamespace("s2c_dim", "http://eiopa.europa.eu/xbrl/s2c/dict/dim");
            instance.SetTypedDomainNamespace("s2c_typ", "http://eiopa.europa.eu/xbrl/s2c/dict/typ");
            instance.Entity = new Entity("http://standards.iso.org/iso/17442", "00000000000000000098");
            instance.Period = new Period(2015, 12, 31);

            instance.AddFilingIndicator("foo", true);
            instance.AddFilingIndicator("bar", false);
        }
Esempio n. 2
0
        static Instance CreateSolvencyInstance()
        {
            // Sets default namespaces and units PURE, EUR
            var instance = new Instance();

            // When an explicit member is added, check that the namespace for the domain has been set
            instance.CheckExplicitMemberDomainExists = true;

            // Initialize to the correct framework, module, taxonomy
            // The content is NOT validated against taxonomy or module schema
            // set module
            instance.SchemaReference = new SchemaReference("simple", "http://eiopa.europa.eu/eu/xbrl/s2md/fws/solvency/solvency2/2014-12-23/mod/ars.xsd");

            // set taxonomy
            instance.TaxonomyVersion = "1.5.2.c";

            // "basic" namespaces
            // These are used for adding correct prefixes for different elements
            instance.SetMetricNamespace("s2md_met", "http://eiopa.europa.eu/xbrl/s2md/dict/met");
            instance.SetDimensionNamespace("s2c_dim", "http://eiopa.europa.eu/xbrl/s2c/dict/dim");
            instance.SetTypedDomainNamespace("s2c_typ", "http://eiopa.europa.eu/xbrl/s2c/dict/typ");

            // Namespaces for actual reported values that belong to a domain (explicit members)
            instance.AddDomainNamespace("s2c_CS", "http://eiopa.europa.eu/xbrl/s2c/dict/dom/CS");
            instance.AddDomainNamespace("s2c_AM", "http://eiopa.europa.eu/xbrl/s2c/dict/dom/AM");

            // Add reporter and period
            // These will be reused across all contexts by default
            // Scheme or value are NOT validated
            instance.Entity = new Entity("http://standards.iso.org/iso/17442", "1234567890ABCDEFGHIJ");
            instance.Period = new Period(2014, 12, 31);

            // Any units that aren't used will be excluded during serialization
            // So it's safe to add extra units if needed
            instance.Units.Add("uEUR", "iso4217:EUR");
            instance.Units.Add("uPURE", "xbrli:pure");
            instance.Units.Add("uFOO", "foo:bar");

            // Add filing indicators
            // These are NOT validated against actual reported values
            instance.AddFilingIndicator("S.01.01");
            instance.AddFilingIndicator("S.02.02");

            // A scenario contains the dimensions and their values for a datapoint
            var scenario = new Scenario();

            // Dimensions and domains can be given with or without namespaces
            // The namespace prefixes are added internally if needed
            // Explicit member values DO NEED the prefix
            scenario.AddExplicitMember("CS", "s2c_CS:x26");
            scenario.AddTypedMember("CE", "ID", "abc");

            // Metrics can also be given with or without namespace
            // Metric names, values or decimals are NOT validated
            // Unit is NOT checked to exist
            instance.AddFact(scenario, "pi545", "uPURE", "4", "0.2547");

            // if a scenario with the given values already exists in the instance, it will be reused
            // you don't have to check for duplicates
            instance.AddFact(scenario, "mi363", "uEUR", "-3", "45345");

            // Non - existing unit throws KeyNotFoundException
            try
            {
                instance.AddFact(scenario, "mi363", "uSEK", "-3", "45345");
            }
            catch (KeyNotFoundException ex)
            {
                Console.WriteLine(ex.Message);
            }

            var invalidScenario = new Scenario();

            // Member has value with domain that has no corresponding namespace
            invalidScenario.AddExplicitMember("CS", "s2c_XA:x0");
            try
            {
                // This can only be observed when the scenario is attached to the instance
                // ie. previous line is ok but this one throws
                instance.AddFact(invalidScenario, "mi252", "uEUR", "4", "123456");
            }
            catch (InvalidOperationException ex)
            {
                Console.WriteLine(ex.Message);
            }

            return instance;
        }
Esempio n. 3
0
        internal Instance CreateSolvencyInstance()
        {
            // Sets default namespaces and units PURE, EUR
            var instance = new Instance();

            // When an explicit member is added, check that the namespace for the domain has been set
            instance.CheckExplicitMemberDomainExists = true;

            // Initialize to the correct framework, module, taxonomy
            // The content is NOT validated against taxonomy or module schema
            // set module
            instance.SchemaReference = new SchemaReference("simple", "http://eiopa.europa.eu/eu/xbrl/s2md/fws/solvency/solvency2/2014-12-23/mod/ars.xsd");

            // set taxonomy
            instance.TaxonomyVersion = "1.5.2.c";

            // "basic" namespaces
            // These are used for adding correct prefixes for different elements
            instance.SetMetricNamespace("s2md_met", "http://eiopa.europa.eu/xbrl/s2md/dict/met");
            instance.SetDimensionNamespace("s2c_dim", "http://eiopa.europa.eu/xbrl/s2c/dict/dim");
            instance.SetTypedDomainNamespace("s2c_typ", "http://eiopa.europa.eu/xbrl/s2c/dict/typ");

            // Namespaces for actual reported values that belong to a domain (explicit members)
            instance.AddDomainNamespace("s2c_CS", "http://eiopa.europa.eu/xbrl/s2c/dict/dom/CS");
            instance.AddDomainNamespace("s2c_AM", "http://eiopa.europa.eu/xbrl/s2c/dict/dom/AM");

            // Add reporter and period
            // These will be reused across all contexts by default
            // Scheme or value are NOT validated
            instance.Entity = new Entity("http://standards.iso.org/iso/17442", "1234567890ABCDEFGHIJ");
            instance.Period = new Period(2014, 12, 31);

            // Any units that aren't used will be excluded during serialization
            // So it's safe to add extra units if needed
            instance.Units.Add("uEUR", "iso4217:EUR");
            instance.Units.Add("uPURE", "xbrli:pure");
            instance.Units.Add("uFOO", "foo:bar");

            // Add filing indicators
            // These are NOT validated against actual reported values
            instance.AddFilingIndicator("S.01.01");
            instance.AddFilingIndicator("S.02.02");

            // A scenario contains the dimensions and their values for a datapoint
            var scenario = new Scenario();

            // Dimensions and domains can be given with or without namespaces
            // The namespace prefixes are added internally if needed
            // Explicit member values DO NEED the prefix
            scenario.AddExplicitMember("CS", "s2c_CS:x26");
            scenario.AddTypedMember("CE", "ID", "abc");

            // Metrics can also be given with or without namespace
            // Metric names, values or decimals are NOT validated
            // Unit is NOT checked to exist
            instance.AddFact(scenario, "pi545", "uPURE", "4", "0.2547");

            // if a scenario with the given values already exists in the instance, it will be reused
            // you don't have to check for duplicates
            instance.AddFact(scenario, "mi363", "uEUR", "-3", "45345");

            // Non - existing unit throws KeyNotFoundException
            try
            {
                instance.AddFact(scenario, "mi363", "uSEK", "-3", "45345");
            }
            catch (KeyNotFoundException ex)
            {
                output.WriteLine(ex.Message);
            }

            var invalidScenario = new Scenario();

            // Member has value with domain that has no corresponding namespace
            invalidScenario.AddExplicitMember("CS", "s2c_XA:x0");
            try
            {
                // This can only be observed when the scenario is attached to the instance
                // ie. previous line is ok but this one throws
                instance.AddFact(invalidScenario, "mi252", "uEUR", "4", "123456");
            }
            catch (InvalidOperationException ex)
            {
                output.WriteLine(ex.Message);
            }

            return(instance);
        }
Esempio n. 4
0
        public static void FiledOrNot()
        {
            var instance = new Instance();
            instance.SchemaReference = new SchemaReference("simple", "http://eiopa.europa.eu/eu/xbrl/s2md/fws/solvency/solvency2/2014-12-23/mod/ars.xsd");
            instance.TaxonomyVersion = "1.5.2.c";
            instance.SetMetricNamespace("s2md_met", "http://eiopa.europa.eu/xbrl/s2md/dict/met");
            instance.SetDimensionNamespace("s2c_dim", "http://eiopa.europa.eu/xbrl/s2c/dict/dim");
            instance.SetTypedDomainNamespace("s2c_typ", "http://eiopa.europa.eu/xbrl/s2c/dict/typ");
            instance.Entity = new Entity("http://standards.iso.org/iso/17442", "00000000000000000098");
            instance.Period = new Period(2015, 12, 31);

            instance.AddFilingIndicator("foo", true);
            instance.AddFilingIndicator("bar", false);
        }