コード例 #1
0
ファイル: Alignment.java プロジェクト: anukat2015/Swip
 public void removeCorrespondencesWithNSPrefix(String ns) {
   ArrayList<Correspondence> filteredCorrespondences = new ArrayList<Correspondence>();
   for (Correspondence c : this) {
     if (!(c.getSourceNamespace().startsWith(ns) || c.getTargetNamespace().startsWith(ns))) {
       filteredCorrespondences.add(c);
     }
   }
   this.setCorrespondences(filteredCorrespondences);
 }
コード例 #2
0
ファイル: Alignment.java プロジェクト: anukat2015/Swip
  /**
   * Returns different kinds of meta information about this mapping.
   *
   * @return Information about this mapping.
   */
  public String getMetaDescription() {
    StringBuffer sb = new StringBuffer();

    HashSet<SemanticRelation> relations = new HashSet<SemanticRelation>();
    HashSet<String> sourceNamespaces = new HashSet<String>();
    HashSet<String> targetNamespaces = new HashSet<String>();

    double lowerBound = this.getConfidenceLowerBound();
    double upperBound = this.getConfidenceUpperBound();
    for (Correspondence c : this.getCorrespondences()) {
      relations.add(c.getRelation());
      sourceNamespaces.add(c.getSourceNamespace());
      targetNamespaces.add(c.getTargetNamespace());
    }
    sb.append("NUMBER OF CORRESPONDENCES: " + this.size() + "\n");
    sb.append("SEMANTIC RELATIONS: " + relations + "\n");
    sb.append("NAMESPACES FOR SOURCE ENTITIES: " + sourceNamespaces + "\n");
    sb.append("NAMESPACES FOR TARGET ENTITIES: " + targetNamespaces + "\n");
    sb.append("CONFIDENCE RANGE: [" + lowerBound + ", " + upperBound + "]\n");
    sb.append("IS UNIQUE: " + this.isUnique() + "\n");
    return sb.toString();
  }