Examples of GraphManager


Examples of org.archive.access.nutch.jobs.graph.GraphManager

   * @throws IOException
   */
  public int buildGraph(Path inputSegments[], Path outputPath) throws IOException {       
 
    final SequenceFile.Writer writer=SequenceFile.createWriter(fs, conf, new Path(outputPath,GRAPH_FILE), ArquivoWebKeyValueWritable.class, NullWritable.class, SequenceFile.CompressionType.BLOCK, new DefaultCodec());   
    final GraphManager graph = new GraphManager()
   
    readLinks(inputSegments, new ReadLinksProcessor() {     
      public void run(String fromUrl, String toUrl) throws IOException {               
        writer.append(new ArquivoWebKeyValueWritable(graph.getId(fromUrl),graph.getId(toUrl)),NullWritable.get());       
      }
    });

    writer.close();
    return graph.numNodes();   
  }
View Full Code Here

Examples of org.archive.access.nutch.jobs.graph.GraphManager

   * Write file with pagerank scores  
   */
  public void writeFileScores(Path inputSegments[], Path outputFile, final double scores[]) throws IOException {
   
    final SequenceFile.Writer writer=SequenceFile.createWriter(fs, conf, outputFile, Text.class, FloatWritable.class, SequenceFile.CompressionType.BLOCK, new DefaultCodec());
    final GraphManager graph = new GraphManager();

    readLinks(inputSegments, new ReadLinksProcessor() {     
      public void run(String fromUrl, String toUrl) throws IOException // read urls in the same order when it created the web graph, to write scores
       
        int id;
        if (!graph.hasId(fromUrl)) {
          id=graph.getId(fromUrl);
          writer.append(new Text(fromUrl), new FloatWritable( (float)scores[id] ));               
        }
        if (!graph.hasId(toUrl)) {
          id=graph.getId(toUrl);
          writer.append(new Text(toUrl), new FloatWritable( (float)scores[id] ));               
        }
      } 
    });
     
View Full Code Here

Examples of org.archive.access.nutch.jobs.graph.GraphManager

   */
  public void writeFileScores2debug(Path inputSegments[], Path outputFile, final double scores[]) throws IOException {
   
    FSDataOutputStream out = fs.create(outputFile);
    final PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out)));    
    final GraphManager graph = new GraphManager();
   
    readLinks(inputSegments, new ReadLinksProcessor() {   
      public void run(String fromUrl, String toUrl) throws IOException // read urls in the same order when it created the web graph, to write scores
       
        int id;
        if (!graph.hasId(fromUrl)) {
          id=graph.getId(fromUrl);
          writer.println(fromUrl+" "+scores[id]);               
        }
        if (!graph.hasId(toUrl)) {
          id=graph.getId(toUrl);
          writer.println(toUrl+" "+scores[id]);               
        }
      }
    });
     
View Full Code Here

Examples of org.enhydra.jawe.components.graph.GraphManager

                if (runningActivityIds != null && runningActivityIds.length > 0) {
                    graph.clearSelection();
                    try {
                        for (int i = 0; i < runningActivityIds.length; i++) {
                            try {
                                GraphManager wm = graph.getGraphManager();
                                Object go = wm.getGraphActivity(runningActivityIds[i]);
                                if (go != null) {
                                    graph.addSelectionCell(go);
                                }
                            } catch (Exception ex) {
                                LogFactory.getLog(Viewer.class.getName()).error(ex);
View Full Code Here

Examples of org.neo4j.nlp.helpers.GraphManager

                "LIMIT 10";
    }

    @Test
    public void testGetTemplate() throws Exception {
        @NotNull
        GraphManager graphManager = new GraphManager("pattern");
        System.out.println(graphManager.GetTemplate(GraphManager.ROOT_TEMPLATE.replace("\\s", "\\sis\\sknown\\s")));
    }
View Full Code Here

Examples of org.neo4j.nlp.helpers.GraphManager

        return new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase();
    }

    @Test
    public void testGeneratePattern() throws Exception {
        GraphManager graphManager = new GraphManager("Pattern");
        String result = graphManager.GeneratePattern(new PatternCount("word", 2, null));

        Assert.assertEquals(GraphManager.ROOT_TEMPLATE.replace("\\s", "\\sword\\s"), result);
    }
View Full Code Here

Examples of org.neo4j.nlp.helpers.GraphManager

        DataRelationshipManager.relationshipCache.invalidateAll();
        ClassRelationshipCache.relationshipCache.invalidateAll();
        PatternRelationshipCache.relationshipCache.invalidateAll();

        GraphDatabaseService db = setUpDb();
        GraphManager graphManager = new GraphManager("Pattern");
        Node rootNode = getRootPatternNode(db, graphManager);

        Map<String, String> text = new HashMap<>();
        text.put("The first word in a sentence is interesting", "sentence");
        text.put("The second word in a sentence is interesting", "sentence");
View Full Code Here

Examples of org.neo4j.nlp.helpers.GraphManager

        DataRelationshipManager.relationshipCache.invalidateAll();
        ClassRelationshipCache.relationshipCache.invalidateAll();
        PatternRelationshipCache.relationshipCache.invalidateAll();

        GraphDatabaseService db = setUpDb();
        GraphManager graphManager = new GraphManager("Pattern");
        Node rootNode = getRootPatternNode(db, graphManager);

        Map<String, String> text = new HashMap<>();
        text.put("The first word in a sentence is interesting", "sentence");
        text.put("The second word in a sentence is interesting", "sentence");
View Full Code Here

Examples of org.neo4j.nlp.helpers.GraphManager


    @Test
    public void sentimentAnalysisTest() throws IOException {
        GraphDatabaseService db = setUpDb();
        GraphManager graphManager = new GraphManager("Pattern");

        // Invalidate all caches
        NodeManager.globalNodeCache.invalidateAll();
        DataNodeManager.dataCache.invalidateAll();
        ClassNodeManager.classCache.invalidateAll();
View Full Code Here

Examples of org.netbeans.modules.schema2beans.GraphManager

     * @param type The expected type of the value to be returned.
     * @throws IllegalArgumentException If the bean is not part of a complete bean graph.
     */   
    protected static java.util.List findCompatibleBeansWithValue(BaseBean root, String propName, String propVal, Class type) throws IllegalArgumentException {
        java.util.List retVal = null;
        GraphManager gm = root.graphManager();
        if (null == gm)
            throw new IllegalArgumentException("Disconnected beans not supported");
        String[] props = root.findPropertyValue(propName, propVal);
        int len = 0;
        if (null != props)
            len = props.length;
        if (len > 0)
            retVal = new java.util.ArrayList();
        for (int i = 0; i < len; i++) {
            // get the bean that is the property's parent.
            BaseBean candidate = gm.getPropertyParent(props[i]);
            if (type.isInstance(candidate))
                retVal.add(candidate);
        }
        return retVal;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.