本文整理汇总了Java中org.neo4j.helpers.collection.MapUtil.map方法的典型用法代码示例。如果您正苦于以下问题:Java MapUtil.map方法的具体用法?Java MapUtil.map怎么用?Java MapUtil.map使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.helpers.collection.MapUtil
的用法示例。
在下文中一共展示了MapUtil.map方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCategory
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private void createCategory(String title) {
Map<String, Object> properties = MapUtil.map("title", title);
long nodeId = inserter.createNode(properties, WikiCategory.Category);
inMemoryIndex.put("c_"+title, nodeId);
pageCounter.increment();
//System.out.println("Adding category "+title);
}
示例2: batchInsert
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
@Test
public void batchInsert() throws Exception
{
Neo4jTestCase.deleteFileOrDirectory( new File(
"target/neo4jdb-batchinsert" ) );
// START SNIPPET: batchInsert
BatchInserter inserter = BatchInserters.inserter( "target/neo4jdb-batchinsert" );
BatchInserterIndexProvider indexProvider =
new LuceneBatchInserterIndexProvider( inserter );
BatchInserterIndex actors =
indexProvider.nodeIndex( "actors", MapUtil.stringMap( "type", "exact" ) );
actors.setCacheCapacity( "name", 100000 );
Map<String, Object> properties = MapUtil.map( "name", "Keanu Reeves" );
long node = inserter.createNode( properties );
actors.add( node, properties );
//make the changes visible for reading, use this sparsely, requires IO!
actors.flush();
// Make sure to shut down the index provider as well
indexProvider.shutdown();
inserter.shutdown();
// END SNIPPET: batchInsert
GraphDatabaseService db = new TestGraphDatabaseFactory().newEmbeddedDatabase( "target/neo4jdb-batchinsert" );
try ( Transaction tx = db.beginTx() )
{
Index<Node> index = db.index().forNodes( "actors" );
Node reeves = index.get( "name", "Keanu Reeves" ).next();
assertEquals( node, reeves.getId() );
}
db.shutdown();
}
示例3: addRelationshipBetweenOriginalDocumentAndNLPLinkedList
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
/**
* @see org.neo4art.sentiment.repository.NLPRepository#addRelationshipBetweenOriginalDocumentAndNLPLinkedList(long, long, int)
*/
@Override
public long addRelationshipBetweenOriginalDocumentAndNLPLinkedList(long documentNodeId, long nlpLinkedListStartingNodeId, int nlpSentenceLength)
{
Map<String, Object> properties = MapUtil.map("nlpSentenceLength", nlpSentenceLength);
return Neo4ArtBatchInserterSingleton.createRelationship(documentNodeId, nlpLinkedListStartingNodeId, NLPRelationship.TOKENIZED_IN_POS, properties);
}
示例4: getOrCreate
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
@Override
protected Long getOrCreate(String value)
{
Long id = cache.get(Long.valueOf(value));
if (id == null)
{
Map<String, Object> properties = MapUtil.map("nodeId", value);
id = inserter.createNode(properties, Neo4jGraphDatabase.NODE_LABEL);
cache.put(Long.valueOf(value), id);
}
return id;
}
示例5: node
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private Node node(String label, Object...keyValues) {
return new VirtualNode(new Label[] {Label.label(label)}, MapUtil.map(keyValues),null);
}
示例6: createNode
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private void createNode(String title) {
Map<String, Object> properties = MapUtil.map("title", title);
long nodeId = inserter.createNode(properties, WikiLabel.Page);
inMemoryIndex.put(title, nodeId);
pageCounter.increment();
}
示例7: findDepthOneConnectionsByPageTitle
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
/**
* @see org.neo4art.api.search.repository.WikipediaSearchRepository#findDepthOneConnectionsByPageTitle(java.lang.String, boolean)
*/
@Override
public WikipediaSearchResult findDepthOneConnectionsByPageTitle(String wikipediaPageTitle, boolean autoComplete) {
String cql = "MATCH (n:" + WikipediaLabel.Wikipedia + ")-[r:" + WikipediaRelationship.REFERS + "]-(m:" + WikipediaLabel.Wikipedia + ") WHERE n.title = {title} RETURN n, r, m";
Map<String, Object> parameters = MapUtil.map("title", wikipediaPageTitle);
return executeQuery(cql, parameters, autoComplete);
}
示例8: findDepthOneConnectionsByNodeId
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
/**
* @see org.neo4art.api.search.repository.WikipediaSearchRepository#findDepthOneConnectionsByNodeId(long, boolean)
*/
@Override
public WikipediaSearchResult findDepthOneConnectionsByNodeId(long nodeId, boolean autoComplete) {
String cql = "MATCH (n:" + WikipediaLabel.Wikipedia + ")-[r:" + WikipediaRelationship.REFERS + "]-(m:" + WikipediaLabel.Wikipedia + ") WHERE id(n) = {nodeId} RETURN n, r, m";
Map<String, Object> parameters = MapUtil.map("nodeId", nodeId);
return executeQuery(cql, parameters, autoComplete);
}