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        // ### TODO: add fetchComposite parameter
019        Topic getFacet(long topicId, String facetTypeUri);
020    
021        /**
022         * Retrieves a facet value.
023         * ### TODO: rename to getFacetValue
024         * ### TODO: add fetchComposite parameter
025         *
026         * @param   object          The facetted object: a topic, association, a type ...
027         * @param   facetTypeUri    URI of the facet type.
028         *
029         * @return  The retrieved facet value (including its child topics) or <code>null</code> if no such topic extists.
030         */
031        Topic getFacet(DeepaMehtaObject object, String facetTypeUri);
032    
033        // ---
034    
035        // ### TODO: rename to getFacetValues
036        ResultList<RelatedTopic> getFacets(long topicId, String facetTypeUri);
037    
038        /**
039         * Retrieves the values of a multi-facet.
040         * ### TODO: rename to getFacetValues
041         * ### TODO: add fetchComposite parameter
042         *
043         * @param   object          The facetted object: a topic, association, a type ...
044         * @param   facetTypeUri    URI of the facet type.
045         *
046         * @return  The retrieved facet values (including their child topics). The list may be empty.
047         */
048        ResultList<RelatedTopic> getFacets(DeepaMehtaObject object, String facetTypeUri);
049    
050        // ---
051    
052        Topic getFacettedTopic(long topicId, List<String> facetTypeUris);
053    
054        void addFacetTypeToTopic(long topicId, String facetTypeUri);
055    
056        // ---
057    
058        void updateFacet(long topicId, String facetTypeUri, FacetValue value);
059    
060        /**
061         * Updates a facet.
062         *
063         * @param   object          The facetted object: a topic, association, a type ...
064         * @param   facetTypeUri    URI of the facet type.
065         * @param   facetValue      The new facet value.
066         */
067        void updateFacet(DeepaMehtaObject object, String facetTypeUri, FacetValue value);
068    
069        // ---
070    
071        boolean hasFacet(long topicId, String facetTypeUri, long facetTopicId);
072    }