private Map<String, ColumnNode> createColumnNodeMap() { Set<Node> alignmentColumnNodes = alignment.getNodesByType(NodeType.ColumnNode); Map<String, ColumnNode> hNodeIdToColumnNodeMap = new HashMap<>(); if (alignmentColumnNodes == null) return hNodeIdToColumnNodeMap; for (Node cNode : alignmentColumnNodes) { ColumnNode columnNode = (ColumnNode) cNode; hNodeIdToColumnNodeMap.put(columnNode.getHNodeId(), columnNode); } return hNodeIdToColumnNodeMap; }
private void writeSourceColumn(JsonWriter writer, ColumnNode sourceColumn) throws IOException { if (sourceColumn == null) return; writer.beginObject(); writer.name("id").value(sourceColumn.getId()); writer.name("hNodeId").value(sourceColumn.getHNodeId()); writer.name("columnName").value(sourceColumn.getColumnName()); writer.endObject(); }
public List<SemanticType> getSuggestedTypes(OntologyManager ontologyManager, ColumnNode columnNode, SemanticTypeColumnModel columnModel) { ArrayList<SemanticType> suggestedSemanticTypes = new ArrayList<>(); if (columnModel == null) return suggestedSemanticTypes; for (Entry<String, Double> entry : columnModel.getScoreMap().entrySet()) { String key = entry.getKey(); Double confidence = entry.getValue(); if (key == null || key.isEmpty()) continue; String[] parts = key.split("\\|"); if (parts == null || parts.length != 2) continue; String domainUri = parts[0].trim(); String propertyUri = parts[1].trim(); Label domainLabel = ontologyManager.getUriLabel(domainUri); if (domainLabel == null) continue; Label propertyLabel = ontologyManager.getUriLabel(propertyUri); if (propertyLabel == null) continue; SemanticType semanticType = new SemanticType(columnNode.getHNodeId(), propertyLabel, domainLabel, null, false, Origin.TfIdfModel, confidence); logger.info("\t" + propertyUri + " of " + domainUri + ": " + confidence); suggestedSemanticTypes.add(semanticType); } Collections.sort(suggestedSemanticTypes, Collections.reverseOrder()); return suggestedSemanticTypes; }
n1NodeIds.add(c.getHNodeId()); n2NodeIds.add(c.getHNodeId());
if(workspace != null && worksheet != null) { OntologyManager ontologyManager = workspace.getOntologyManager(); String hNodeId = columnNode.getHNodeId(); SemanticTypeColumnModel columnModel = predictColumnSemanticType(workspace, worksheet, hNodeId, numSuggestions, sel);
if (n instanceof ColumnNode) { logger.debug("Node " + n.getLocalId() + " is a column node."); hNodeId = ((ColumnNode)n).getHNodeId(); } else { logger.debug("Node " + n.getLocalId() + " is an intermediate node.");
c.getHNodeId(), c.getColumnName(), c.getRdfLiteralType(), c.getLanguage()); if (this.graphBuilder.addNode(newNode)) {
writer.name("hNodeId").value(cn.getHNodeId()); writer.name("columnName").value(cn.getColumnName()); writer.name("rdfLiteralType");
private void setUserTypesForColumnNodes() { if (this.graph == null) return; for (Node n : this.graph.vertexSet()) { if (!(n instanceof ColumnNode)) continue; ColumnNode cn = (ColumnNode)n; Set<LabeledLink> incomingLinks = this.graph.incomingEdgesOf(n); if (incomingLinks != null) { for (LabeledLink link : incomingLinks) { Node domain = link.getSource(); SemanticType st = new SemanticType(cn.getHNodeId(), link.getLabel(), domain.getLabel(), domain.getId(), false, Origin.User, 1.0); cn.assignUserType(st); } } else logger.debug("The column node " + ((ColumnNode)n).getColumnName() + " does not have any domain or it has more than one domain."); } }
if (n instanceof ColumnNode) { ColumnNode c = (ColumnNode)n; newNode = new ColumnNode(new RandomGUID().toString(), c.getHNodeId(), c.getColumnName(), c.getRdfLiteralType(), c.getLanguage());
if (v instanceof ColumnNode) { ColumnNode cNode = (ColumnNode) v; hNodeIdsCoveredByVertex.put(cNode.getHNodeId()); hNodeId = cNode.getHNodeId(); hNodeIdsAdded.add(cNode.getHNodeId()); hNodeIdsCoveredByVertex_holder.put(cNode.getHNodeId()); NodeType.ColumnNode.name(), 0, false, hNodeIdsCoveredByVertex_holder, cNode.getHNodeId(), cNode.getLabel().getUri(), false); .getHNodeId(); JSONArray hNodeIdsCoveredByVertex_holder_2 = new JSONArray(); hNodeIdsCoveredByVertex_holder_2.put(endHNodeId); ColumnNode cNode = (ColumnNode) v; hNodeIdsCoveredByVertex_holder.put(cNode .getHNodeId()); .getHNodeId(); JSONArray hNodeIdsCoveredByVertex_holder_2 = new JSONArray(); hNodeIdsCoveredByVertex_holder_2.put(endHNodeId);
for (Node node : nodes) { if (node instanceof ColumnNode) { columnNodes.put(((ColumnNode) node).getHNodeId(), (ColumnNode) node);
if (n instanceof ColumnNode) { logger.debug("Vertex " + n.getLocalId() + " is a column node."); String hNodeId = ((ColumnNode)n).getHNodeId(); String attId = "att" + String.valueOf(attributeList.size() + 1); Attribute att = new Attribute(attId, this.getUri(), n.getLabel().getLocalName(), IOType.NONE, AttributeRequirement.NONE);
SemanticType st = new SemanticType(((ColumnNode)target).getHNodeId(), newLink.getLabel(), source.getLabel(), source.getId(), false,
if (tNode instanceof ColumnNode) { ColumnNode cnode = (ColumnNode) tNode; String hNodeId = cnode.getHNodeId(); String columnName = translator.getColumnNameForHNodeId(hNodeId); ColumnTemplateTerm cnTerm = new ColumnTemplateTerm(columnName);
.getHNodeId(); LabeledLink newLink = alignment.addDataPropertyOfColumnLink(classInstanceNode, columnNode, targetHNodeId, propertyLink.getId());
Node specializedEdgeTarget = specializedEdge.getTarget(); if (specializedEdgeTarget instanceof ColumnNode) { String columnName = translator.getColumnNameForHNodeId(((ColumnNode) specializedEdgeTarget).getHNodeId()); ColumnTemplateTerm cnTerm = new ColumnTemplateTerm(columnName); String hNodeId = cnode.getHNodeId(); String columnName = translator.getColumnNameForHNodeId(hNodeId); ColumnTemplateTerm cnTerm = new ColumnTemplateTerm(columnName); Node specializedEdgeTarget = specializedEdge.getTarget(); if (specializedEdgeTarget instanceof ColumnNode) { String targetColumnName = translator.getColumnNameForHNodeId(((ColumnNode) specializedEdgeTarget).getHNodeId()); ColumnTemplateTerm cnsplTerm = new ColumnTemplateTerm(targetColumnName);