Package de.fuberlin.wiwiss.d2rq.map

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


      translationTableResources.add(stmts.nextStatement().getSubject());
    }
    it = translationTableResources.iterator();
    while (it.hasNext()) {
      Resource r = it.next();
      TranslationTable table = new TranslationTable(r);
      parseTranslationTable(table, r);
      this.mapping.addTranslationTable(table);
    }
  }
View Full Code Here


  }

  public void testEmptyTranslationTable() {
    Resource r = addTranslationTableResource();
    Mapping mapping = new MapParser(this.model, null).parse();
    TranslationTable table = mapping.translationTable(r);
    assertNotNull(table);
    assertEquals(0, table.size());
  }
View Full Code Here

  public void testGetSameTranslationTable() {
    Resource r = addTranslationTableResource();
    addTranslationResource(r, "foo", "bar");
    Mapping mapping = new MapParser(this.model, null).parse();
    TranslationTable table1 = mapping.translationTable(r);
    TranslationTable table2 = mapping.translationTable(r);
    assertSame(table1, table2);
  }
View Full Code Here

 
  public void testParseTranslationTable() {
    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 testTranslationTableRDFValueCanBeLiteral() {
    Mapping m = MappingHelper.readFromTestFile("parser/translation-table.ttl");
    TranslationTable tt = m.translationTable(ResourceFactory.createResource("http://example.org/tt"));
    assertEquals("http://example.org/foo", tt.translator().toRDFValue("literal"));
  }
View Full Code Here

    assertEquals("http://example.org/foo", tt.translator().toRDFValue("literal"));
  }
 
  public void testTranslationTableRDFValueCanBeURI() {
    Mapping m = MappingHelper.readFromTestFile("parser/translation-table.ttl");
    TranslationTable tt = m.translationTable(ResourceFactory.createResource("http://example.org/tt"));
    assertEquals("http://example.org/foo", tt.translator().toRDFValue("uri"));
  }
View Full Code Here

    assertTrue(nodes.isUnsupported());
  }
 
  public void testTranslatorUnsupported() {
    nodes.setUsesTranslator(Translator.IDENTITY);
    nodes.setUsesTranslator(new TranslationTable(ResourceFactory.createResource()).translator());
    assertFalse(nodes.isEmpty());
    assertTrue(nodes.isUnsupported());
  }
View Full Code Here

TOP

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

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.