コード例 #1
0
        public void SpecialiseArchetype(string addition_to_concept_name)
        {
            ARCHETYPE_TERM term       = new ARCHETYPE_TERM();
            ARCHETYPE_TERM parentTerm = _ontology.TermDefinition(_ontology.PrimaryLanguageCode, _archetype.concept);

            term.code  = _ontology.NextSpecialisedTermId(parentTerm.code);
            term.items = new StringDictionaryItem[parentTerm.items.Length];

            for (int i = 0; i < parentTerm.items.Length; i++)
            {
                term.items[i]       = new StringDictionaryItem();
                term.items[i].id    = parentTerm.items[i].id;
                term.items[i].Value = parentTerm.items[i].Value;
            }

            _ontology.AddTermOrConstraintDefinition(term, false);

            if (_archetype.definition.node_id == _archetype.concept)
            {
                _archetype.definition.node_id = term.code;
            }

            _archetype.concept             = term.code;
            _archetype.parent_archetype_id = _archetype.archetype_id;

            //now add the addition to the concept name in the archetype ID
            string[] y = _archetype.archetype_id.value.Split(".".ToCharArray());
            _archetype.archetype_id       = new ARCHETYPE_ID();
            _archetype.archetype_id.value = y[0] + "." + y[1] + "-" + addition_to_concept_name;

            for (int i = 2; i < y.Length; i++)
            {
                _archetype.archetype_id.value += "." + y[i];
            }

            //don't overwrite the old archetype
            _file_name = null;
        }