Package edu.isi.karma.rep.alignment

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


      } else {
        nodeId = nodeUri + "1 (add)";
      }


      InternalNode node = new InternalNode(nodeId, nodeLabel);
      nodeSet.add(node);


      // Populate the graph nodes also
      if (alignment != null) {
View Full Code Here


      Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(uri);
      int graphNodeCount = matchedNodes == null ? 0 : matchedNodes.size();
     
      for (int i = 0; i < modelNodeCount - graphNodeCount; i++) {
        String id = this.nodeIdFactory.getNodeId(uri);
        Node n = new InternalNode(id, new Label(uri));
        if (this.graphBuilder.addNode(n))
          addedNodes.add((InternalNode)n);
      }
    }
   
    for (Node n : model.getGraph().vertexSet()) {
      if (n instanceof InternalNode) {
        Set<Node> matchedNodes = this.graphBuilder.getUriToNodesMap().get(n.getUri());
        internalNodeMatches.put(n, matchedNodes);
      }
    }

    return internalNodeMatches;
View Full Code Here

      return null;
    }

    logger.debug("semantic type: " + domainUri + "|" + propertyUri + "|" + confidence + "|" + origin);

    InternalNode source = null;
    String nodeId;

    Set<Node> nodesWithSameUri = this.graphBuilder.getUriToNodesMap().get(domainUri);
    if (nodesWithSameUri != null && !nodesWithSameUri.isEmpty()) {
      InternalNode copyFrom = (InternalNode)nodesWithSameUri.iterator().next();
      source = this.graphBuilder.copyNode(copyFrom, false);
      if (source == null) return null;
    } else {
      nodeId = nodeIdFactory.getNodeId(domainUri);
      source = new InternalNode(nodeId, new Label(domainUri));
      if (!this.graphBuilder.addNodeAndUpdate(source, addedNodes)) return null;
    }

    nodeId = new RandomGUID().toString();
    ColumnNode target = new ColumnNode(nodeId, nodeId, sourceColumn.getColumnName(), null);
View Full Code Here

      if (n1 == null) {

        if (source instanceof InternalNode) {
          String id = this.nodeIdFactory.getNodeId(source.getLabel().getUri());
          InternalNode node = new InternalNode(id, new Label(source.getLabel()));
          if (this.graphBuilder.addNode(node)) {
            n1 = node;
          } else continue;
        }
        else {
          String id = new RandomGUID().toString();
          ColumnNode node = new ColumnNode(id, id, ((ColumnNode)target).getColumnName(), null);
          if (this.graphBuilder.addNode(node)) {
            n1 = node;
          } else continue;
        }

        visitedNodes.put(source, n1);
      }

      if (n2 == null) {

        if (target instanceof InternalNode) {
          String id = nodeIdFactory.getNodeId(target.getLabel().getUri());
          InternalNode node = new InternalNode(id, new Label(target.getLabel()));
          if (this.graphBuilder.addNode(node)) {
            n2 = node;
          } else continue;
        }
        else if(target instanceof LiteralNode) {
View Full Code Here

   
    return result;
  }
 
  public InternalNode copyNodeAndUpdate(Node node, boolean copyLinksToColumnNodes) {
    InternalNode copyNode = null;
    if (node instanceof InternalNode) {
      copyNode = this.copyNode((InternalNode)node, copyLinksToColumnNodes);
    } else {
      logger.error("only can copy an internal node");
      return null;
View Full Code Here

      logger.error("input node is null");
      return null;
    }
   
    String id = this.nodeIdFactory.getNodeId(node.getUri());
    InternalNode newNode = new InternalNode(id, node.getLabel());
   
    if (!this.addNode(newNode)) {
      logger.error("could not add the new node " + newNode.getId());
      return null;
    }
   
    Node source , target;
    String newId;
View Full Code Here

   
    // Add Thing to the Graph
    if (ModelingConfiguration.getThingNode()) {
      String id = nodeIdFactory.getNodeId(Uris.THING_URI);
      Label label = new Label(Uris.THING_URI, Namespaces.OWL, Prefixes.OWL);
      Node thing = new InternalNode(id, label);
      addNode(thing);
    }
   
    logger.debug("exit>");
  }
View Full Code Here

    Set<String> uriClosure = computeUriClosure(uri);

    for (String c : uriClosure) {
      Set<Node> nodesOfSameUri = this.uriToNodesMap.get(c);
      if (nodesOfSameUri == null || nodesOfSameUri.size() == 0) { // the internal node is not added to the graph before
        Node nn = new InternalNode(nodeIdFactory.getNodeId(c),
            ontologyManager.getUriLabel(c));
        if (addNode(nn)) newAddedNodes.add(nn);
      }
    }
   
View Full Code Here

        System.out.println(s);
      }
      Alignment al = new Alignment(mgr);
      ColumnNode c1 = al.addColumnNode("h1", "c1", null);
      ColumnNode c2 = al.addColumnNode("h2", "c2", null);
      InternalNode n1 = al.addInternalNode(new Label("http://example.com/layout/C01_"));
      InternalNode n2 = al.addInternalNode(new Label("http://example.com/layout/C02_"));
      al.addDataPropertyLink(n1, c1, new Label("http://example.com/layout/d1"));
      al.addDataPropertyLink(n2, c2, new Label("http://example.com/layout/d2"));
      al.align();
      System.out.println(GraphUtil.labeledGraphToString(al.getSteinerTree()));
    } else {
View Full Code Here

        linkFrequency = t.getLinkFrequency();

        nodes = this.graphBuilder.getUriToNodesMap().get(subjectUri);
        if (nodes == null || nodes.isEmpty()) {
          id = this.nodeIdFactory.getNodeId(subjectUri);
          node = new InternalNode(id, new Label(subjectUri));
          if (this.graphBuilder.addNode(node)) {
            addedNodes.add((InternalNode)node);
            n1 = node;
          } else {
            continue;
          }
        } else {
          n1 = nodes.iterator().next();
        }

        nodes = this.graphBuilder.getUriToNodesMap().get(objectUri);
        if (nodes == null || nodes.isEmpty()) {
          id = this.nodeIdFactory.getNodeId(objectUri);
          node = new InternalNode(id, new Label(objectUri));
          if (this.graphBuilder.addNode(node)) {
            addedNodes.add((InternalNode)node);
            n2 = node;
          } else {
            continue;
View Full Code Here

TOP

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

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.