001    package de.deepamehta.plugins.facets.service;
002    
003    import de.deepamehta.plugins.facets.model.FacetValue;
004    
005    import de.deepamehta.core.DeepaMehtaObject;
006    import de.deepamehta.core.RelatedTopic;
007    import de.deepamehta.core.Topic;
008    import de.deepamehta.core.service.PluginService;
009    import de.deepamehta.core.service.ResultList;
010    
011    import java.util.List;
012    
013    
014    
015    public interface FacetsService extends PluginService {
016    
017        // ### TODO: rename to getFacetValue
018        Topic getFacet(long topicId, String facetTypeUri);
019    
020        /**
021         * Retrieves a facet value.
022         * ### TODO: rename to getFacetValue
023         *
024         * @param   object          The facetted object: a topic, association, a type ...
025         * @param   facetTypeUri    URI of the facet type.
026         *
027         * @return  The retrieved facet value or <code>null</code> if no such topic extists.
028         */
029        Topic getFacet(DeepaMehtaObject object, String facetTypeUri);
030    
031        // ---
032    
033        // ### TODO: rename to getFacetValues
034        ResultList<RelatedTopic> getFacets(long topicId, String facetTypeUri);
035    
036        /**
037         * Retrieves the values of a multi-facet.
038         * ### TODO: rename to getFacetValues
039         *
040         * @param   object          The facetted object: a topic, association, a type ...
041         * @param   facetTypeUri    URI of the facet type.
042         *
043         * @return  The retrieved facet values. The list may be empty.
044         */
045        ResultList<RelatedTopic> getFacets(DeepaMehtaObject object, String facetTypeUri);
046    
047        // ---
048    
049        Topic getFacettedTopic(long topicId, List<String> facetTypeUris);
050    
051        void addFacetTypeToTopic(long topicId, String facetTypeUri);
052    
053        // ---
054    
055        void updateFacet(long topicId, String facetTypeUri, FacetValue value);
056    
057        /**
058         * Updates a facet.
059         *
060         * @param   object          The facetted object: a topic, association, a type ...
061         * @param   facetTypeUri    URI of the facet type.
062         * @param   facetValue      The new facet value.
063         */
064        void updateFacet(DeepaMehtaObject object, String facetTypeUri, FacetValue value);
065    
066        // ---
067    
068        boolean hasFacet(long topicId, String facetTypeUri, long facetTopicId);
069    }