public ColumnNode(String id, String hNodeId, String columnName, Label rdfLiteralType, String language) { super(id, new Label(hNodeId), NodeType.ColumnNode); this.hNodeId = hNodeId; this.columnName = columnName; this.setRdfLiteralType(rdfLiteralType); this.setLanguage(language); this.userSemanticTypes = null; this.learnedSemanticTypes = null; this.semanticTypeStatus = ColumnSemanticTypeStatus.NotAssigned; }
public Label(Label uri) { if (uri == null) this.init(); else { this.uri = uri.getUri(); this.ns = uri.getNs(); this.prefix = uri.getPrefix(); this.rdfsLabel = uri.getRdfsLabel(); this.rdfsComment = uri.getRdfsComment(); } }
public JSONObject getJSONArrayRepresentation() throws JSONException { JSONObject typeObj = new JSONObject(); typeObj.put(ClientJsonKeys.FullType.name(), type.getUri()); if(isClass()) typeObj.put(ClientJsonKeys.DomainUri.name(), ""); else typeObj.put(ClientJsonKeys.DomainUri.name(), domain.getUri()); return typeObj; }
@Override public String toString() { if (isClass()) return "SemanticType [hNodeId=" + hNodeId + ", type=" + type.getUri() + ", origin=" + origin + ", confidenceLevel=" + confidenceLevel + "]"; else return "SemanticType [hNodeId=" + hNodeId + ", type=" + type.getUri() + ", domain=" + domain.getUri() + ", origin=" + origin + ", confidenceLevel=" + confidenceLevel + "]"; }
private String getClassName(Node node) { String name = (node instanceof ColumnNode) ? ((ColumnNode)node).getColumnName() : node.getDisplayId(); return name; }
public CompactLink copy(String newId) { CompactLink newLink = null; if (this instanceof CompactObjectPropertyLink) newLink = new CompactObjectPropertyLink(newId, ((CompactObjectPropertyLink)this).getObjectPropertyType()); else if (this instanceof CompactSubClassLink) newLink = new CompactSubClassLink(newId); else logger.error("cannot instanciate a link from the type: " + this.getType().toString()); return newLink; } }
public String getDisplayId() { if (this.label.getPrefix() == null) return this.getLocalId(); return this.label.getPrefix() + ":" + this.getLocalId(); }
public DefaultLink getCopy(String newId) { if (this instanceof LabeledLink) return ((LabeledLink)this).copy(newId); else if (this instanceof CompactLink) return ((CompactLink)this).copy(newId); else { logger.error("cannot instanciate a link from the type: " + this.getType().toString()); return null; } } }
public String getDisplayId() { if (this.label.getPrefix() == null) return this.getLocalId(); return this.label.getPrefix() + ":" + this.getLocalId(); }
public LabeledLink(String id, Label label, LinkType type, boolean isProvenance) { super(id, type); init(); if (label != null) this.label = label; this.isProvenance = isProvenance; this.isMainProvenanceLink = false; }
private String getPriority(LabeledLink link) { if (link instanceof ObjectPropertyLink && ((ObjectPropertyLink)link).getObjectPropertyType() == ObjectPropertyType.Direct) return "0"; else if (link instanceof ObjectPropertyLink && ((ObjectPropertyLink)link).getObjectPropertyType() == ObjectPropertyType.Indirect) return "1"; else if (link instanceof ObjectPropertyLink && ((ObjectPropertyLink)link).getObjectPropertyType() == ObjectPropertyType.WithOnlyDomain) return "2"; else if (link instanceof ObjectPropertyLink && ((ObjectPropertyLink)link).getObjectPropertyType() == ObjectPropertyType.WithOnlyRange) return "2"; else if (link instanceof ObjectPropertyLink && ((ObjectPropertyLink)link).getObjectPropertyType() == ObjectPropertyType.WithoutDomainAndRange) return "3"; else if (link instanceof SubClassLink) return "4"; else return "5"; }
public Node(Node v) { if (v == null) this.init(); else { this.id = v.id; this.label = v.label; this.type = v.type; } }
public Label(String uri, String ns, String prefix) { this.init(); this.uri = uri; this.ns = ns; this.prefix = prefix; }
public LabeledLink(String id, Label label, LinkType type, LinkKeyInfo keyInfo) { super(id, type); this.init(); if (label != null) this.label = label; if (keyInfo != null) this.keyInfo = keyInfo; this.isProvenance = false; this.isMainProvenanceLink = false; }
public LabeledLink(LabeledLink e) { super(e); if (e == null) this.init(); else { this.label = e.label; this.status = e.status; this.keyInfo = e.keyInfo; this.isProvenance = e.isProvenance; this.isMainProvenanceLink = e.isMainProvenanceLink; } }