Package de.fuberlin.wiwiss.d2rq.map.TranslationTable

Examples of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation


        if (fields.length != 2) {
          this.log.warn("Skipping line with " +
              fields.length + " instead of 2 columns in CSV file " + this.url);
          continue;
        }
        result.add(new Translation(fields[0], fields[1]));
      }
      return result;
    } catch (IOException iex) {
      throw new D2RQException(iex);
    }
View Full Code Here


public class TranslationTableParserTest extends TestCase {
  private Collection<Translation> simpleTranslations;
 
  public void setUp() {
    this.simpleTranslations = new HashSet<Translation>();
    this.simpleTranslations.add(new Translation("db1", "rdf1"));
    this.simpleTranslations.add(new Translation("db2", "rdf2"));
  }
View Full Code Here

  public void testSimple() {
    String csv = "key,value";
    Collection<Translation> translations = new TranslationTableParser(
        new StringReader(csv)).parseTranslations();
    assertEquals(1, translations.size());
    Translation t = (Translation) translations.iterator().next();
    assertEquals("key", t.dbValue());
    assertEquals("value", t.rdfValue());
  }
View Full Code Here

    assertNull(translator.toRDFValue(null));
    assertNull(translator.toDBValue(null));
  }
 
  public void testTranslationsWithSameValuesAreEqual() {
    Translation t1 = new Translation("foo", "bar");
    Translation t2 = new Translation("foo", "bar");
    assertEquals(t1, t2);
    assertEquals(t1.hashCode(), t2.hashCode());
  }
View Full Code Here

    assertEquals(t1, t2);
    assertEquals(t1.hashCode(), t2.hashCode());
  }
 
  public void testTranslationsWithDifferentValuesAreNotEqual() {
    Translation t1 = new Translation("foo", "bar");
    Translation t2 = new Translation("foo", "bar2");
    Translation t3 = new Translation("foo2", "bar");
    assertFalse(t1.equals(t2));
    assertFalse(t2.equals(t1));
    assertFalse(t1.hashCode() == t2.hashCode());
    assertFalse(t1.equals(t3));
    assertFalse(t3.equals(t1));
    assertFalse(t1.hashCode() == t3.hashCode());
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.map.TranslationTable.Translation

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.