Package edu.isi.karma.modeling.alignment.learner

Examples of edu.isi.karma.modeling.alignment.learner.SemanticTypeMapping


        propertyUri = semanticType.getType().getUri();
        Integer countOfSemanticType = semanticTypesCount.get(domainUri + propertyUri);
        logger.debug("count of semantic type: " +  countOfSemanticType);

        if (cn.getDomainNode() != null) {
          SemanticTypeMapping mp = new SemanticTypeMapping(cn, semanticType, cn.getDomainNode(), cn.getDomainLink(), cn);
          semanticTypeMappings.add(mp);
        } else {

          tempSemanticTypeMappings = findSemanticTypeInGraph(cn, semanticType, semanticTypesCount, addedNodes);
          logger.debug("number of matches for semantic type: "
             + (tempSemanticTypeMappings == null ? 0 : tempSemanticTypeMappings.size()));
 
          if (tempSemanticTypeMappings != null)
            semanticTypeMappings.addAll(tempSemanticTypeMappings);
 
          int countOfMatches = tempSemanticTypeMappings == null ? 0 : tempSemanticTypeMappings.size();
          if (countOfMatches < countOfSemanticType)
//          if (countOfMatches == 0) // No struct in graph is matched with the semantic type, we add a new struct to the graph
          {
            SemanticTypeMapping mp = addSemanticTypeStruct(cn, semanticType, addedNodes);
            if (mp != null)
              semanticTypeMappings.add(mp);
          }
        }
      }
View Full Code Here


    Double weight = null;
    Set<SemanticTypeMapping> semanticTypeMatches = this.graphBuilder.getSemanticTypeMatches().get(domainUri + propertyUri);
    if (semanticTypeMatches != null) {
      for (SemanticTypeMapping stm : semanticTypeMatches) {

        SemanticTypeMapping mp =
            new SemanticTypeMapping(sourceColumn, semanticType, stm.getSource(), stm.getLink(), stm.getTarget());
        mappings.add(mp);
        weight = stm.getLink().getWeight();
        //        foundInternalNodes.add(stm.getSource());
      }
    }

    logger.debug("adding data property to the found internal nodes ...");

    Integer count;
    boolean allowMultipleSamePropertiesPerNode = ModelingConfiguration.isMultipleSamePropertyPerNode();
    Set<Node> nodesWithSameUriOfDomain = this.graphBuilder.getUriToNodesMap().get(domainUri);
    if (nodesWithSameUriOfDomain != null) {
      for (Node source : nodesWithSameUriOfDomain) {
        count = this.graphBuilder.getNodeDataPropertyCount().get(source.getId() + propertyUri);

        if (count != null) {
          if (allowMultipleSamePropertiesPerNode) {
            if (count >= countOfSemanticType.intValue())
              continue;
          } else {
            if (count >= 1)
              continue;
          }
        }


        String nodeId = new RandomGUID().toString();
        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));
       
        boolean result = weight == null ? this.graphBuilder.addLink(source, target, link) : this.graphBuilder.addLink(source, target, link, weight);
        if (!result) continue;;

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

    return mappings;
View Full Code Here

      Label label = this.ontologyManager.getUriLabel(propertyUri);
      link = new DataPropertyLink(linkId, label);
    }
    if (!this.graphBuilder.addLink(source, target, link)) return null;

    SemanticTypeMapping mappingStruct = new SemanticTypeMapping(sourceColumn, semanticType, source, link, target);

    return mappingStruct;
  }
View Full Code Here

      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++;
View Full Code Here

TOP

Related Classes of edu.isi.karma.modeling.alignment.learner.SemanticTypeMapping

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.