Package org.ontoware.rdf2go.model.impl

Examples of org.ontoware.rdf2go.model.impl.StatementImpl


    this.notifyingModel
        .addModelChangedListener(new AbstractModelChangeListener() {

          @Override
          public void addedStatement(Statement statement) {
            assertEquals(new StatementImpl(null, subject,
                predicate, object), statement);
          }

          @Override
          public void addedStatements(
              Iterator<? extends Statement> statements) {
            assertTrue(statements.hasNext());
            assertEquals(new StatementImpl(null, subject,
                predicate, object), statements.next());
            assertFalse(statements.hasNext());
          }
        });
    this.notifyingModel.addStatement(subject, predicate, object);
View Full Code Here


    this.notifyingModel
        .addModelChangedListener(new AbstractModelChangeListener() {

          @Override
          public void removedStatement(Statement statement) {
            assertEquals(new StatementImpl(null, subject,
                predicate, object), statement);
          }

          @Override
          public void removedStatements(
              Iterator<? extends Statement> statements) {
            assertTrue(statements.hasNext());
            assertEquals(new StatementImpl(null, subject,
                predicate, object), statements.next());
            assertFalse(statements.hasNext());
          }
        });
    this.notifyingModel.close();
View Full Code Here

          @Override
          public void performedUpdate(DiffReader diff) {
            int i = 0;
            for (Statement s : diff.getAdded()) {
              i++;
              assertEquals(new StatementImpl(null, subject,
                  predicate, object), s);
            }
            assertEquals(1, i);
            assertFalse(diff.getRemoved().iterator().hasNext());
          }
View Full Code Here

  }
 
  @Test
  public void testCreateStatement() {
    Statement s = this.modelset.createStatement(a, b, c);
    assertEquals(s, new StatementImpl(null, a, b, c));
  }
View Full Code Here

    }
  }
 
  @Test
  public void testRDF2GoBug2() {
    Statement s = new StatementImpl(new URIImpl("urn:testcontext"), new URIImpl("urn:test"),
            new URIImpl("urn:testpred"), new URIImpl("urn:testobj"));
    this.modelset.addStatement(s);
    for(ClosableIterator<? extends Statement> i = this.modelset
            .findStatements(new QuadPatternImpl(Variable.ANY, Variable.ANY, Variable.ANY,
                    Variable.ANY)); i.hasNext();) {
View Full Code Here

      if(object instanceof BlankNode) {
        badStatements.add(s);
        object = bnodeToUri((BlankNode)object, replacement, counter);
        counter++;
      }
      goodStatements.add(new StatementImpl(m.getContextURI(), subject, s.getPredicate(),
              object));
    }
    for(Statement s : badStatements)
      m.removeStatement(s);
    for(Statement s : goodStatements)
View Full Code Here

       
        while(it3.hasNext())
        {
          Statement st = it3.next();         

          stToAdd.add(new StatementImpl(null,newUri, st.getPredicate(), st.getObject()));
          stToRemove.add(st);
         
          uriStetements++;
        }
        it3.close();
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.impl.StatementImpl

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.