Пример #1
0
        public OntologyDesc GetOntologyDesc()
        {
            // Keywords
            //var searcher = new MetadataCacheSearcher();
            var list = new List<string>();
            var keywordsList = list;//searcher.GetKeywords();
            keywordsList.Add(Constants.RootName);
            var sortedKeywords = new SortedSet<string>(keywordsList);

            // Ontology tree
            var tree = new OntologyTree();
            var parentNode = new OntologyNode(Constants.RootName);
            foreach (var keyword in keywordsList.Where(keyword => keyword != Constants.RootName))
            {
                parentNode.children.Add(new OntologyNode(keyword));
            }
            tree.Nodes.Add(parentNode);

            // Return result
            var result = new OntologyDesc
            {
                Keywords = sortedKeywords,
                OntoloyTree = tree,
            };
            return result;
        }
Пример #2
0
        public OntologyDesc GetOntologyDesc()
        {
            // Keywords
            //var searcher = new MetadataCacheSearcher();
            var list         = new List <string>();
            var keywordsList = list;//searcher.GetKeywords();

            keywordsList.Add(Constants.RootName);
            var sortedKeywords = new SortedSet <string>(keywordsList);

            // Ontology tree
            var tree       = new OntologyTree();
            var parentNode = new OntologyNode(Constants.RootName);

            foreach (var keyword in keywordsList.Where(keyword => keyword != Constants.RootName))
            {
                parentNode.children.Add(new OntologyNode(keyword));
            }
            tree.Nodes.Add(parentNode);

            // Return result
            var result = new OntologyDesc
            {
                Keywords    = sortedKeywords,
                OntoloyTree = tree,
            };

            return(result);
        }
Пример #3
0
        private OntologyNode CreateTreeNodeFromXmlNode(XmlNode node)
        {
            OntologyNode tmptreenode = null;

            if (node.HasChildNodes)
            {
                var text = node.FirstChild.InnerText.Trim();
                if (text != string.Empty)
                {
                    tmptreenode = new OntologyNode(text);
                    keywordsList.Add(text);
                }
            }
            return(tmptreenode ?? (new OntologyNode()));
        }
Пример #4
0
 private OntologyNode CreateTreeNodeFromXmlNode(XmlNode node)
 {
     OntologyNode tmptreenode = null;
     if (node.HasChildNodes)
     {
         var text = node.FirstChild.InnerText.Trim();
         if (text != string.Empty)
         {
             tmptreenode = new OntologyNode(text);
             keywordsList.Add(text);
         }
     }
     return tmptreenode ?? (new OntologyNode());
 }
Пример #5
0
 private OntologyNode CreateTreeNodeFromXmlNode(XmlNode node)
 {
     bool isFolder = true;
     OntologyNode tmptreenode = null;
     if (node.HasChildNodes)
     {
         var text = node.FirstChild.InnerText.Trim();
         var id = node.FirstChild.NextSibling.InnerText.Trim();
         if (text != string.Empty)
         {
             tmptreenode = new OntologyNode(id, text, isFolder);
             keywordsList.Add(text);
         }
     }
     return tmptreenode ?? (new OntologyNode());
 }