Package systems.dmx.storage.neo4j
Class Neo4jStorage
- java.lang.Object
- 
- systems.dmx.storage.neo4j.Neo4jStorage
 
- 
- All Implemented Interfaces:
- DMXStorage
 
 public class Neo4jStorage extends Object implements DMXStorage 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description DMXTransactionbeginTx()voiddeleteAssoc(long assocId)voiddeleteAssocProperty(long assocId, String propUri)voiddeleteTopic(long topicId)Deletes the topic.voiddeleteTopicProperty(long topicId, String propUri)Iterable<AssocModelImpl>fetchAllAssocs()Iterable<TopicModelImpl>fetchAllTopics()AssocModelImplfetchAssoc(long assocId)Fetches an assoc by ID.List<AssocModelImpl>fetchAssocAssocs(long assocId)List<RelatedAssocModelImpl>fetchAssocRelatedAssocs(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)<M extends RelatedObjectModel>
 List<M>fetchAssocRelatedObjects(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)List<RelatedTopicModelImpl>fetchAssocRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)List<AssocModelImpl>fetchAssocs(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)Returns the associations between two topics.List<AssocModelImpl>fetchAssocs(String key, Object value)Fetches assocs by exact value.List<AssocModelImpl>fetchAssocsBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)List<AssocModelImpl>fetchAssocsByProperty(String propUri, Object propValue)List<AssocModelImpl>fetchAssocsByPropertyRange(String propUri, Number from, Number to)DMXObjectModelImplfetchObject(long id)List<PlayerModel>fetchPlayerModels(long assocId)ObjectfetchProperty(long id, String propUri)List<RelatedAssocModelImpl>fetchRelatedAssocs(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)List<RelatedTopicModelImpl>fetchRelatedTopics(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)TopicModelImplfetchTopic(long topicId)Fetches a topic by ID.List<AssocModelImpl>fetchTopicAssocs(long topicId)List<RelatedAssocModelImpl>fetchTopicRelatedAssocs(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)<M extends RelatedObjectModel>
 List<M>fetchTopicRelatedObjects(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)List<RelatedTopicModelImpl>fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)List<TopicModelImpl>fetchTopics(String key, Object value)Fetches topics by exact value.List<TopicModelImpl>fetchTopicsByProperty(String propUri, Object propValue)List<TopicModelImpl>fetchTopicsByPropertyRange(String propUri, Number from, Number to)ObjectgetDatabaseVendorObject()ObjectgetDatabaseVendorObject(long objectId)ModelFactoryImplgetModelFactory()booleanhasProperty(long id, String propUri)voidindexAssocProperty(long assocId, String propUri, Object propValue)voidindexTopicFulltext(long topicId, String text, String indexKey)voidindexTopicProperty(long topicId, String propUri, Object propValue)List<AssocModelImpl>queryAssocs(String key, Object value)List<AssocModelImpl>queryAssocsByRoleType(String roleTypeUri)List<AssocModelImpl>queryAssocsFulltext(String key, Object value)List<TopicModelImpl>queryTopics(String key, Object value)List<TopicModelImpl>queryTopicsFulltext(String key, Object value)booleansetupRootNode()voidshutdown()voidstoreAssoc(AssocModelImpl assocModel)voidstoreAssocProperty(long assocId, String propUri, Object propValue, boolean addToIndex)voidstoreAssocTypeUri(long assocId, String assocTypeUri)voidstoreAssocUri(long assocId, String uri)Stores and indexes the association's URI.voidstoreAssocValue(long assocId, SimpleValue value, String indexKey, boolean isHtmlValue)Stores and indexes an association value.voidstoreRoleTypeUri(long assocId, long playerId, String roleTypeUri)voidstoreTopic(TopicModelImpl topicModel)Stores a rudimentary topic in the DB.voidstoreTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)voidstoreTopicTypeUri(long topicId, String topicTypeUri)voidstoreTopicUri(long topicId, String uri)Stores and indexes the topic's URI.voidstoreTopicValue(long topicId, SimpleValue value, String indexKey, boolean isHtmlValue)Stores and indexes a topic value.
 
