Package org.openrdf.model

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


    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

    }

    InputStream in = url.openStream();

    try {
      final ValueFactory vf = con.getValueFactory();
      RDFParser rdfParser = new TurtleParser();
      rdfParser.setValueFactory(vf);

      rdfParser.setVerifyData(false);
      rdfParser.setStopAtFirstError(true);
View Full Code Here

  private void addProtectedStatement()
    throws StoreException
  {
    RepositoryConnection con = repository.getConnection();
    try {
      ValueFactory vf = con.getValueFactory();
      con.add(vf.createURI(RNA_RECYCLE), RDFS.LABEL, vf.createLiteral("test"));
    }
    finally {
      con.close();
    }
  }
View Full Code Here

  private void removeProtectedStatement()
    throws StoreException
  {
    RepositoryConnection con = repository.getConnection();
    try {
      ValueFactory vf = con.getValueFactory();
      con.removeMatch(vf.createURI(RNA_RECYCLE), null, null);
    }
    finally {
      con.close();
    }
  }
View Full Code Here

  private boolean hasProtectedStatement()
    throws StoreException
  {
    RepositoryConnection con = repository.getConnection();
    try {
      ValueFactory vf = con.getValueFactory();
      return con.hasMatch(vf.createURI(RNA_RECYCLE), RDF.TYPE, vf.createURI(SKOS_CONCEPT), true);
    }
    finally {
      con.close();
    }
  }
View Full Code Here

      throw new ResourceException(CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE, "Unsupported MIME type: "
          + mimeType);
    }

    ServerConnection connection = getConnection();
    ValueFactory vf = connection.getValueFactory();

    Form params = getQuery();
    Resource[] contexts = ServerUtil.parseContextParam(params, CONTEXT_PARAM_NAME, vf);
    URI baseURI = ServerUtil.parseURIParam(params, BASEURI_PARAM_NAME, vf);

    if (baseURI == null) {
      baseURI = vf.createURI("foo:bar");
      logger.info("no base URI specified, using dummy '{}'", baseURI);
    }

    try {
      InputStream in = entity.getStream();
View Full Code Here

  {
    setDimensions(ServerUtil.VARY_ACCEPT);

    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();
View Full Code Here

    throws ResourceException
  {
    List<String> bindingNames = Arrays.asList("id");
    MutableTupleResult result = new MutableTupleResult(bindingNames);

    ValueFactory vf = ValueFactoryImpl.getInstance();

    for (String connectionID : getRepository().getConnectionIDs()) {
      Literal idLit = vf.createLiteral(connectionID);
      result.append(new ListBindingSet(bindingNames, idLit));
    }

    return result;
  }
View Full Code Here

      String namespace = getRequest().getResourceRef().toString(false, false);
      if (!namespace.endsWith("/")) {
        namespace += "/";
      }

      ValueFactory vf = ValueFactoryImpl.getInstance();

      for (RepositoryInfo info : getRepositoryManager().getAllRepositoryInfos()) {
        String id = info.getId();

        MapBindingSet bindings = new MapBindingSet(3);
        bindings.addBinding("uri", vf.createURI(namespace, id));
        bindings.addBinding("id", vf.createLiteral(id));

        if (info.getDescription() != null) {
          bindings.addBinding("title", vf.createLiteral(info.getDescription()));
        }

        result.append(bindings);
      }
View Full Code Here

TOP

Related Classes of org.openrdf.model.ValueFactory

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.