Esempio n. 1
0
        public ConfigExecutor(string user, string dsName)
        {
            log = Log.Logger.ForContext <ConfigExecutor>();
            DataStoreFrame dsFrame = dsMgmt.GetDataStore(dsName);

            this.kgConfigFrame = dsFrame.GetKGConfig();

            this.user   = user;
            this.dsName = dsName;
        }
Esempio n. 2
0
        public KGConfigFrame ParseKGConfig(List <VisulizationConfig> vcList)
        {
            KGConfigFrame kgConfigFrame = new KGConfigFrame();

            Dictionary <string, List <ColorConfig> > vertexLabelsMap = new Dictionary <string, List <ColorConfig> >();

            foreach (VisulizationConfig vc in vcList)
            {
                string             scenarioName = vc.scenario;
                List <ColorConfig> cc           = vc.labelsOfVertexes;

                vertexLabelsMap.Add(scenarioName, cc);
            }

            kgConfigFrame.SetVertexLabelColorMap(vertexLabelsMap);

            return(kgConfigFrame);
        }
Esempio n. 3
0
        public DataStoreFrame LoadDataStore(string dsName)
        {
            List <Vertex>             vList  = null;
            List <Edge>               eList  = null;
            List <VisulizationConfig> vcList = null;

            List <NLUIntentRule>       iList  = null;
            List <EntityData>          enList = null;
            List <EntityAttributeData> eaList = null;

            (vList, eList, vcList, iList, enList, eaList) = this.dataAccessor.Load(dsName);

            if (vcList == null || vList == null || eList == null)
            {
                log.Here().Warning("No KG Data loaded from persistence");
                return(null);
            }

            DataPersistanceKGParser kgParser      = new DataPersistanceKGParser();
            KnowledgeGraphDataFrame kgDF          = kgParser.ParseKG(vList, eList);
            KGConfigFrame           kgConfigFrame = kgParser.ParseKGConfig(vcList);

            log.Information("Knowledge Graph is parsed.");
            Console.WriteLine("Knowledge Graph is parsed.");

            NLUDataFrame nluDF = null;

            if (iList == null || enList == null)
            {
                log.Here().Warning("No NLU Data loaded from persistence");
            }
            else
            {
                DataPersistanceNLUParser nluParser = new DataPersistanceNLUParser();
                nluDF = nluParser.Parse(iList, enList, eaList);

                log.Information("NLU materials is parsed.");
                Console.WriteLine("NLU materials is parsed.");
            }

            DataStoreFrame dsFrame = new DataStoreFrame(dsName, kgDF, kgConfigFrame, nluDF);

            return(dsFrame);
        }