Package org.openrdf.http.server.helpers

Examples of org.openrdf.http.server.helpers.StatementPatternParams


  protected final Representation getRepresentation(RDFWriterFactory factory, MediaType mediaType)
    throws ResourceException
  {
    ServerConnection con = getConnection();
    StatementPatternParams p = new StatementPatternParams(getRequest(), con.getValueFactory());

    try {
      ModelResult modelResult = getConnection().match(p.getSubject(), p.getPredicate(), p.getObject(),
          p.isIncludeInferred(), p.getContext());

      if (p.getOffset() > 0 || p.getLimit() > -1) {
        Cursor<Statement> cursor = modelResult;

        if (p.getOffset() > 0) {
          cursor = new OffsetCursor<Statement>(cursor, p.getOffset());
        }
        if (p.getLimit() > -1) {
          cursor = new LimitCursor<Statement>(cursor, p.getLimit());
        }
        modelResult = new ModelResultImpl(cursor);
      }

      ModelResultRepresentation result = new ModelResultRepresentation(modelResult, factory, mediaType);
View Full Code Here


  @Override
  protected Representation delete(Variant variant)
    throws ResourceException
  {
    ServerConnection con = getConnection();
    StatementPatternParams p = new StatementPatternParams(getRequest(), con.getValueFactory());

    try {
      con.removeMatch(p.getSubject(), p.getPredicate(), p.getObject(), p.getContext());
      con.getCacheInfo().processUpdate();
      return null;
    }
    catch (StoreException e) {
      throw new ResourceException(SERVER_ERROR_INTERNAL, "Repository update error", e);
View Full Code Here

    if (variant.getMediaType().equals(MediaType.TEXT_PLAIN, true)) {
      ServerConnection connection = getConnection();
      ValueFactory vf = connection.getValueFactory();

      StatementPatternParams spParams = new StatementPatternParams(getRequest(), vf);

      Resource subj = spParams.getSubject();
      URI pred = spParams.getPredicate();
      Value obj = spParams.getObject();
      Resource[] contexts = spParams.getContext();
      boolean includeInferred = spParams.isIncludeInferred();

      try {
        long size = connection.sizeMatch(subj, pred, obj, includeInferred, contexts);
        return new StringRepresentation(String.valueOf(size));
      }
View Full Code Here

TOP

Related Classes of org.openrdf.http.server.helpers.StatementPatternParams

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.