Examples of ValueFactory


Examples of org.openrdf.model.ValueFactory

  }

  public void testDayTime()
    throws Exception
  {
    ValueFactory vf = new ValueFactoryImpl();
    Literal lit = vf.createLiteral("P1D", DURATION_DAYTIME);
    Duration duration = lit.durationValue();
    assertEquals(lit, vf.createLiteral(duration));
  }
View Full Code Here

Examples of org.openrdf.model.ValueFactory

  }

  public void testFullDuration()
    throws Exception
  {
    ValueFactory vf = new ValueFactoryImpl();
    Literal lit = vf.createLiteral("P1Y1M1D", DURATION);
    Duration duration = lit.durationValue();
    assertEquals(lit, vf.createLiteral(duration));
  }
View Full Code Here

Examples of org.openrdf.model.ValueFactory

  /*--------------*
   * Constructors *
   *--------------*/

  public HTTPRepository(String serverURL, String repositoryID) {
    ValueFactory vf = new ValueFactoryImpl(new BNodeFactoryImpl(), uf, lf);
    pool = new HTTPConnectionPool(serverURL, vf);
    client = new SesameClient(pool).repositories().slash(repositoryID);
    cache = new RepositoryCache(client);
  }
View Full Code Here

Examples of org.openrdf.model.ValueFactory

    client = new SesameClient(pool).repositories().slash(repositoryID);
    cache = new RepositoryCache(client);
  }

  public HTTPRepository(String repositoryURL) {
    ValueFactory vf = new ValueFactoryImpl(new BNodeFactoryImpl(), uf, lf);
    String serverURL = Protocol.getServerLocation(repositoryURL);
    if (serverURL != null) {
      pool = new HTTPConnectionPool(serverURL, vf).location(repositoryURL);
    }
    else {
View Full Code Here

Examples of org.openrdf.model.ValueFactory

  @Override
  public Resource export(Model model) {
    Resource implNode = super.export(model);

    ValueFactory vf = ValueFactoryImpl.getInstance();

    if (jdbcDriver != null) {
      model.add(implNode, JDBC_DRIVER, vf.createLiteral(jdbcDriver));
    }
    if (url != null) {
      model.add(implNode, URL, vf.createLiteral(url));
    }
    if (user != null) {
      model.add(implNode, USER, vf.createLiteral(user));
    }
    if (password != null) {
      model.add(implNode, PASSWORD, vf.createLiteral(password));
    }
    model.add(implNode, MAX_TRIPLE_TABLES, vf.createLiteral(maxTripleTables));

    return implNode;
  }
View Full Code Here

Examples of org.openrdf.model.ValueFactory

  @Override
  public Resource export(Model model) {
    Resource implNode = super.export(model);

    ValueFactory vf = ValueFactoryImpl.getInstance();

    for (RepositoryImplConfig member : members) {
      model.add(implNode, MEMBER, member.export(model));
    }

    for (String space : localPropertySpace) {
      model.add(implNode, LOCALPROPERTYSPACE, vf.createURI(space));
    }

    model.add(implNode, DISTINCT, vf.createLiteral(distinct));

    model.add(implNode, READ_ONLY, vf.createLiteral(readOnly));

    return implNode;
  }
View Full Code Here

Examples of org.openrdf.model.ValueFactory

        return "FilterOutPartialMatches";
      }
    };

    // Convert the BindingSet objects to actual RDF statements
    final ValueFactory vf = getConnection().getValueFactory();
    Cursor<Statement> stIter;
    stIter = new ConvertingCursor<BindingSet, Statement>(bindingsIter) {

      @Override
      protected Statement convert(BindingSet bindingSet) {
        Resource subject = (Resource)bindingSet.getValue("subject");
        URI predicate = (URI)bindingSet.getValue("predicate");
        Value object = bindingSet.getValue("object");
        Resource context = (Resource)bindingSet.getValue("context");

        if (context == null) {
          return vf.createStatement(subject, predicate, object);
        }
        else {
          return vf.createStatement(subject, predicate, object, context);
        }
      }

      @Override
      protected String getName() {
View Full Code Here

Examples of org.openrdf.model.ValueFactory

   * @throws StoreConfigException
   */
  private void updateRepositoryConfigs(RepositoryConnection con, String id, RepositoryConfig config)
    throws StoreException, StoreConfigException
  {
    ValueFactory vf = con.getValueFactory();

    con.begin();

    Resource context = getContext(con, id);

    if (context != null) {
      con.clear(context);
    }
    else {
      context = vf.createBNode();
    }

    con.add(context, RDF.TYPE, REPOSITORY_CONTEXT);

    Model model = new LinkedHashModel();
View Full Code Here

Examples of org.openrdf.model.ValueFactory

  @Override
  public Resource export(Model model) {
    Resource repImplNode = super.export(model);

    ValueFactory vf = ValueFactoryImpl.getInstance();

    if (includeInferred != null) {
      Literal bool = vf.createLiteral(includeInferred);
      model.add(repImplNode, INCLUDE_INFERRED, bool);
    }
    if (maxQueryTime > 0) {
      model.add(repImplNode, MAX_QUERY_TIME, vf.createLiteral(maxQueryTime));
    }
    if (queryResultLimit >= 0) {
      model.add(repImplNode, QUERY_RESULT_LIMIT, vf.createLiteral(queryResultLimit));
    }
    if (queryLanguage != null) {
      model.add(repImplNode, QUERY_LANGUAGE, vf.createLiteral(queryLanguage.getName()));
    }
    for (URI uri : readContexts) {
      model.add(repImplNode, READ_CONTEXT, uri);
    }
    for (URI resource : addContexts) {
View Full Code Here

Examples of org.openrdf.model.ValueFactory

    export(model);
    return model;
  }

  public void export(Model model) {
    ValueFactory vf = ValueFactoryImpl.getInstance();

    BNode repositoryNode = vf.createBNode();

    model.add(repositoryNode, RDF.TYPE, REPOSITORY);

    if (title != null) {
      model.add(repositoryNode, REPOSITORYTITLE, vf.createLiteral(title));
      model.add(repositoryNode, RDFS.LABEL, vf.createLiteral(title));
    }
    if (implConfig != null) {
      Resource implNode = implConfig.export(model);
      model.add(repositoryNode, REPOSITORYIMPL, implNode);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.