Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.Record


    source.addColumn(new Column("F3", null, null, null));
    source.addColumn(new Column("F4", null, null, null));

    try {
      RecordIterator it = read("F5,F2,F3\na,b,c");
      Record r = it.next();
      fail("Didn't catch unknown column F5");
    } catch (DukeConfigException e) {
      // caught the configuration mistake
    }
  }
View Full Code Here


    source.addColumn(c);
    source.addColumn(new Column("F3", null, null, null));

    RecordIterator it = read("F1,F2,F3\na,b;d;e,c");

    Record r = it.next();
    assertEquals("a", r.getValue("F1"));
    assertEquals("c", r.getValue("F3"));

    Collection<String> values = r.getValues("F2");
    assertEquals(3, values.size());
    assertTrue(values.contains("b"));
    assertTrue(values.contains("d"));
    assertTrue(values.contains("e"));
  }
View Full Code Here

    source.addColumn(new Column("?uri", "ID", null, null));
    source.addColumn(new Column("http://b", "PROP", null, null));
   
    RecordIterator it = read("<http://a> <http://b> \"foo\" .\n");

    Record r = it.next();
    assertEquals("http://a", r.getValue("ID"));
    assertEquals("foo", r.getValue("PROP"));

    assertFalse(it.hasNext());
  }
View Full Code Here

    source.addColumn(new Column("http://b", "PROP", null, null));
   
    RecordIterator it = read("<http://a> <http://b> \"foo\" .\n" +
                             "<http://a> <http://c> \"foo\" .\n");

    Record r = it.next();
    assertEquals("http://a", r.getValue("ID"));
    assertEquals("foo", r.getValue("PROP"));

    assertFalse(it.hasNext());
  }
View Full Code Here

      if (link.getKind() != LinkKind.SAME)
        continue; // it's a bad link, so never mind

      missed++;

      Record r1 = database.findRecordById(link.getID1());
      Record r2 = database.findRecordById(link.getID2());
      if (r1 != null && r2 != null) {
        if (debug && !showmatches)
          PrintMatchListener.show(r1, r2, processor.compare(r1, r2),
                                  "\nNOT FOUND", props, pretty);
      } else if (debug && !showmatches) {
View Full Code Here

    source.addColumn(new Column("http://b", "PROP", null, null));
   
    RecordIterator it = read("\n<http://a> <http://b> \"foo\" .\n\n" +
                             "<http://a> <http://c> \"foo\" .\n\n");

    Record r = it.next();
    assertEquals("http://a", r.getValue("ID"));
    assertEquals("foo", r.getValue("PROP"));

    assertFalse(it.hasNext());
  }
View Full Code Here

                             "<http://a> <" + RDF_TYPE + "> \"http://d\" .\n" +
                             "<http://e> <http://b> \"bar\" .\n" +
                             "<http://e> <http://c> \"foo\" .\n" +
                             "<http://e> <" + RDF_TYPE + "> \"http://f\" .\n");

    Record r = it.next();
    checkAorE(r); // we don't know the order
    assertTrue("second record not found", it.hasNext());
    r = it.next();
    checkAorE(r);
  }
View Full Code Here

                             "<http://a> <" + RDF_TYPE + "> \"http://d\" .\n" +
                             "<http://e> <http://b> \"bar\" .\n" +
                             "<http://e> <http://c> \"foo\" .\n" +
                             "<http://e> <" + RDF_TYPE + "> \"http://f\" .\n");

    Record r = it.next();
    assertEquals("http://a", r.getValue("ID"));
    assertEquals("foo", r.getValue("PROP"));

    assertFalse("e record not filtered out", it.hasNext());
  }
View Full Code Here

    // value into two different properties.
    source.addColumn(new Column("http://b", "PROP2", null, null));
   
    RecordIterator it = read("<http://a> <http://b> \"foo\" .\n");

    Record r = it.next();
    assertEquals("http://a", r.getValue("ID"));
    assertEquals("foo", r.getValue("PROP"));
    assertEquals("foo", r.getValue("PROP2"));

    assertFalse(it.hasNext());
  }
View Full Code Here

                                "YEAROFBIRTH", null, birthcleaner));
    source.addColumn(new Column("http://data.deichman.no/lifespan",
                                "YEAROFDEATH", null, deathcleaner));

    RecordIterator it = read(data);
    Record r = it.next();
    assertEquals("http://data.deichman.no/person/ahlgren_ernst_1850-1888",
                 r.getValue("ID"));
    assertEquals("ernst ahlgren", r.getValue("NAME"));
    assertEquals("1850", r.getValue("YEAROFBIRTH"));
    assertEquals("1888", r.getValue("YEAROFDEATH"));

    assertFalse(it.hasNext());
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.Record

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.