public class Neo4jStorage extends Object implements DMXStorage
Modifier and Type | Field and Description |
---|---|
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
assocContentExact |
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
assocContentFulltext |
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
assocMetadata |
private static String |
KEY_ASSOC_ID |
private static String |
KEY_ASSOC_TPYE_URI |
private static String |
KEY_FULLTEXT |
private static String |
KEY_NODE_TYPE |
private static String |
KEY_PLAYER_ID |
private static String |
KEY_PLAYER_TPYE |
private static String |
KEY_PLAYER_TYPE_URI |
private static String |
KEY_ROLE_TPYE_URI |
private static String |
KEY_TPYE_URI |
private static String |
KEY_URI |
private static String |
KEY_VALUE |
private Logger |
logger |
private ModelFactory |
mf |
(package private) org.neo4j.graphdb.GraphDatabaseService |
neo4j |
private RelationtypeCache |
relTypeCache |
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
topicContentExact |
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
topicContentFulltext |
Constructor and Description |
---|
Neo4jStorage(String databasePath,
ModelFactory mf) |
Modifier and Type | Method and Description |
---|---|
private void |
addRole(org.apache.lucene.search.BooleanQuery query,
int pos,
String roleTypeUri,
NodeType playerType,
long playerId,
String playerTypeUri) |
private void |
addTermQuery(String key,
long value,
org.apache.lucene.search.BooleanQuery query) |
private void |
addTermQuery(String key,
NodeType nodeType,
org.apache.lucene.search.BooleanQuery query) |
private void |
addTermQuery(String key,
String value,
org.apache.lucene.search.BooleanQuery query) |
DMXTransaction |
beginTx() |
(package private) AssociationModel |
buildAssociation(org.neo4j.graphdb.Node assocNode) |
private org.apache.lucene.search.Query |
buildAssociationQuery(String assocTypeUri,
String roleTypeUri1,
NodeType playerType1,
long playerId1,
String playerTypeUri1,
String roleTypeUri2,
NodeType playerType2,
long playerId2,
String playerTypeUri2) |
private List<AssociationModel> |
buildAssociations(Iterable<org.neo4j.graphdb.Node> assocNodes) |
private org.neo4j.index.lucene.QueryContext |
buildNumericRangeQuery(String propUri,
Number from,
Number to) |
private List<RelatedAssociationModel> |
buildRelatedAssociations(List<AssociationModel> assocs,
long playerId) |
private List<RelatedTopicModel> |
buildRelatedTopics(List<AssociationModel> assocs,
long playerId) |
private List<RoleModel> |
buildRoleModels(org.neo4j.graphdb.Node assocNode) |
(package private) TopicModel |
buildTopic(org.neo4j.graphdb.Node topicNode) |
private List<TopicModel> |
buildTopics(Iterable<org.neo4j.graphdb.Node> topicNodes) |
private org.neo4j.graphdb.Node |
checkNodeType(org.neo4j.graphdb.Node node,
NodeType type) |
private void |
checkUriUniqueness(String uri)
Checks if a topic or an association with the given URI exists in the DB, and
throws an exception if so.
|
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
createExactIndex(String name) |
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> |
createFulltextIndex(String name) |
void |
deleteAssociation(long assocId) |
void |
deleteAssociationProperty(long assocId,
String propUri) |
void |
deleteTopic(long topicId) |
void |
deleteTopicProperty(long topicId,
String propUri) |
Iterator<AssociationModel> |
fetchAllAssociations() |
Iterator<TopicModel> |
fetchAllTopics() |
AssociationModel |
fetchAssociation(long assocId) |
AssociationModel |
fetchAssociation(String key,
Object value) |
List<AssociationModel> |
fetchAssociationAssociations(long assocId) |
private org.neo4j.graphdb.Node |
fetchAssociationNode(long assocId) |
List<RelatedAssociationModel> |
fetchAssociationRelatedAssociations(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
List<RelatedTopicModel> |
fetchAssociationRelatedTopics(long assocId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
private List<AssociationModel> |
fetchAssociations(org.neo4j.graphdb.Node node)
Fetches all associations the given topic or association is involved in.
|
List<AssociationModel> |
fetchAssociations(String assocTypeUri,
long topicId1,
long topicId2,
String roleTypeUri1,
String roleTypeUri2) |
List<AssociationModel> |
fetchAssociations(String key,
Object value) |
List<AssociationModel> |
fetchAssociationsBetweenTopicAndAssociation(String assocTypeUri,
long topicId,
long assocId,
String topicRoleTypeUri,
String assocRoleTypeUri) |
List<AssociationModel> |
fetchAssociationsByProperty(String propUri,
Object propValue) |
List<AssociationModel> |
fetchAssociationsByPropertyRange(String propUri,
Number from,
Number to) |
private org.neo4j.graphdb.Node |
fetchNode(long id) |
DMXObjectModel |
fetchObject(long id) |
long[] |
fetchPlayerIds(long assocId) |
private org.neo4j.graphdb.Node |
fetchPlayerNode(RoleModel roleModel) |
Object |
fetchProperty(long id,
String propUri) |
List<RelatedAssociationModel> |
fetchRelatedAssociations(long id,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
List<RelatedTopicModel> |
fetchRelatedTopics(long id,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
private org.neo4j.graphdb.Relationship |
fetchRelationship(org.neo4j.graphdb.Node assocNode,
long playerId) |
private List<org.neo4j.graphdb.Relationship> |
fetchRelationships(org.neo4j.graphdb.Node assocNode) |
TopicModel |
fetchTopic(long topicId) |
TopicModel |
fetchTopic(String key,
Object value) |
List<AssociationModel> |
fetchTopicAssociations(long topicId) |
private org.neo4j.graphdb.Node |
fetchTopicNode(long topicId) |
private org.neo4j.graphdb.Node |
fetchTopicNodeByUri(String uri) |
private org.neo4j.graphdb.Node |
fetchTopicPlayerNode(TopicRoleModel roleModel) |
List<RelatedAssociationModel> |
fetchTopicRelatedAssociations(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersAssocTypeUri) |
List<RelatedTopicModel> |
fetchTopicRelatedTopics(long topicId,
String assocTypeUri,
String myRoleTypeUri,
String othersRoleTypeUri,
String othersTopicTypeUri) |
List<TopicModel> |
fetchTopics(String key,
Object value) |
List<TopicModel> |
fetchTopicsByProperty(String propUri,
Object propValue) |
List<TopicModel> |
fetchTopicsByPropertyRange(String propUri,
Number from,
Number to) |
Object |
getDatabaseVendorObject() |
Object |
getDatabaseVendorObject(long objectId) |
private Object |
getIndexValue(SimpleValue value,
SimpleValue indexValue) |
ModelFactory |
getModelFactory() |
private org.neo4j.graphdb.RelationshipType |
getRelationshipType(String typeName) |
boolean |
hasProperty(long id,
String propUri) |
private void |
indexAssociation(org.neo4j.graphdb.Node assocNode,
String roleTypeUri1,
org.neo4j.graphdb.Node playerNode1,
String roleTypeUri2,
org.neo4j.graphdb.Node playerNode2) |
private void |
indexAssociationId(org.neo4j.graphdb.Node assocNode) |
private void |
indexAssociationNodeValue(org.neo4j.graphdb.Node assocNode,
List<IndexMode> indexModes,
String indexKey,
Object indexValue) |
void |
indexAssociationProperty(long assocId,
String propUri,
Object propValue) |
private void |
indexAssociationRole(org.neo4j.graphdb.Node assocNode,
int pos,
String roleTypeUri,
org.neo4j.graphdb.Node playerNode) |
private void |
indexAssociationRoleType(org.neo4j.graphdb.Node assocNode,
long playerId,
String roleTypeUri) |
private void |
indexAssociationType(org.neo4j.graphdb.Node assocNode,
String assocTypeUri) |
void |
indexAssociationValue(long assocId,
IndexMode indexMode,
String indexKey,
SimpleValue indexValue) |
private void |
indexExactValue(org.neo4j.graphdb.Node node,
String key,
Object value,
org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> exactIndex) |
private void |
indexNodeValue(org.neo4j.graphdb.Node node,
Object value,
List<IndexMode> indexModes,
String indexKey,
org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> exactIndex,
org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> fulltextIndex) |
private void |
indexTopicNodeValue(org.neo4j.graphdb.Node topicNode,
List<IndexMode> indexModes,
String indexKey,
Object indexValue) |
void |
indexTopicProperty(long topicId,
String propUri,
Object propValue) |
void |
indexTopicValue(long topicId,
IndexMode indexMode,
String indexKey,
SimpleValue indexValue) |
private boolean |
isPlayerAtPosition(int pos,
long assocId,
long playerId) |
private org.neo4j.graphdb.index.IndexHits<org.neo4j.graphdb.Node> |
lookupAssociations(int pos,
org.neo4j.graphdb.Node playerNode) |
private int |
lookupPlayerPosition(long assocId,
long playerId) |
private long |
playerId(org.neo4j.graphdb.Relationship rel) |
private List<AssociationModel> |
queryAssociationIndex(String assocTypeUri,
String roleTypeUri1,
NodeType playerType1,
long playerId1,
String playerTypeUri1,
String roleTypeUri2,
NodeType playerType2,
long playerId2,
String playerTypeUri2) |
private org.neo4j.graphdb.index.IndexHits<org.neo4j.graphdb.Node> |
queryIndexByProperty(org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> index,
String propUri,
Object propValue) |
private org.neo4j.graphdb.index.IndexHits<org.neo4j.graphdb.Node> |
queryIndexByPropertyRange(org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> index,
String propUri,
Number from,
Number to) |
List<TopicModel> |
queryTopics(Object value) |
List<TopicModel> |
queryTopics(String key,
Object value) |
private void |
reindexTypeUri(int pos,
org.neo4j.graphdb.Node playerNode,
String typeUri)
Re-indexes the KEY_PLAYER_TYPE_URI of all associations in which the specified node
is a player at the specified position.
|
private void |
reindexTypeUri(org.neo4j.graphdb.Node playerNode,
String typeUri) |
private void |
reindexValue(org.neo4j.graphdb.Node assocNode,
String key,
int pos,
String value) |
private void |
reindexValue(org.neo4j.graphdb.Node assocNode,
String key,
String value) |
private void |
removeAssociationFromIndex(org.neo4j.graphdb.Node assocNode) |
private void |
removeAssociationPropertyFromIndex(org.neo4j.graphdb.Node assocNode,
String propUri) |
private void |
removeTopicFromIndex(org.neo4j.graphdb.Node topicNode) |
private void |
removeTopicPropertyFromIndex(org.neo4j.graphdb.Node topicNode,
String propUri) |
private void |
setDefaults(DMXObjectModel model) |
boolean |
setupRootNode() |
void |
shutdown() |
private SimpleValue |
simpleValue(org.neo4j.graphdb.Node node) |
private void |
storeAndIndexAssociationTypeUri(org.neo4j.graphdb.Node assocNode,
String assocTypeUri) |
private void |
storeAndIndexAssociationUri(org.neo4j.graphdb.Node assocNode,
String uri) |
private void |
storeAndIndexExactValue(org.neo4j.graphdb.Node node,
String key,
Object value,
org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> exactIndex)
Stores a node value under the specified key and adds the value to the specified index (under the same key).
|
private void |
storeAndIndexTopicTypeUri(org.neo4j.graphdb.Node topicNode,
String topicTypeUri) |
private void |
storeAndIndexTopicUri(org.neo4j.graphdb.Node topicNode,
String uri) |
void |
storeAssociation(AssociationModel assocModel) |
void |
storeAssociationProperty(long assocId,
String propUri,
Object propValue,
boolean addToIndex) |
void |
storeAssociationTypeUri(long assocId,
String assocTypeUri) |
void |
storeAssociationUri(long assocId,
String uri) |
void |
storeAssociationValue(long assocId,
SimpleValue value,
List<IndexMode> indexModes,
String indexKey,
SimpleValue indexValue)
Stores and indexes an association value.
|
private org.neo4j.graphdb.Node |
storePlayerRelationship(org.neo4j.graphdb.Node assocNode,
RoleModel roleModel) |
void |
storeRoleTypeUri(long assocId,
long playerId,
String roleTypeUri) |
void |
storeTopic(TopicModel 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) |
void |
storeTopicValue(long topicId,
SimpleValue value,
List<IndexMode> indexModes,
String indexKey,
SimpleValue indexValue)
Stores and indexes a topic value.
|
private String |
typeUri(org.neo4j.graphdb.Node node) |
private String |
uri(org.neo4j.graphdb.Node node) |
private static final String KEY_NODE_TYPE
private static final String KEY_VALUE
private static final String KEY_URI
private static final String KEY_TPYE_URI
private static final String KEY_FULLTEXT
private static final String KEY_ASSOC_ID
private static final String KEY_ASSOC_TPYE_URI
private static final String KEY_ROLE_TPYE_URI
private static final String KEY_PLAYER_TPYE
private static final String KEY_PLAYER_ID
private static final String KEY_PLAYER_TYPE_URI
org.neo4j.graphdb.GraphDatabaseService neo4j
private RelationtypeCache relTypeCache
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> topicContentExact
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> topicContentFulltext
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> assocContentExact
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> assocContentFulltext
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> assocMetadata
private ModelFactory mf
Neo4jStorage(String databasePath, ModelFactory mf)
public TopicModel fetchTopic(long topicId)
fetchTopic
in interface DMXStorage
public TopicModel fetchTopic(String key, Object value)
fetchTopic
in interface DMXStorage
public List<TopicModel> fetchTopics(String key, Object value)
fetchTopics
in interface DMXStorage
public List<TopicModel> queryTopics(Object value)
queryTopics
in interface DMXStorage
public List<TopicModel> queryTopics(String key, Object value)
queryTopics
in interface DMXStorage
public Iterator<TopicModel> fetchAllTopics()
fetchAllTopics
in interface DMXStorage
public void storeTopic(TopicModel 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)
storeTopicUri
in interface DMXStorage
public void storeTopicTypeUri(long topicId, String topicTypeUri)
storeTopicTypeUri
in interface DMXStorage
public void storeTopicValue(long topicId, SimpleValue value, List<IndexMode> indexModes, String indexKey, SimpleValue indexValue)
DMXStorage
storeTopicValue
in interface DMXStorage
indexValue
- Optional: the value to be indexed. If indexValue is not specified, value is used.public void indexTopicValue(long topicId, IndexMode indexMode, String indexKey, SimpleValue indexValue)
indexTopicValue
in interface DMXStorage
public void deleteTopic(long topicId)
deleteTopic
in interface DMXStorage
public AssociationModel fetchAssociation(long assocId)
fetchAssociation
in interface DMXStorage
public AssociationModel fetchAssociation(String key, Object value)
fetchAssociation
in interface DMXStorage
public List<AssociationModel> fetchAssociations(String key, Object value)
fetchAssociations
in interface DMXStorage
public List<AssociationModel> fetchAssociations(String assocTypeUri, long topicId1, long topicId2, String roleTypeUri1, String roleTypeUri2)
fetchAssociations
in interface DMXStorage
public List<AssociationModel> fetchAssociationsBetweenTopicAndAssociation(String assocTypeUri, long topicId, long assocId, String topicRoleTypeUri, String assocRoleTypeUri)
fetchAssociationsBetweenTopicAndAssociation
in interface DMXStorage
public Iterator<AssociationModel> fetchAllAssociations()
fetchAllAssociations
in interface DMXStorage
public long[] fetchPlayerIds(long assocId)
fetchPlayerIds
in interface DMXStorage
public void storeAssociation(AssociationModel assocModel)
storeAssociation
in interface DMXStorage
public void storeAssociationUri(long assocId, String uri)
storeAssociationUri
in interface DMXStorage
public void storeAssociationTypeUri(long assocId, String assocTypeUri)
storeAssociationTypeUri
in interface DMXStorage
public void storeAssociationValue(long assocId, SimpleValue value, List<IndexMode> indexModes, String indexKey, SimpleValue indexValue)
DMXStorage
storeAssociationValue
in interface DMXStorage
indexValue
- Optional: the value to be indexed. If indexValue is not specified, value is used.public void indexAssociationValue(long assocId, IndexMode indexMode, String indexKey, SimpleValue indexValue)
indexAssociationValue
in interface DMXStorage
public void storeRoleTypeUri(long assocId, long playerId, String roleTypeUri)
storeRoleTypeUri
in interface DMXStorage
public void deleteAssociation(long assocId)
deleteAssociation
in interface DMXStorage
public DMXObjectModel fetchObject(long id)
fetchObject
in interface DMXStorage
public List<AssociationModel> fetchTopicAssociations(long topicId)
fetchTopicAssociations
in interface DMXStorage
public List<AssociationModel> fetchAssociationAssociations(long assocId)
fetchAssociationAssociations
in interface DMXStorage
public List<RelatedTopicModel> 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<RelatedAssociationModel> fetchTopicRelatedAssociations(long topicId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
fetchTopicRelatedAssociations
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullpublic List<RelatedTopicModel> fetchAssociationRelatedTopics(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersTopicTypeUri)
fetchAssociationRelatedTopics
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullothersTopicTypeUri
- may be nullpublic List<RelatedAssociationModel> fetchAssociationRelatedAssociations(long assocId, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
fetchAssociationRelatedAssociations
in interface DMXStorage
assocTypeUri
- may be nullmyRoleTypeUri
- may be nullothersRoleTypeUri
- may be nullpublic List<RelatedTopicModel> 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<RelatedAssociationModel> fetchRelatedAssociations(long id, String assocTypeUri, String myRoleTypeUri, String othersRoleTypeUri, String othersAssocTypeUri)
fetchRelatedAssociations
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<TopicModel> fetchTopicsByProperty(String propUri, Object propValue)
fetchTopicsByProperty
in interface DMXStorage
public List<TopicModel> fetchTopicsByPropertyRange(String propUri, Number from, Number to)
fetchTopicsByPropertyRange
in interface DMXStorage
public List<AssociationModel> fetchAssociationsByProperty(String propUri, Object propValue)
fetchAssociationsByProperty
in interface DMXStorage
public List<AssociationModel> fetchAssociationsByPropertyRange(String propUri, Number from, Number to)
fetchAssociationsByPropertyRange
in interface DMXStorage
public void storeTopicProperty(long topicId, String propUri, Object propValue, boolean addToIndex)
storeTopicProperty
in interface DMXStorage
public void storeAssociationProperty(long assocId, String propUri, Object propValue, boolean addToIndex)
storeAssociationProperty
in interface DMXStorage
public void indexTopicProperty(long topicId, String propUri, Object propValue)
indexTopicProperty
in interface DMXStorage
public void indexAssociationProperty(long assocId, String propUri, Object propValue)
indexAssociationProperty
in interface DMXStorage
public void deleteTopicProperty(long topicId, String propUri)
deleteTopicProperty
in interface DMXStorage
public void deleteAssociationProperty(long assocId, String propUri)
deleteAssociationProperty
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 ModelFactory getModelFactory()
getModelFactory
in interface DMXStorage
private void storeAndIndexTopicUri(org.neo4j.graphdb.Node topicNode, String uri)
private void storeAndIndexAssociationUri(org.neo4j.graphdb.Node assocNode, String uri)
private void storeAndIndexTopicTypeUri(org.neo4j.graphdb.Node topicNode, String topicTypeUri)
private void storeAndIndexAssociationTypeUri(org.neo4j.graphdb.Node assocNode, String assocTypeUri)
private void storeAndIndexExactValue(org.neo4j.graphdb.Node node, String key, Object value, org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> exactIndex)
IndexMode.KEY
is used for indexing.
Used for URIs, type URIs, and properties.
node
- a topic node, or an association node.exactIndex
- the index to add the value to. If null
no indexing is performed.private void indexExactValue(org.neo4j.graphdb.Node node, String key, Object value, org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> exactIndex)
private void indexTopicNodeValue(org.neo4j.graphdb.Node topicNode, List<IndexMode> indexModes, String indexKey, Object indexValue)
private void indexAssociationNodeValue(org.neo4j.graphdb.Node assocNode, List<IndexMode> indexModes, String indexKey, Object indexValue)
private Object getIndexValue(SimpleValue value, SimpleValue indexValue)
private void indexNodeValue(org.neo4j.graphdb.Node node, Object value, List<IndexMode> indexModes, String indexKey, org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> exactIndex, org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> fulltextIndex)
private void indexAssociation(org.neo4j.graphdb.Node assocNode, String roleTypeUri1, org.neo4j.graphdb.Node playerNode1, String roleTypeUri2, org.neo4j.graphdb.Node playerNode2)
private void indexAssociationId(org.neo4j.graphdb.Node assocNode)
private void indexAssociationType(org.neo4j.graphdb.Node assocNode, String assocTypeUri)
private void indexAssociationRole(org.neo4j.graphdb.Node assocNode, int pos, String roleTypeUri, org.neo4j.graphdb.Node playerNode)
private void indexAssociationRoleType(org.neo4j.graphdb.Node assocNode, long playerId, String roleTypeUri)
private int lookupPlayerPosition(long assocId, long playerId)
private boolean isPlayerAtPosition(int pos, long assocId, long playerId)
private void reindexTypeUri(org.neo4j.graphdb.Node playerNode, String typeUri)
private void reindexTypeUri(int pos, org.neo4j.graphdb.Node playerNode, String typeUri)
playerNode
- a topic node or an association node.typeUri
- the new type URI to be indexed for the player node.private org.neo4j.graphdb.index.IndexHits<org.neo4j.graphdb.Node> lookupAssociations(int pos, org.neo4j.graphdb.Node playerNode)
private void reindexValue(org.neo4j.graphdb.Node assocNode, String key, int pos, String value)
private void reindexValue(org.neo4j.graphdb.Node assocNode, String key, String value)
private org.neo4j.graphdb.index.IndexHits<org.neo4j.graphdb.Node> queryIndexByProperty(org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> index, String propUri, Object propValue)
private org.neo4j.graphdb.index.IndexHits<org.neo4j.graphdb.Node> queryIndexByPropertyRange(org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> index, String propUri, Number from, Number to)
private List<AssociationModel> queryAssociationIndex(String assocTypeUri, String roleTypeUri1, NodeType playerType1, long playerId1, String playerTypeUri1, String roleTypeUri2, NodeType playerType2, long playerId2, String playerTypeUri2)
private org.neo4j.index.lucene.QueryContext buildNumericRangeQuery(String propUri, Number from, Number to)
private org.apache.lucene.search.Query buildAssociationQuery(String assocTypeUri, String roleTypeUri1, NodeType playerType1, long playerId1, String playerTypeUri1, String roleTypeUri2, NodeType playerType2, long playerId2, String playerTypeUri2)
private void addRole(org.apache.lucene.search.BooleanQuery query, int pos, String roleTypeUri, NodeType playerType, long playerId, String playerTypeUri)
private void addTermQuery(String key, long value, org.apache.lucene.search.BooleanQuery query)
private void addTermQuery(String key, NodeType nodeType, org.apache.lucene.search.BooleanQuery query)
private void addTermQuery(String key, String value, org.apache.lucene.search.BooleanQuery query)
private void removeTopicFromIndex(org.neo4j.graphdb.Node topicNode)
private void removeAssociationFromIndex(org.neo4j.graphdb.Node assocNode)
private void removeTopicPropertyFromIndex(org.neo4j.graphdb.Node topicNode, String propUri)
private void removeAssociationPropertyFromIndex(org.neo4j.graphdb.Node assocNode, String propUri)
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> createExactIndex(String name)
private org.neo4j.graphdb.index.Index<org.neo4j.graphdb.Node> createFulltextIndex(String name)
TopicModel buildTopic(org.neo4j.graphdb.Node topicNode)
private List<TopicModel> buildTopics(Iterable<org.neo4j.graphdb.Node> topicNodes)
AssociationModel buildAssociation(org.neo4j.graphdb.Node assocNode)
private List<AssociationModel> buildAssociations(Iterable<org.neo4j.graphdb.Node> assocNodes)
private List<RoleModel> buildRoleModels(org.neo4j.graphdb.Node assocNode)
private org.neo4j.graphdb.Node storePlayerRelationship(org.neo4j.graphdb.Node assocNode, RoleModel roleModel)
private org.neo4j.graphdb.Node fetchPlayerNode(RoleModel roleModel)
private org.neo4j.graphdb.Node fetchTopicPlayerNode(TopicRoleModel roleModel)
private org.neo4j.graphdb.Relationship fetchRelationship(org.neo4j.graphdb.Node assocNode, long playerId)
private List<org.neo4j.graphdb.Relationship> fetchRelationships(org.neo4j.graphdb.Node assocNode)
private long playerId(org.neo4j.graphdb.Relationship rel)
private List<AssociationModel> fetchAssociations(org.neo4j.graphdb.Node node)
node
- a topic node or an association node.private org.neo4j.graphdb.Node fetchTopicNode(long topicId)
private org.neo4j.graphdb.Node fetchAssociationNode(long assocId)
private org.neo4j.graphdb.Node fetchNode(long id)
private org.neo4j.graphdb.Node fetchTopicNodeByUri(String uri)
private org.neo4j.graphdb.Node checkNodeType(org.neo4j.graphdb.Node node, NodeType type)
private org.neo4j.graphdb.RelationshipType getRelationshipType(String typeName)
private SimpleValue simpleValue(org.neo4j.graphdb.Node node)
private List<RelatedTopicModel> buildRelatedTopics(List<AssociationModel> assocs, long playerId)
private List<RelatedAssociationModel> buildRelatedAssociations(List<AssociationModel> assocs, long playerId)
private void setDefaults(DMXObjectModel model)
private void checkUriUniqueness(String uri)
uri
- The URI to check. Must not be null.Copyright © 2018. All Rights Reserved.