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