Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.begin()


    InputStream stream = urlCon.getInputStream();
    try {
      RepositoryConnection repCon = getRepositoryConnection();
      try {
        repCon.begin();
        repCon.clear(context);
        repCon.add(stream, url.toExternalForm(), format, context);
        repCon.commit();
        lastModified.put(url, modified);
      }
View Full Code Here


    RepositoryConnection con = getConnection();
    try {
      if (con.isEmpty()) {
        logger.debug("Initializing empty {} repository", ID);

        con.begin();
        con.setNamespace("rdf", RDF.NAMESPACE);
        con.setNamespace("sys", RepositoryConfigSchema.NAMESPACE);

        if (persist) {
          RepositoryConfig repConfig = new RepositoryConfig(TITLE, new SystemRepositoryConfig());
View Full Code Here

  private void upload(URI graphURI, Resource context)
    throws Exception
  {
    RepositoryConnection con = dataRep.getConnection();

    con.begin();
    try {
      RDFFormat rdfFormat = Rio.getParserFormatForFileName(graphURI.toString(), RDFFormat.TURTLE);
      RDFParser rdfParser = Rio.createParser(rdfFormat, con.getValueFactory());
      rdfParser.setVerifyData(false);
      rdfParser.setDatatypeHandling(DatatypeHandling.IGNORE);
View Full Code Here

    public Collection<Value> listObjects(Value subject, Value property) {
        try {
            RepositoryConnection connection = repository.getConnection();

            try {
              connection.begin();
              return listObjectsInternal(connection, (Resource) subject, (org.openrdf.model.URI) property);
            } finally {
                connection.commit();
                connection.close();
            }
View Full Code Here

    public Collection<Value> listSubjects(Value property, Value object) {
        try {
            final RepositoryConnection connection = repository.getConnection();

            try {
              connection.begin();
              return listSubjectsInternal(connection, (org.openrdf.model.URI) property, object);
            } finally {
                connection.commit();
                connection.close();
            }
View Full Code Here

       
        yards = Arrays.asList(yard1,yard2,unionYard);
       
        //add the test data (to the Repository to also test pre-existing data)
        RepositoryConnection con = repo.getConnection();
        con.begin();
        URI entity1 = sesameFactory.createURI("http://www.test.org/entity1");
        con.add(entity1,rdfType,skosConcept,CONTEXT1);
        con.add(entity1,skosPrefLabel,sesameFactory.createLiteral("test context one", EN),CONTEXT1);
        con.add(entity1,skosPrefLabel,sesameFactory.createLiteral("Test Context Eins", DE),CONTEXT1);
        expectedEntities.put(entity1, Arrays.asList(yard1,unionYard));
View Full Code Here

            throw new IllegalArgumentException("The parsed representation id MUST NOT be EMTPY!");
        }
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            Representation rep = getRepresentation(con, sesameFactory.createURI(id), true);
            con.commit();
            return rep;
        } catch (RepositoryException e) {
            throw new YardException("Unable to get Representation "+id, e);
View Full Code Here

            throw new IllegalArgumentException("The parsed id MUST NOT be EMPTY!");
        }
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            boolean state = isRepresentation(con, sesameFactory.createURI(id));
            con.commit();
            return state;
        } catch (RepositoryException e) {
            throw new YardException("Unable to check for Representation "+id, e);
View Full Code Here

            throw new IllegalArgumentException("The parsed Representation id MUST NOT be NULL!");
        }
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            remove(con, sesameFactory.createURI(id));
            con.commit();
        } catch (RepositoryException e) {
            throw new YardException("Unable to remove for Representation "+id, e);
        } finally {
View Full Code Here

            throw new IllegalArgumentException("The parsed Iterable over the IDs to remove MUST NOT be NULL!");
        }
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            for(String id : ids){
                if(id != null){
                    remove(con, sesameFactory.createURI(id));
                }
            }
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.