Package org.openrdf.sail.rdbms.model

Examples of org.openrdf.sail.rdbms.model.RdbmsValue


      boolean includeInferred, Resource... contexts)
    throws StoreException
  {
    RdbmsResource s = vf.asRdbmsResource(subj);
    RdbmsURI p = vf.asRdbmsURI(pred);
    RdbmsValue o = vf.asRdbmsValue(obj);
    RdbmsResource[] c = vf.asRdbmsResource(contexts);
    return triples.find(s, p, o, c);
  }
View Full Code Here


  public void removeStatements(Resource subj, URI pred, Value obj, Resource... contexts)
    throws StoreException
  {
    RdbmsResource s = vf.asRdbmsResource(subj);
    RdbmsURI p = vf.asRdbmsURI(pred);
    RdbmsValue o = vf.asRdbmsValue(obj);
    RdbmsResource[] c = vf.asRdbmsResource(contexts);
    triples.remove(s, p, o, c);
  }
View Full Code Here

    throws StoreException
  {
    try {
      RdbmsResource s = vf.asRdbmsResource(subj);
      RdbmsURI p = vf.asRdbmsURI(pred);
      RdbmsValue o = vf.asRdbmsValue(obj);
      return triples.size(s, p, o, vf.asRdbmsResource(contexts));
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
View Full Code Here

    throws SQLException, InterruptedException
  {
    throwException();
    List<RdbmsValue> values = new ArrayList<RdbmsValue>(getChunkSize());
    Map<Long, Number> map = new HashMap<Long, Number>(getChunkSize());
    RdbmsValue taken = queue.poll();
    while (taken != null) {
      values.clear();
      values.add(taken);
      synchronized (assignIds) {
        assignIds(values, map);
View Full Code Here

  private void assignIds(List<RdbmsValue> values, Map<Long, Number> map)
    throws SQLException, InterruptedException
  {
    while (values.size() < getChunkSize()) {
      RdbmsValue taken = queue.poll();
      if (taken == closeSignal) {
        queue.add(taken);
        break;
      }
      if (taken == null) {
        break;
      }
      values.add(taken);
    }
    Map<Long, Number> existing = lookup(values, map);
    Iterator<RdbmsValue> iter = values.iterator();
    while (iter.hasNext()) {
      RdbmsValue value = iter.next();
      Long hash = idseq.hashOf(value);
      if (existing.get(hash) != null) {
        // already in database
        Number id = idseq.idOf(existing.get(hash));
        value.setInternalId(id);
        value.setVersion(getIdVersion(value));
        iter.remove();
      }
      else {
        synchronized (ids) {
          if (ids.containsKey(hash)) {
            // already inserting this value
            Number id = ids.get(hash);
            value.setInternalId(id);
            value.setVersion(getIdVersion(value));
            iter.remove();
          }
          else {
            // new id to be inserted
            Number id = idseq.nextId(value);
            value.setInternalId(id);
            value.setVersion(getIdVersion(value));
            ids.put(hash, id);
            // keep on list for later insert
          }
        }
      }
View Full Code Here

  }

  public RdbmsStatement createStatement(Resource subject, URI predicate, Value object, Resource context) {
    RdbmsResource subj = asRdbmsResource(subject);
    RdbmsURI pred = asRdbmsURI(predicate);
    RdbmsValue obj = asRdbmsValue(object);
    RdbmsResource ctx = asRdbmsResource(context);
    return new RdbmsStatement(subj, pred, obj, ctx);
  }
View Full Code Here

  {
    try {
      if (r == null) {
        return ValueTable.NIL_ID;
      }
      RdbmsValue value = asRdbmsValue(r);
      if (value instanceof RdbmsURI) {
        return uris.getInternalId((RdbmsURI)value);
      }
      if (value instanceof RdbmsBNode) {
        return bnodes.getInternalId((RdbmsBNode)value);
View Full Code Here

    throws StoreException
  {
    RdbmsValueFactory vf = triples.getValueFactory();
    RdbmsResource s = vf.asRdbmsResource(subj);
    RdbmsURI p = vf.asRdbmsURI(pred);
    RdbmsValue o = vf.asRdbmsValue(obj);
    RdbmsResource[] c = vf.asRdbmsResource(contexts);
    return triples.find(s, p, o, c);
  }
View Full Code Here

    throws RdbmsException
  {
    try {
      RdbmsResource s = vf.asRdbmsResource(subj);
      RdbmsURI p = vf.asRdbmsURI(pred);
      RdbmsValue o = vf.asRdbmsValue(obj);
      RdbmsResource[] c = vf.asRdbmsResource(ctxs);
      flush();
      SqlQueryBuilder query = buildSelectQuery(s, p, o, c);
      if (query == null) {
        return new EmptyRdbmsStatementCursor();
View Full Code Here

  public int remove(Resource subj, URI pred, Value obj, Resource... ctxs)
    throws RdbmsException
  {
    RdbmsResource s = vf.asRdbmsResource(subj);
    RdbmsURI p = vf.asRdbmsURI(pred);
    RdbmsValue o = vf.asRdbmsValue(obj);
    RdbmsResource[] c = vf.asRdbmsResource(ctxs);
    flush();
    try {
      Collection<Number> predicates;
      if (p == null) {
View Full Code Here

TOP

Related Classes of org.openrdf.sail.rdbms.model.RdbmsValue

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.