当前位置: 首页>>代码示例>>Java>>正文


Java MapUtil.map方法代码示例

本文整理汇总了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);
  }
 
开发者ID:cotrino,项目名称:language_KnowledgeMap,代码行数:8,代码来源:NodeCreator.java

示例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();
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:35,代码来源:ImdbDocTest.java

示例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);
}
 
开发者ID:neo4art,项目名称:neo4art,代码行数:11,代码来源:NLPBatchInserterRepository.java

示例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;
}
 
开发者ID:socialsensor,项目名称:graphdb-benchmarks,代码行数:13,代码来源:Neo4jMassiveInsertion.java

示例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);
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-ml-procedures,代码行数:4,代码来源:DL4JMLModel.java

示例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();
}
 
开发者ID:cotrino,项目名称:language_KnowledgeMap,代码行数:7,代码来源:NodeCreator.java

示例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);
}
 
开发者ID:neo4art,项目名称:neo4art,代码行数:13,代码来源:WikipediaSearchGraphDatabaseServiceRepository.java

示例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);
}
 
开发者ID:neo4art,项目名称:neo4art,代码行数:13,代码来源:WikipediaSearchGraphDatabaseServiceRepository.java


注:本文中的org.neo4j.helpers.collection.MapUtil.map方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。