Examples of LabeledLink


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

    ColumnNode target = new ColumnNode(nodeId, nodeId, sourceColumn.getColumnName(), null);
    if (!this.graphBuilder.addNode(target)) return null;
    addedNodes.add(target);

    String linkId = LinkIdFactory.getLinkId(propertyUri, source.getId(), target.getId())
    LabeledLink link;
    if (propertyUri.equalsIgnoreCase(ClassInstanceLink.getFixedLabel().getUri()))
      link = new ClassInstanceLink(linkId);
    else {
      Label label = this.ontologyManager.getUriLabel(propertyUri);
      link = new DataPropertyLink(linkId, label);
View Full Code Here

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

        targetNode = alignment.addInternalNode(new Label(targetUri));
      }

      Label linkLabel = ontMgr.getUriLabel(edgeUri);

      LabeledLink newLink = alignment.addObjectPropertyLink(sourceNode,
          targetNode, linkLabel);
      alignment.changeLinkStatus(newLink.getId(),
          LinkStatus.ForcedByUser);


      // Add info to description string
      if (j == newEdges.length() - 1) {
        descStr.append(newLink.getLabel().getDisplayName());
      } else {
        descStr.append(newLink.getLabel().getDisplayName() + ",");
      }
    }
  }
View Full Code Here

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

        }

        visitedNodes.put(target, n2);
      }

      LabeledLink link;
      String id = LinkIdFactory.getLinkId(e.getLabel().getUri(), n1.getId(), n2.getId())
      if (e instanceof DataPropertyLink)
        link = new DataPropertyLink(id, e.getLabel());
      else if (e instanceof ObjectPropertyLink)
        link = new ObjectPropertyLink(id, e.getLabel(), ((ObjectPropertyLink)e).getObjectPropertyType());
      else if (e instanceof SubClassLink)
        link = new SubClassLink(id);
      else if (e instanceof ClassInstanceLink)
        link = new ClassInstanceLink(id, e.getKeyType());
      else if (e instanceof ColumnSubClassLink)
        link = new ColumnSubClassLink(id);
      else if (e instanceof DataPropertyOfColumnLink)
        link = new DataPropertyOfColumnLink(id,
            ((DataPropertyOfColumnLink)e).getSpecializedColumnHNodeId(),
            ((DataPropertyOfColumnLink)e).getSpecializedLinkId()
            );
      else if (e instanceof ObjectPropertySpecializationLink)
        link = new ObjectPropertySpecializationLink(id, ((ObjectPropertySpecializationLink)e).getSpecializedLinkId());
      else {
        logger.error("cannot instanciate a link from the type: " + e.getType().toString());
        continue;
      }


      link.getModelIds().add(modelId);

      if (this.graphBuilder.addLink(n1, n2, link)) {
        this.graphBuilder.changeLinkWeight(link, ModelingParams.PATTERN_LINK_WEIGHT);
      }
