Package de.fuberlin.wiwiss.d2rq.values

Examples of de.fuberlin.wiwiss.d2rq.values.Translator


    Resource r = addTranslationTableResource();
    addTranslationResource(r, "foo", "bar");
    Mapping mapping = new MapParser(this.model, null).parse();
    TranslationTable table = mapping.translationTable(r);
    assertEquals(1, table.size());
    Translator translator = table.translator();
    assertEquals("bar", translator.toRDFValue("foo"));
  }
View Full Code Here


  public void testTranslationTableTranslator() {
    TranslationTable table = new TranslationTable(table1);
    table.addTranslation("key1", "value1");
    table.addTranslation("key2", "value2");
    table.addTranslation("key3", "value3");
    Translator translator = table.translator();
    assertEquals("value1", translator.toRDFValue("key1"));
    assertEquals("value2", translator.toRDFValue("key2"));
    assertEquals("key1", translator.toDBValue("value1"));
    assertEquals("key2", translator.toDBValue("value2"));
  }
View Full Code Here

  }

  public void testUndefinedTranslation() {
    TranslationTable table = new TranslationTable(table1);
    table.addTranslation("key1", "value1");
    Translator translator = table.translator();
    assertNull(translator.toRDFValue("unknownKey"));
    assertNull(translator.toDBValue("http://example.org/"));
  }
View Full Code Here

  }
 
  public void testNullTranslation() {
    TranslationTable table = new TranslationTable(table1);
    table.addTranslation("key1", "value1");
    Translator translator = table.translator();
    assertNull(translator.toRDFValue(null));
    assertNull(translator.toDBValue(null));
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.values.Translator

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.