- 
- 
- 
Method Detail- 
fetchTopicpublic TopicModelImpl fetchTopic(long topicId) Description copied from interface:DMXStorageFetches a topic by ID.- Specified by:
- fetchTopicin interface- DMXStorage
- Returns:
- The fetched topic.
 
 - 
fetchTopicspublic List<TopicModelImpl> fetchTopics(String key, Object value) Description copied from interface:DMXStorageFetches topics by exact value.- Specified by:
- fetchTopicsin interface- DMXStorage
 
 - 
queryTopicspublic List<TopicModelImpl> queryTopics(String key, Object value) - Specified by:
- queryTopicsin interface- DMXStorage
 
 - 
queryTopicsFulltextpublic List<TopicModelImpl> queryTopicsFulltext(String key, Object value) - Specified by:
- queryTopicsFulltextin interface- DMXStorage
- Returns:
- The fetched topics.
 
 - 
fetchAllTopicspublic Iterable<TopicModelImpl> fetchAllTopics() - Specified by:
- fetchAllTopicsin interface- DMXStorage
 
 - 
storeTopicpublic void storeTopic(TopicModelImpl topicModel) Description copied from interface:DMXStorageStores 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. - Specified by:
- storeTopicin interface- DMXStorage
- 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- nullwas passed. - an empty simple value ("") in case- nullwas passed.
 
 - 
storeTopicUripublic void storeTopicUri(long topicId, String uri)Description copied from interface:DMXStorageStores and indexes the topic's URI.- Specified by:
- storeTopicUriin interface- DMXStorage
 
 - 
storeTopicTypeUripublic void storeTopicTypeUri(long topicId, String topicTypeUri)- Specified by:
- storeTopicTypeUriin interface- DMXStorage
 
 - 
storeTopicValuepublic void storeTopicValue(long topicId, SimpleValue value, String indexKey, boolean isHtmlValue)Description copied from interface:DMXStorageStores and indexes a topic value.- Specified by:
- storeTopicValuein interface- DMXStorage
- indexKey- must not null
 
 - 
indexTopicFulltextpublic void indexTopicFulltext(long topicId, String text, String indexKey)- Specified by:
- indexTopicFulltextin interface- DMXStorage
 
 - 
deleteTopicpublic void deleteTopic(long topicId) Description copied from interface:DMXStorageDeletes the topic.Prerequisite: the topic has no relations. - Specified by:
- deleteTopicin interface- DMXStorage
 
 - 
fetchAssocpublic AssocModelImpl fetchAssoc(long assocId) Description copied from interface:DMXStorageFetches an assoc by ID.- Specified by:
- fetchAssocin interface- DMXStorage
- Returns:
- The fetched assoc.
 
 - 
fetchAssocspublic List<AssocModelImpl> fetchAssocs(String key, Object value) Description copied from interface:DMXStorageFetches assocs by exact value.- Specified by:
- fetchAssocsin interface- DMXStorage
 
 - 
queryAssocspublic List<AssocModelImpl> queryAssocs(String key, Object value) - Specified by:
- queryAssocsin interface- DMXStorage
 
 - 
queryAssocsFulltextpublic List<AssocModelImpl> queryAssocsFulltext(String key, Object value) - Specified by:
- queryAssocsFulltextin interface- DMXStorage
- Returns:
- The fetched assocs.
 
 - 
queryAssocsByRoleTypepublic List<AssocModelImpl> queryAssocsByRoleType(String roleTypeUri) - Specified by:
- queryAssocsByRoleTypein interface- DMXStorage
 
 - 
fetchAssocspublic List<AssocModelImpl> fetchAssocs(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2) Description copied from interface:DMXStorageReturns the associations between two topics. If no such association exists an empty set is returned.- Specified by:
- fetchAssocsin interface- DMXStorage
- Parameters:
- assocTypeUri- Assoc type filter. Pass- nullto switch filter off.
 
 - 
