Package edu.isi.karma.rep.alignment

Examples of edu.isi.karma.rep.alignment.DefaultLink


      for (DefaultLink l : incomingLinks) {
        source = l.getSource();
        if (source instanceof ColumnNode) continue;
        target = newNode;
        newId = LinkIdFactory.getLinkId(l.getUri(), source.getId(), target.getId());
        DefaultLink copyLink = l.getCopy(newId);
        this.addLink(source, target, copyLink, l.getWeight());
      }
    }
   
    Set<DefaultLink> outgoingLinks = this.getGraph().outgoingEdgesOf(node);
    if (outgoingLinks != null) {
      for (DefaultLink l : outgoingLinks) {
        source = newNode;
        target = l.getTarget();
        if (!copyLinksToColumnNodes && target instanceof ColumnNode) continue; // skip links to column nodes
        newId = LinkIdFactory.getLinkId(l.getUri(), source.getId(), target.getId());
        DefaultLink copyLink = l.getCopy(newId);
        this.addLink(source, target, copyLink, l.getWeight());
      }
    }
   
    return newNode;
View Full Code Here


    }
     
    if (source instanceof InternalNode && target instanceof ColumnNode) {
     
      // remove other incoming links to this column node
      DefaultLink oldIncomingLink = null;
      Set<DefaultLink> incomingLinks = this.getGraph().incomingEdgesOf(target);
      if (incomingLinks != null && incomingLinks.size() == 1) {
        oldIncomingLink = incomingLinks.iterator().next();
      }
      if (oldIncomingLink != null)
View Full Code Here

          continue;
       
        if (g.containsEdge(n1, n2))
          continue;
       
        DefaultLink e = new DefaultLink();
        g.addEdge(n1, n2, e);
        g.setEdgeWeight(e, path.getCost(n2));
       
      }
View Full Code Here

   
    Node source, target;
    for (int i = 0; i < nonSteinerLeaves.size(); i++) {
      source = nonSteinerLeaves.get(i);
      do {
        DefaultLink e = g5.edgesOf(source).toArray(new DefaultLink[0])[0];
        target = this.graph.getEdgeTarget(e);
       
        // this should not happen, but just in case of ...
        if (target.equals(source))
          target = e.getSource();
       
        g5.removeVertex(source);
        source = target;
      } while(g5.degreeOf(source) == 1 && steinerNodes.indexOf(source) == -1);
     
View Full Code Here

   
    DirectedWeightedMultigraph<Node, DefaultLink> graph =
        new DirectedWeightedMultigraph<Node, DefaultLink>(LabeledLink.class);
   
    Node n, source, target;
    DefaultLink l;
    Double[] weight = new Double[1];
    HashMap<String, Node> idToNodes = new HashMap<String, Node>();
   
    reader.beginObject();
      while (reader.hasNext()) {
        String key = reader.nextName();
      if (key.equals("nodes") && reader.peek() != JsonToken.NULL) {
        reader.beginArray();
          while (reader.hasNext()) {
            n = readNode(reader);
            if (n != null) {
              idToNodes.put(n.getId(), n);
              graph.addVertex(n);
            }
          }
          reader.endArray();
      } else if (key.equals("links") && reader.peek() != JsonToken.NULL) {
        reader.beginArray();
          while (reader.hasNext()) {
            l = readLink(reader, weight);
            if (l != null) {
              source = idToNodes.get(LinkIdFactory.getLinkSourceId(l.getId()));
              target = idToNodes.get(LinkIdFactory.getLinkTargetId(l.getId()));
              if (source  != null && target != null) {
                graph.addEdge(source, target, l);
                if (weight[0] != null) graph.setEdgeWeight(l, weight[0].doubleValue());
              }
            }
View Full Code Here

        reader.skipValue();
      }
    }
      reader.endObject();
     
      DefaultLink l = null;
      if (type == LinkType.ClassInstanceLink) {
        l = new ClassInstanceLink(id, keyInfo);
      } else if (type == LinkType.ColumnSubClassLink) {
        l = new ColumnSubClassLink(id);
      } else if (type == LinkType.DataPropertyLink) {
View Full Code Here

    WeightedMultigraph<Node, DefaultLink> tree =
        new WeightedMultigraph<Node, DefaultLink>(DefaultLink.class);
   
    HashSet<Node> visitedNodes = new HashSet<Node>();
    Node source, target;
    DefaultLink l;
    double weight;
    for (Fact f : initialTree.getFacts()) {
      source = this.getIdToNodeMap().get(f.source().name());
      target = this.getIdToNodeMap().get(f.destination().name());
     
View Full Code Here

TOP

Related Classes of edu.isi.karma.rep.alignment.DefaultLink

Copyright © 2018 www.massapicom. 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.