Interface DMXStorage

  • All Known Implementing Classes:
    Neo4jStorage

    public interface DMXStorage
    • Method Detail

      • fetchTopic

        TopicModelImpl fetchTopic​(long topicId)
        Fetches a topic by ID.
        Returns:
        The fetched topic.
      • storeTopic

        void storeTopic​(TopicModelImpl topicModel)
        Stores a rudimentary topic in the DB.

        Only the topic URI and the topic type URI are stored. The topic value (simple or composite) is not stored. The "Instantiation" association is not stored.

        An URI uniqueness check is performed. If the DB already contains a topic or an association with the URI passed, an exception is thrown and nothing is stored.

        Parameters:
        topicModel - The topic to store. Once the method returns the topic model contains: - the ID of the stored topic. - an empty URI ("") in case null was passed. - an empty simple value ("") in case null was passed.
      • storeTopicUri

        void storeTopicUri​(long topicId,
                           String uri)
        Stores and indexes the topic's URI.
      • storeTopicTypeUri

        void storeTopicTypeUri​(long topicId,
                               String topicTypeUri)
      • storeTopicValue

        void storeTopicValue​(long topicId,
                             SimpleValue value,
                             String indexKey,
                             boolean isHtmlValue)
        Stores and indexes a topic value.
        Parameters:
        indexKey - must not null
        indexValue - Optional: the value to be indexed. If indexValue is not specified, value is used. ### FIXDOC
      • indexTopicFulltext

        void indexTopicFulltext​(long topicId,
                                String text,
                                String indexKey)
      • deleteTopic

        void deleteTopic​(long topicId)
        Deletes the topic.

        Prerequisite: the topic has no relations.

      • fetchAssoc

        AssocModelImpl fetchAssoc​(long assocId)
        Fetches an assoc by ID.
        Returns:
        The fetched assoc.
      • fetchAssocs

        List<AssocModelImpl> fetchAssocs​(String assocTypeUri,
                                         long topicId1,
                                         long topicId2,
                                         String roleTypeUri1,
                                         String roleTypeUri2)
        Returns the associations between two topics. If no such association exists an empty set is returned.
        Parameters:
        assocTypeUri - Assoc type filter. Pass null to switch filter off.
      • fetchAssocsBetweenTopicAndAssoc

        List<AssocModelImpl> fetchAssocsBetweenTopicAndAssoc​(String assocTypeUri,
                                                             long topicId,
                                                             long assocId,
                                                             String topicRoleTypeUri,
                                                             String assocRoleTypeUri)
      • storeAssocUri

        void storeAssocUri​(long assocId,
                           String uri)
        Stores and indexes the association's URI.
      • storeAssocTypeUri

        void storeAssocTypeUri​(long assocId,
                               String assocTypeUri)
      • storeAssocValue

        void storeAssocValue​(long assocId,
                             SimpleValue value,
                             String indexKey,
                             boolean isHtmlValue)
        Stores and indexes an association value.
        Parameters:
        indexKey - must not null
        indexValue - Optional: the value to be indexed. If indexValue is not specified, value is used. ### FIXDOC
      • storeRoleTypeUri

        void storeRoleTypeUri​(long assocId,
                              long playerId,
                              String roleTypeUri)
      • deleteAssoc

        void deleteAssoc​(long assocId)
      • fetchTopicRelatedTopics

        List<RelatedTopicModelImpl> fetchTopicRelatedTopics​(long topicId,
                                                            String assocTypeUri,
                                                            String myRoleTypeUri,
                                                            String othersRoleTypeUri,
                                                            String othersTopicTypeUri)
        Parameters:
        assocTypeUri - may be null
        myRoleTypeUri - may be null
        othersRoleTypeUri - may be null
        othersTopicTypeUri - may be null
        Returns:
        The fetched topics.
      • fetchTopicRelatedAssocs

        List<RelatedAssocModelImpl> fetchTopicRelatedAssocs​(long topicId,
                                                            String assocTypeUri,
                                                            String myRoleTypeUri,
                                                            String othersRoleTypeUri,
                                                            String othersAssocTypeUri)
        Parameters:
        assocTypeUri - may be null
        myRoleTypeUri - may be null
        othersRoleTypeUri - may be null
        othersTopicTypeUri - may be null
        Returns:
        The fetched associations.
      • fetchAssocRelatedTopics

        List<RelatedTopicModelImpl> fetchAssocRelatedTopics​(long assocId,
                                                            String assocTypeUri,
                                                            String myRoleTypeUri,
                                                            String othersRoleTypeUri,
                                                            String othersTopicTypeUri)
        Parameters:
        assocTypeUri - may be null
        myRoleTypeUri - may be null
        othersRoleTypeUri - may be null
        othersTopicTypeUri - may be null
        Returns:
        The fetched topics.
      • fetchAssocRelatedAssocs

        List<RelatedAssocModelImpl> fetchAssocRelatedAssocs​(long assocId,
                                                            String assocTypeUri,
                                                            String myRoleTypeUri,
                                                            String othersRoleTypeUri,
                                                            String othersAssocTypeUri)
        Parameters:
        assocTypeUri - may be null
        myRoleTypeUri - may be null
        othersRoleTypeUri - may be null
        othersTopicTypeUri - may be null
        Returns:
        The fetched associations.
      • fetchRelatedTopics

        List<RelatedTopicModelImpl> fetchRelatedTopics​(long objectId,
                                                       String assocTypeUri,
                                                       String myRoleTypeUri,
                                                       String othersRoleTypeUri,
                                                       String othersTopicTypeUri)
        Parameters:
        objectId - id of a topic or an association
        assocTypeUri - may be null
        myRoleTypeUri - may be null
        othersRoleTypeUri - may be null
        othersTopicTypeUri - may be null
        Returns:
        The fetched topics.
      • fetchRelatedAssocs

        List<RelatedAssocModelImpl> fetchRelatedAssocs​(long objectId,
                                                       String assocTypeUri,
                                                       String myRoleTypeUri,
                                                       String othersRoleTypeUri,
                                                       String othersAssocTypeUri)
        Parameters:
        objectId - id of a topic or an association
        assocTypeUri - may be null
        myRoleTypeUri - may be null
        othersRoleTypeUri - may be null
        othersTopicTypeUri - may be null
        Returns:
        The fetched associations.
      • fetchProperty

        Object fetchProperty​(long id,
                             String propUri)
        Parameters:
        id - id of a topic or an association
      • hasProperty

        boolean hasProperty​(long id,
                            String propUri)
        Parameters:
        id - id of a topic or an association
      • storeTopicProperty

        void storeTopicProperty​(long topicId,
                                String propUri,
                                Object propValue,
                                boolean addToIndex)
      • storeAssocProperty

        void storeAssocProperty​(long assocId,
                                String propUri,
                                Object propValue,
                                boolean addToIndex)
      • indexTopicProperty

        void indexTopicProperty​(long topicId,
                                String propUri,
                                Object propValue)
      • indexAssocProperty

        void indexAssocProperty​(long assocId,
                                String propUri,
                                Object propValue)
      • deleteTopicProperty

        void deleteTopicProperty​(long topicId,
                                 String propUri)
      • deleteAssocProperty

        void deleteAssocProperty​(long assocId,
                                 String propUri)
      • setupRootNode

        boolean setupRootNode()
      • shutdown

        void shutdown()
      • getDatabaseVendorObject

        Object getDatabaseVendorObject()
      • getDatabaseVendorObject

        Object getDatabaseVendorObject​(long objectId)