fetchAssocsBetweenTopicAndAssocpublic List<AssocModelImpl> fetchAssocsBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri) - Specified by:
- fetchAssocsBetweenTopicAndAssocin interface- DMXStorage
 
 - 
fetchAllAssocspublic Iterable<AssocModelImpl> fetchAllAssocs() - Specified by:
- fetchAllAssocsin interface- DMXStorage
 
 - 
fetchPlayerModelspublic List<PlayerModel> fetchPlayerModels(long assocId) - Specified by:
- fetchPlayerModelsin interface- DMXStorage
 
 - 
storeAssocpublic void storeAssoc(AssocModelImpl assocModel) - Specified by:
- storeAssocin interface- DMXStorage
 
 - 
storeAssocUripublic void storeAssocUri(long assocId, String uri)Description copied from interface:DMXStorageStores and indexes the association's URI.- Specified by:
- storeAssocUriin interface- DMXStorage
 
 - 
storeAssocTypeUripublic void storeAssocTypeUri(long assocId, String assocTypeUri)- Specified by:
- storeAssocTypeUriin interface- DMXStorage
 
 - 
storeAssocValuepublic void storeAssocValue(long assocId, SimpleValue value, String indexKey, boolean isHtmlValue)Description copied from interface:DMXStorageStores and indexes an association value.- Specified by:
- storeAssocValuein interface- DMXStorage
- indexKey- must not null
 
 - 
storeRoleTypeUripublic void storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)- Specified by:
- storeRoleTypeUriin interface- DMXStorage
 
 - 
deleteAssocpublic void deleteAssoc(long assocId) - Specified by:
- deleteAssocin interface- DMXStorage
 
 - 
fetchObjectpublic DMXObjectModelImpl fetchObject(long id) - Specified by:
- fetchObjectin interface- DMXStorage
 
 - 
fetchTopicAssocspublic List<AssocModelImpl> fetchTopicAssocs(long topicId) - Specified by:
- fetchTopicAssocsin interface- DMXStorage
 
 - 
fetchAssocAssocspublic List<AssocModelImpl> fetchAssocAssocs(long assocId) - Specified by:
- fetchAssocAssocsin interface- DMXStorage
 
 - 
fetchTopicRelatedTopicspublic List<RelatedTopicModelImpl> fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri) - Specified by:
- fetchTopicRelatedTopicsin interface- DMXStorage
- assocTypeUri- may be null
- myRoleTypeUri- may be null
- othersRoleTypeUri- may be null
- othersTopicTypeUri- may be null
- Returns:
- The fetched topics.
 
 - 
fetchTopicRelatedAssocspublic List<RelatedAssocModelImpl> fetchTopicRelatedAssocs(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri) - Specified by:
- fetchTopicRelatedAssocsin interface- DMXStorage
- assocTypeUri- may be null
- myRoleTypeUri- may be null
- othersRoleTypeUri- may be null
- Returns:
- The fetched associations.
 
 - 
fetchAssocRelatedTopicspublic List<RelatedTopicModelImpl> fetchAssocRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri) - Specified by:
- fetchAssocRelatedTopicsin interface- DMXStorage
- assocTypeUri- may be null
- myRoleTypeUri- may be null
- othersRoleTypeUri- may be null
- othersTopicTypeUri- may be null
- Returns:
- The fetched topics.
 
 - 
fetchAssocRelatedAssocspublic List<RelatedAssocModelImpl> fetchAssocRelatedAssocs(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri) - Specified by:
- fetchAssocRelatedAssocsin interface- DMXStorage
- assocTypeUri- may be null
- myRoleTypeUri- may be null
- othersRoleTypeUri- may be null
- Returns:
- The fetched associations.
 
 - 
fetchTopicRelatedObjectspublic <M extends RelatedObjectModel> List<M> fetchTopicRelatedObjects(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri) - Specified by:
- fetchTopicRelatedObjectsin interface- DMXStorage
 
 - 
