Esempio n. 1
0
        public static GraphProcessor GetInstance()
        {
            GraphProcessor query         = new GraphProcessor();
            var            gremlinServer = new GremlinServer(hostname, port, enableSsl: true,
                                                             username: "******" + database + "/colls/" + collection,
                                                             password: authKey);

            query.gremlinClient = new GremlinClient(gremlinServer, new GraphSON2Reader(), new GraphSON2Writer(), GremlinClient.GraphSON2MimeType);
            return(query);
        }
Esempio n. 2
0
        public static CategoryProcessor GetInstance()
        {
            CategoryProcessor categoryProcessor = new CategoryProcessor();

            var credential = GoogleCredential.FromFile("Config\\classifyNlp.json")
                             .CreateScoped(LanguageServiceClient.DefaultScopes);
            var channel = new Grpc.Core.Channel(
                LanguageServiceClient.DefaultEndpoint.ToString(),
                credential.ToChannelCredentials());

            categoryProcessor.serviceClient = LanguageServiceClient.Create(channel);

            categoryProcessor.graphProcessor = GraphProcessor.GetInstance();

            return(categoryProcessor);
        }