Examples of ValueFactory


Examples of org.openrdf.model.ValueFactory

    }

    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

Examples of org.openrdf.model.ValueFactory

  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

Examples of org.openrdf.model.ValueFactory

  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

Examples of org.openrdf.model.ValueFactory

  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

Examples of org.openrdf.model.ValueFactory

      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

Examples of org.openrdf.model.ValueFactory

  {
    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

Examples of org.openrdf.model.ValueFactory

    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

Examples of org.openrdf.model.ValueFactory

      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

Examples of org.openrdf.model.ValueFactory

  {
    Form params = getQuery();
    int amount = ServerUtil.parseIntegerParam(params, Protocol.AMOUNT, 1);
    String nodeID = params.getFirstValue(Protocol.NODE_ID);

    ValueFactory vf = getConnection().getValueFactory();

    List<String> columns = Arrays.asList(Protocol.BNODE);
    List<BindingSet> bnodes = new ArrayList<BindingSet>(amount);
    for (int i = 0; i < amount; i++) {
      BNode bnode = createBNode(vf, nodeID, i);
View Full Code Here

Examples of org.openrdf.model.ValueFactory

    @Test
    public void testLinkExtraction() throws RepositoryException {
        assertExtract("/html/html-head-link-extractor.html");
        assertModelNotEmpty();
        final ValueFactory valueFactory = new ValueFactoryImpl();
        final URI externalLinkURI = valueFactory.createURI("http://www.myexperiment.org/workflows/16.rdf");
        assertContains(
                AbstractExtractorTestCase.baseURI,
                valueFactory.createURI("http://www.w3.org/1999/xhtml/vocab#alternate"),
                externalLinkURI

        );
        assertContains(
                externalLinkURI,
                valueFactory.createURI("http://purl.org/dc/terms/title"),
                valueFactory.createLiteral("RDF+XML")

        );
        assertContains(
                externalLinkURI,
                valueFactory.createURI("http://purl.org/dc/terms/format"),
                valueFactory.createLiteral("application/rdf+xml")

        );
    }
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.