fetchAssocRelatedObjectspublic <M extends RelatedObjectModel> List<M> fetchAssocRelatedObjects(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri) - Specified by:
- fetchAssocRelatedObjectsin interface- DMXStorage
 
 - 
fetchRelatedTopicspublic List<RelatedTopicModelImpl> fetchRelatedTopics(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri) - Specified by:
- fetchRelatedTopicsin interface- DMXStorage
- Parameters:
- id- 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.
 
 - 
fetchRelatedAssocspublic List<RelatedAssocModelImpl> fetchRelatedAssocs(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri) - Specified by:
- fetchRelatedAssocsin interface- DMXStorage
- Parameters:
- id- id of a topic or an association
- assocTypeUri- may be null
- myRoleTypeUri- may be null
- othersRoleTypeUri- may be null
- Returns:
- The fetched associations.
 
 - 
fetchPropertypublic Object fetchProperty(long id, String propUri) - Specified by:
- fetchPropertyin interface- DMXStorage
- Parameters:
- id- id of a topic or an association
 
 - 
hasPropertypublic boolean hasProperty(long id, String propUri)- Specified by:
- hasPropertyin interface- DMXStorage
- Parameters:
- id- id of a topic or an association
 
 - 
fetchTopicsByPropertypublic List<TopicModelImpl> fetchTopicsByProperty(String propUri, Object propValue) - Specified by:
- fetchTopicsByPropertyin interface- DMXStorage
 
 - 
fetchTopicsByPropertyRangepublic List<TopicModelImpl> fetchTopicsByPropertyRange(String propUri, Number from, Number to) - Specified by:
- fetchTopicsByPropertyRangein interface- DMXStorage
 
 - 
fetchAssocsByPropertypublic List<AssocModelImpl> fetchAssocsByProperty(String propUri, Object propValue) - Specified by:
- fetchAssocsByPropertyin interface- DMXStorage
 
 - 
fetchAssocsByPropertyRangepublic List<AssocModelImpl> fetchAssocsByPropertyRange(String propUri, Number from, Number to) - Specified by:
- fetchAssocsByPropertyRangein interface- DMXStorage
 
 - 
storeTopicPropertypublic void storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)- Specified by:
- storeTopicPropertyin interface- DMXStorage
 
 - 
storeAssocPropertypublic void storeAssocProperty(long assocId, String propUri, Object propValue, boolean addToIndex)- Specified by:
- storeAssocPropertyin interface- DMXStorage
 
 - 
indexTopicPropertypublic void indexTopicProperty(long topicId, String propUri, Object propValue)- Specified by:
- indexTopicPropertyin interface- DMXStorage
 
 - 
indexAssocPropertypublic void indexAssocProperty(long assocId, String propUri, Object propValue)- Specified by:
- indexAssocPropertyin interface- DMXStorage
 
 - 
deleteTopicPropertypublic void deleteTopicProperty(long topicId, String propUri)- Specified by:
- deleteTopicPropertyin interface- DMXStorage
 
 - 
deleteAssocPropertypublic void deleteAssocProperty(long assocId, String propUri)- Specified by:
- deleteAssocPropertyin interface- DMXStorage
 
 - 
beginTxpublic DMXTransaction beginTx() - Specified by:
- beginTxin interface- DMXStorage
 
 - 
setupRootNodepublic boolean setupRootNode() - Specified by:
- setupRootNodein interface- DMXStorage
 
 - 
shutdownpublic void shutdown() - Specified by:
- shutdownin interface- DMXStorage
 
 - 
getDatabaseVendorObjectpublic Object getDatabaseVendorObject() - Specified by:
- getDatabaseVendorObjectin interface- DMXStorage
 
 - 
getDatabaseVendorObjectpublic Object getDatabaseVendorObject(long objectId) - Specified by:
- getDatabaseVendorObjectin interface- DMXStorage
 
 - 
getModelFactorypublic ModelFactoryImpl getModelFactory() - Specified by:
- getModelFactoryin interface- DMXStorage
 
 
- 
 
-