Пример #1
0
 /// <summary>
 /// Create a new unique operation with endpoint mining
 /// </summary>
 /// <param name="name">Name of the operation. Will be shown in the manage web interface</param>
 /// <param name="entityType">Type of the entity</param>
 /// <param name="methodNumber">Method number of the entity</param>
 /// <param name="endpoint">Endpoint to call</param>
 public Operation(string name, MiningEntityType entityType, int methodNumber, SparqlEndPointMiner endpoint)
 {
     this.UniqueId     = Guid.NewGuid().ToString();
     this.name         = name;
     this.entityType   = entityType;
     this.methodNumber = methodNumber;
     this.endpoint     = endpoint;
     this.state        = new MiningState();
 }
Пример #2
0
        /// <summary>
        /// Registers all operations.
        /// </summary>
        private DataMiningProxySingleton()
        {
            wikiDataEndpoint = new WikiDataEndpointMiner();

            var synchLock = new object();

            OperationsQueue = new OperationsQueue(synchLock);
            MiningWorker    = new MiningWorker(synchLock, OperationsQueue);
            MiningWorker.Start();

            Operations = new List <Operation>()
            {
                new Operation("Books - URIs", MiningEntityType.Books, 0, wikiDataEndpoint),
                new Operation("Books - Labels en, cs", MiningEntityType.Books, 1, wikiDataEndpoint),
                new Operation("Books - Original names", MiningEntityType.Books, 2, wikiDataEndpoint),
                new Operation("Books - Original names 2", MiningEntityType.Books, 3, wikiDataEndpoint),
                new Operation("Books - Labels other", MiningEntityType.Books, 4, wikiDataEndpoint),
                new Operation("Books - Identifiers", MiningEntityType.Books, 5, wikiDataEndpoint),
                new Operation("Books - Images", MiningEntityType.Books, 6, wikiDataEndpoint),
                new Operation("Books - Descriptions", MiningEntityType.Books, 7, wikiDataEndpoint),
                new Operation("Books - WikiPages en", MiningEntityType.Books, 8, wikiDataEndpoint),
                new Operation("Books - Remove duplicates", MiningEntityType.Books, 9, wikiDataEndpoint),

                new Operation("Authors - URIs", MiningEntityType.Authors, 0, wikiDataEndpoint),
                new Operation("Authors - Data 1", MiningEntityType.Authors, 1, wikiDataEndpoint),
                new Operation("Authors - Data 2", MiningEntityType.Authors, 2, wikiDataEndpoint),
                new Operation("Authors - Books relations", MiningEntityType.Authors, 3, wikiDataEndpoint),
                new Operation("Authors - Images", MiningEntityType.Authors, 4, wikiDataEndpoint),
                new Operation("Authors - Descriptions", MiningEntityType.Authors, 5, wikiDataEndpoint),
                new Operation("Authors - WikiPages en", MiningEntityType.Authors, 6, wikiDataEndpoint),

                new Operation("Characters - URIs and Labels", MiningEntityType.Characters, 0, wikiDataEndpoint),
                new Operation("Characters - Books relations", MiningEntityType.Characters, 1, wikiDataEndpoint),

                new Operation("Genres - URIs and Labels", MiningEntityType.Genres, 0, wikiDataEndpoint),
                new Operation("Genres - Books relations", MiningEntityType.Genres, 1, wikiDataEndpoint),

                new Operation("WikiPages - Download", (state) => new WikiPedia.WikiPageTagMiner().UpdateTags(0, state)),
                new Operation("WikiPages - Calculate ratings", (state) => new WikiPedia.WikiPageTagMiner().UpdateTags(1, state))
            }.AsReadOnly();
        }