001
002 package org.deepamehta.plugins.wikidata.service;
003
004 import de.deepamehta.core.RelatedAssociation;
005 import de.deepamehta.core.Topic;
006 import de.deepamehta.core.service.PluginService;
007 import de.deepamehta.core.service.ResultList;
008
009 /**
010 * A very basic plugin to search and explore wikidata.
011 * Creates \"Wikidata Search Result Entity\"-Topics.
012 * Corresponding to the type of wikidata-entity found via a search these topics have either the child-type
013 * ("org.deepamehta.wikidata.search_entity_type") set to the value "property or the value "item".
014 *
015 * @author Malte Reißig (<malte@mikromedia.de>)
016 * @website https://github.com/mukil/dm4-wikidata
017 * @version 0.0.4-SNAPSHOT
018 */
019 public interface WikidataSearchService extends PluginService {
020
021 /**
022 * This method searches all wikidata entities by text and the given language code.
023 *
024 * @param {entity} entity-type (can be of entity-type "item" or "property")
025 * @param {query} name of wikidata property in search
026 * @param {language_code} ISO 639-1 language code (must exist in DM installation)
027 */
028 Topic searchWikidataEntity(String query, String iso_language_code, String entityType);
029
030 /**
031 * This method gets (or creates) a \"Wikidata Search Entity\" (in DeepaMehta 4) by its ID (wikidata).
032 * Updates values of the given topic if this wikidata-entity was already imported before.
033 *
034 * @param {entityId} wikidataId
035 */
036 Topic getOrCreateWikidataEntity(String wikidataEntityId, String iso_language_code);
037
038 /**
039 * This method loads all claims (with language specific values) for a wikidata-entity into DeepaMehta 4.
040 *
041 * @param {id} \"Wikidata Search Entity\"-Topic ID
042 */
043 Topic loadClaimsAndRelatedWikidataItems(long entityTopicId, String iso_language_code);
044
045 /**
046 * This method creates a DeepaMehta Association Type given a \"Wikidata Search Entity\" (of type=property).
047 *
048 * @param {id} \"Wikidata Search Entity\"-Topic ID (entity-type must be of value "property")
049 */
050 Topic createWikidataAssociationType(long entityTopicId);
051
052 /**
053 * This method retrieves all associated associations of type "Wikidata Claim" for any given
054 * \"Wikidata Search Entity\" (of type=property).
055 *
056 * @param {id} \"Wikidata Search Entity\"-Topic ID (entity-type must be of value "property")
057 */
058 ResultList<RelatedAssociation> getTopicRelatedAssociations(long topicId);
059
060 void assignToWikidataWorkspace(Topic topic);
061
062 }