View Full Code Here

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

    String objectUri = "";
    int linkFrequency;
    String id;
    Set<Node> nodes;
    Node node, n1, n2;
    LabeledLink link;

    int countOfObjectProperties = 0;

    if (objectPropertiesTriples != null) {
      for (Triple t : objectPropertiesTriples) {
View Full Code Here

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

    String predicateUri = "";
    int linkFrequency;
    String id;
    Set<Node> nodes;
    Node node, n1, n2;
    LabeledLink link;

    int countOfDataProperties = 0;

    if (dataPropertiesTriples != null) {
      for (Triple t : dataPropertiesTriples) {
View Full Code Here

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

      logger.debug("exit>");   
      return true;
    }
     
    // update the corresponding lists and hashmaps
    LabeledLink labeledLink = null;
//    if (link instanceof LabeledLink)
    labeledLink = (LabeledLink)link;
   
    this.idToLinkMap.put(labeledLink.getId(), labeledLink);
   
    Set<LabeledLink> linksWithSameUri = uriToLinksMap.get(labeledLink.getUri());
    if (linksWithSameUri == null) {
      linksWithSameUri = new HashSet<LabeledLink>();
      uriToLinksMap.put(labeledLink.getUri(), linksWithSameUri);
    }
    linksWithSameUri.add(labeledLink);
       
    Set<LabeledLink> linksWithSameType = typeToLinksMap.get(labeledLink.getType());
    if (linksWithSameType == null) {
      linksWithSameType = new HashSet<LabeledLink>();
      typeToLinksMap.put(labeledLink.getType(), linksWithSameType);
    }
    linksWithSameType.add(labeledLink);
   
    if (labeledLink.getStatus() != LinkStatus.Normal) {
      Set<LabeledLink> linksWithSameStatus = statusToLinksMap.get(labeledLink.getStatus());
      if (linksWithSameStatus == null) {
        linksWithSameStatus = new HashSet<LabeledLink>();
        statusToLinksMap.put(labeledLink.getStatus(), linksWithSameStatus);
      }
    }

    if (source instanceof InternalNode && target instanceof ColumnNode) {

      ((ColumnNode)target).setDomainNode((InternalNode)source);
      ((ColumnNode)target).setDomainLink(labeledLink);
     
      String key = source.getId() + link.getUri();
      Integer count = this.nodeDataPropertyCount.get(key);
      if (count == null) this.nodeDataPropertyCount.put(key, 1);
      else this.nodeDataPropertyCount.put(key, count.intValue() + 1);
     
      Set<Node> dataPropertyColumnNodes = this.nodeDataProperties.get(key);
      if (dataPropertyColumnNodes == null) {
        dataPropertyColumnNodes = new HashSet<Node>();
        this.nodeDataProperties.put(key, dataPropertyColumnNodes);
      }
      dataPropertyColumnNodes.add(target);
     
      key = source.getUri() + link.getUri();
      Set<SemanticTypeMapping> SemanticTypeMappings = this.semanticTypeMatches.get(key);
      if (SemanticTypeMappings == null) {
        SemanticTypeMappings = new HashSet<SemanticTypeMapping>();
        this.semanticTypeMatches.put(key, SemanticTypeMappings);
      }
      SemanticTypeMappings.add(new SemanticTypeMapping(null, null, (InternalNode)source, labeledLink, (ColumnNode)target));
    }
       
    if (labeledLink.getModelIds() != null) {
      this.modelIds.addAll(labeledLink.getModelIds());
      this.numberOfModelLinks++;
    }
   
    this.updateLinkCountMap(link);
   
View Full Code Here

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

     
      ColumnNode cn = (ColumnNode)n;
           
      Set<LabeledLink> incomingLinks = this.graph.incomingEdgesOf(n);
      if (incomingLinks != null && incomingLinks.size() == 1) {
        LabeledLink link = incomingLinks.toArray(new LabeledLink[0])[0];
        Node domain = link.getSource();
        SemanticType st = new SemanticType(cn.getHNodeId(), link.getLabel(), domain.getLabel(), Origin.User, 1.0);
        cn.setUserSelectedSemanticType(st);
      } else
        logger.debug("The column node " + ((ColumnNode)n).getColumnName() + " does not have any domain or it has more than one domain.");
    }
  }
View Full Code Here

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

      for (LabeledLink l : forcedLinks) {
        if (l.getStatus() == LinkStatus.ForcedByUser) {
          Node source = l.getSource();
          Node target = l.getTarget();
          if (!this.graphBuilder.addLink(source, target, l)) {
            LabeledLink existingLink = this.graphBuilder.getIdToLinkMap().get(l.getId());
            if (existingLink != null) { // the link already exist, but it may not be forced by user
              this.graphBuilder.changeLinkStatus(existingLink, LinkStatus.ForcedByUser);
            }
          }
        }
View Full Code Here

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

        ColumnNode target = new ColumnNode(nodeId, nodeId, sourceColumn.getColumnName(), null);
        if (!this.graphBuilder.addNode(target)) continue;;
        addedNodes.add(target);

        String linkId = LinkIdFactory.getLinkId(propertyUri, source.getId(), target.getId())
        LabeledLink link = new DataPropertyLink(linkId, new Label(propertyUri));
        if (!this.graphBuilder.addLink(source, target, link)) continue;;

        SemanticTypeMapping mp = new SemanticTypeMapping(sourceColumn, semanticType, (InternalNode)source, link, target);
        mappings.add(mp);
      }
View Full Code Here

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

    ColumnNode target = new ColumnNode(nodeId, nodeId, sourceColumn.getColumnName(), null);
    if (!this.graphBuilder.addNode(target)) return null;
    addedNodes.add(target);

    String linkId = LinkIdFactory.getLinkId(propertyUri, source.getId(), target.getId())
    LabeledLink link;
    if (propertyUri.equalsIgnoreCase(ClassInstanceLink.getFixedLabel().getUri()))
      link = new ClassInstanceLink(linkId);
    else {
      Label label = this.ontologyManager.getUriLabel(propertyUri);
      link = new DataPropertyLink(linkId, label);
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.