public class Neo4jStorage extends Object implements DMXStorage
Modifier and Type | Method and Description |
---|---|
DMXTransaction |
beginTx() |
void |
deleteAssoc(long assocId) |
void |
deleteAssocProperty(long assocId,
String propUri) |
void |
deleteTopic(long topicId)
Deletes the topic.
|
void |
deleteTopicProperty(long topicId,
String propUri) |
Iterable<AssocModelImpl> |
fetchAllAssocs() |
Iterable<TopicModelImpl> |
fetchAllTopics() |
AssocModelImpl |
fetchAssoc(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> |
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) |
DMXObjectModelImpl |
fetchObject(long id) |
List<PlayerModel> |
fetchPlayerModels(long assocId) |
Object |
fetchProperty(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) |
TopicModelImpl |
fetchTopic(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> |
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) |
Object |
getDatabaseVendorObject() |
Object |
getDatabaseVendorObject(long objectId) |
ModelFactoryImpl |
getModelFactory() |
boolean |
hasProperty(long id,
String propUri) |
void |
indexAssocProperty(long assocId,
String propUri,
Object propValue) |
void |
indexTopicProperty(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) |
boolean |
setupRootNode() |
void |
shutdown() |
void |
storeAssoc(AssocModelImpl assocModel) |
void |
storeAssocProperty(long assocId,
String propUri,
Object propValue,
boolean addToIndex) |
void |
storeAssocTypeUri(long assocId,
String assocTypeUri) |
void |
storeAssocUri(long assocId,
String uri)
Stores and indexes the association's URI.
|
void |
storeAssocValue(long assocId,
SimpleValue value,
String indexKey,
boolean isHtmlValue)
Stores and indexes an association value.
|
void |
storeRoleTypeUri(long assocId,
long playerId,
String roleTypeUri) |
void |
storeTopic(TopicModelImpl topicModel)
Stores a rudimentary topic in the DB.
|
void |
storeTopicProperty(long topicId,
String propUri,
Object propValue,
boolean addToIndex) |
void |
storeTopicTypeUri(long topicId,
String topicTypeUri) |
void |
storeTopicUri(long topicId,
String uri)
Stores and indexes the topic's URI.
|
void |
storeTopicValue(long topicId,
SimpleValue value,
String indexKey,
boolean isHtmlValue)
Stores and indexes a topic value.
|
public TopicModelImpl fetchTopic(long topicId)
DMXStorage
fetchTopic
in interface DMXStorage
public List<TopicModelImpl> fetchTopics(String key, Object value)
DMXStorage
fetchTopics
in interface DMXStorage
public List<TopicModelImpl> queryTopics(String key, Object value)
queryTopics
in interface DMXStorage
public List<TopicModelImpl> queryTopicsFulltext(String key, Object value)
queryTopicsFulltext
in interface DMXStorage
public Iterable<TopicModelImpl> fetchAllTopics()
fetchAllTopics
in interface DMXStorage
public void storeTopic(TopicModelImpl topicModel)
DMXStorage
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.
storeTopic
in interface DMXStorage
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.public void storeTopicUri(long topicId, String uri)
DMXStorage
storeTopicUri
in interface DMXStorage
public void storeTopicTypeUri(long topicId, String topicTypeUri)
storeTopicTypeUri
in interface DMXStorage
public void storeTopicValue(long topicId, SimpleValue value, String indexKey, boolean isHtmlValue)
DMXStorage
storeTopicValue
in interface DMXStorage
indexKey
- must not nullpublic void deleteTopic(long topicId)
DMXStorage
Prerequisite: the topic has no relations.
deleteTopic
in interface DMXStorage
public AssocModelImpl fetchAssoc(long assocId)
DMXStorage
fetchAssoc
in interface DMXStorage
public List<AssocModelImpl> fetchAssocs(String key, Object value)
DMXStorage
fetchAssocs
in interface DMXStorage
public List<AssocModelImpl> queryAssocs(String key, Object value)
queryAssocs
in interface DMXStorage
public List<AssocModelImpl> queryAssocsFulltext(String key, Object value)
queryAssocsFulltext
in interface DMXStorage
public List<AssocModelImpl> queryAssocsByRoleType(String roleTypeUri)
queryAssocsByRoleType
in interface DMXStorage
public List<AssocModelImpl> fetchAssocs(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
DMXStorage
fetchAssocs
in interface DMXStorage
assocTypeUri
- Assoc type filter. Pass null
to switch filter off.public List<AssocModelImpl> fetchAssocsBetweenTopicAndAssoc(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
fetchAssocsBetweenTopicAndAssoc
in interface DMXStorage
public Iterable<AssocModelImpl> fetchAllAssocs()
fetchAllAssocs
in interface DMXStorage
public List<PlayerModel> fetchPlayerModels(long assocId)
fetchPlayerModels
in interface DMXStorage
public void storeAssoc(AssocModelImpl assocModel)
storeAssoc
in interface DMXStorage
public void storeAssocUri(long assocId, String uri)
DMXStorage
storeAssocUri
in interface DMXStorage
public void storeAssocTypeUri(long assocId, String assocTypeUri)
storeAssocTypeUri
in interface DMXStorage
public void storeAssocValue(long assocId, SimpleValue value, String indexKey, boolean isHtmlValue)
DMXStorage
storeAssocValue
in interface DMXStorage
indexKey
- must not nullpublic void storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)
storeRoleTypeUri
in interface DMXStorage
public void deleteAssoc(long assocId)
deleteAssoc
in interface DMXStorage
public DMXObjectModelImpl fetchObject(long id)
fetchObject
in interface DMXStorage
public List<AssocModelImpl> fetchTopicAssocs(long topicId)
fetchTopicAssocs
in interface DMXStorage
public List<AssocModelImpl> fetchAssocAssocs(long assocId)
fetchAssocAssocs
in interface DMXStorage
public List<RelatedTopicModelImpl> fetchTopicRelatedTopics(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
fetchTopicRelatedTopics
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullpublic List<RelatedAssocModelImpl> fetchTopicRelatedAssocs(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
fetchTopicRelatedAssocs
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullpublic List<RelatedTopicModelImpl> fetchAssocRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
fetchAssocRelatedTopics
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullpublic List<RelatedAssocModelImpl> fetchAssocRelatedAssocs(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
fetchAssocRelatedAssocs
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullpublic <M extends RelatedObjectModel> List<M> fetchTopicRelatedObjects(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)
fetchTopicRelatedObjects
in interface DMXStorage
public <M extends RelatedObjectModel> List<M> fetchAssocRelatedObjects(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTypeUri)
fetchAssocRelatedObjects
in interface DMXStorage
public List<RelatedTopicModelImpl> fetchRelatedTopics(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
fetchRelatedTopics
in interface DMXStorage
id
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullpublic List<RelatedAssocModelImpl> fetchRelatedAssocs(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
fetchRelatedAssocs
in interface DMXStorage
id
- id of a topic or an associationassocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullpublic Object fetchProperty(long id, String propUri)
fetchProperty
in interface DMXStorage
id
- id of a topic or an associationpublic boolean hasProperty(long id, String propUri)
hasProperty
in interface DMXStorage
id
- id of a topic or an associationpublic List<TopicModelImpl> fetchTopicsByProperty(String propUri, Object propValue)
fetchTopicsByProperty
in interface DMXStorage
public List<TopicModelImpl> fetchTopicsByPropertyRange(String propUri, Number from, Number to)
fetchTopicsByPropertyRange
in interface DMXStorage
public List<AssocModelImpl> fetchAssocsByProperty(String propUri, Object propValue)
fetchAssocsByProperty
in interface DMXStorage
public List<AssocModelImpl> fetchAssocsByPropertyRange(String propUri, Number from, Number to)
fetchAssocsByPropertyRange
in interface DMXStorage
public void storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)
storeTopicProperty
in interface DMXStorage
public void storeAssocProperty(long assocId, String propUri, Object propValue, boolean addToIndex)
storeAssocProperty
in interface DMXStorage
public void indexTopicProperty(long topicId, String propUri, Object propValue)
indexTopicProperty
in interface DMXStorage
public void indexAssocProperty(long assocId, String propUri, Object propValue)
indexAssocProperty
in interface DMXStorage
public void deleteTopicProperty(long topicId, String propUri)
deleteTopicProperty
in interface DMXStorage
public void deleteAssocProperty(long assocId, String propUri)
deleteAssocProperty
in interface DMXStorage
public DMXTransaction beginTx()
beginTx
in interface DMXStorage
public boolean setupRootNode()
setupRootNode
in interface DMXStorage
public void shutdown()
shutdown
in interface DMXStorage
public Object getDatabaseVendorObject()
getDatabaseVendorObject
in interface DMXStorage
public Object getDatabaseVendorObject(long objectId)
getDatabaseVendorObject
in interface DMXStorage
public ModelFactoryImpl getModelFactory()
getModelFactory
in interface DMXStorage
Copyright © 2023. All Rights Reserved.