Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.RecordImpl


    props.put("ID", Collections.singleton("abc"));
    Collection<String> list = new ArrayList();
    list.add("b");
    list.add("c");
    props.put("NAME", list);
    Record r = new RecordImpl(props);
    db.index(r);
    db.commit();

    // Then, retrieve it and verify that it's correct
    r = db.findRecordById("abc");
    assertEquals("abc", r.getValue("ID"));
    list = r.getValues("NAME");
    assertEquals(2, list.size());
    assertTrue(list.contains("b"));
    assertTrue(list.contains("c"));
  }
View Full Code Here


    int max_hits = 10000;
    if (parser.getOptionValue("maxhits") != null)
      max_hits = Integer.parseInt(parser.getOptionValue("maxhits"));

    // build record
    RecordImpl prototype = new RecordImpl();
    prototype.addValue(argv[1], argv[2]);

    // search
    Collection<Record> records = database.findCandidateMatches(prototype);
    int hitno = 1;
    for (Record record : records) {
View Full Code Here

import no.priv.garshol.duke.matchers.AbstractMatchListener;

public class TestUtils {

  public static Record makeRecord() {
    return new RecordImpl(new HashMap());   
  }
View Full Code Here

      }
    }

    // this finds the next record in the data stream
    private Record parseRecord() {
      RecordImpl record = new RecordImpl();
      String current = subject;

      // we've stored the first statement about the next resource, so we
      // need to process that before we move on to read anything
     
View Full Code Here

     
      if (types.isEmpty())
        return;
     
      for (String uri : new ArrayList<String>(records.keySet())) {
        RecordImpl r = records.get(uri);
        if (!filterbytype(r))
          records.remove(uri);
        else
          r.remove(RDF_TYPE);
      }
    }
View Full Code Here

    }

    // FIXME: refactor this so that we share code with addStatement()
    public void statement(String subject, String property, String object,
                          boolean literal) {
      RecordImpl record = records.get(subject);
      if (record == null) {
        record = new RecordImpl();
        records.put(subject, record);
      }
      addStatement(record, subject, property, object);
    }
View Full Code Here

    } catch (InterruptedException e) {
    }
  }

  private Record makeRecord() {
    return new RecordImpl(new HashMap());
  }
View Full Code Here

  }

  private Record makeRecord(String prop, String val) {
    Map<String, Collection<String>> data = new HashMap();
    data.put(prop, Collections.singleton(val));
    return new RecordImpl(data);
  }
View Full Code Here

TOP

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

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.