Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.ReifiedStatement


   */
  public void testLeosBug()
  {
    final Model A = getModel();
    final Statement st = ModelTestBase.statement(A, "pigs fly south");
    final ReifiedStatement rst = st.createReifiedStatement("eh:pointer");
    A.removeReification(rst);
    ModelTestBase.assertIsoModels(ModelFactory.createDefaultModel(), A);
  }
View Full Code Here


  {
    Assert.assertEquals("no statements should match st",
        AbstractTestReifiedStatements.noStatements,
        getSetRS(model, SPO));
    /* */
    final ReifiedStatement rs = model.createReifiedStatement(
        AbstractTestReifiedStatements.aURI, SPO);
    final ReifiedStatement rs2 = model.createReifiedStatement(
        AbstractTestReifiedStatements.anotherURI, SPO2);
    model.add(rs, P, O);
    // assertEquals( "still no matching statement", empty, getSetRS( m,
    // stOther ) );
    /* */
 
View Full Code Here

   */
  public void testListReifiedStatements()
  {
    Assert.assertEquals("initially: no reified statements",
        AbstractTestReifiedStatements.noStatements, getSetRS(model));
    final ReifiedStatement rs = model.createReifiedStatement(
        AbstractTestReifiedStatements.aURI, SPO);
    // assertEquals( "still: no reified statements", empty, getSetRS( m ) );
    /* */
    model.add(rs, P, O);
    final Set<ReifiedStatement> justRS = arrayToSet(new ReifiedStatement[] { rs });
    Assert.assertEquals("post-add: one reified statement", justRS,
        getSetRS(model));
    model.add(S, P, rs);
    Assert.assertEquals("post-add: still one reified statement", justRS,
        getSetRS(model));
    /* */
    final ReifiedStatement rs2 = model.createReifiedStatement(
        AbstractTestReifiedStatements.anotherURI, SPO2);
    final Set<ReifiedStatement> bothRS = arrayToSet(new ReifiedStatement[] {
        rs, rs2 });
    model.add(rs2, P, O);
    Assert.assertEquals("post-add: still one reified statement", bothRS,
View Full Code Here

  public void testRR()
  {
    final Statement st = SPO;
    final Model m = model;
    final ReifiedStatement rs1 = m.createReifiedStatement(
        AbstractTestReifiedStatements.aURI, st);
    final ReifiedStatement rs2 = m.createReifiedStatement(
        AbstractTestReifiedStatements.anotherURI, st);
    m.removeReification(rs1);
    testNotReifying(m, AbstractTestReifiedStatements.aURI);
    Assert.assertTrue("st is still reified", st.isReified());
    m.removeReification(rs2);
View Full Code Here

    final Statement st = SPO;
    final Model m = model;
    Assert.assertEquals("it's not there yet",
        AbstractTestReifiedStatements.noStatements,
        GraphTestBase.iteratorToSet(st.listReifiedStatements()));
    final ReifiedStatement rs = m.createReifiedStatement(
        AbstractTestReifiedStatements.aURI, st);
    final Set<ReifiedStatement> justRS = arrayToSet(new ReifiedStatement[] { rs });
    m.add(rs, P, O);
    Assert.assertEquals("it's here now", justRS,
        GraphTestBase.iteratorToSet(st.listReifiedStatements()));
View Full Code Here

  @Override
  @Before
  public void setup()
  {
    super.setup();
    final ReifiedStatement stmt = baseModel.listStatements().next()
        .createReifiedStatement();
    setSecuredRDFNode(
        SecuredReifiedStatementImpl.getInstance(securedModel, stmt),
        stmt);
  }
View Full Code Here

    RSIterator stmtIter = model.listReifiedStatements();
    Collection removingStmt = new ArrayList();
    int i = 0;
    while (stmtIter.hasNext()) {
      ReifiedStatement current = stmtIter.nextRS();
      StmtIterator properties = current.listProperties();
      if (containsNonRS(properties)) {
        continue;
      }
      if (model.contains(null, null, current)) {
        continue;
View Full Code Here

    return removingStmt;
  }

   
  protected void treatStatement(Object s) {
    ReifiedStatement current = (ReifiedStatement) s;
    model.removeReification(current);
    //current.removeProperties();
  }
View Full Code Here

    List removingStatements = new ArrayList();
    STATEMENT: while (stmtIter.hasNext()) {
      Statement currentStmt = stmtIter.nextStatement();
      RSIterator rsIter = currentStmt.listReifiedStatements();
      while (rsIter.hasNext()) {
        ReifiedStatement currentRS = rsIter.nextRS();
        if (currentRS.hasProperty(RDF.type, RWCF.Temporary)) {
          continue STATEMENT;
        }
      }
      if (currentStmt.getSubject().hasProperty(RDF.type, RWCF.Temporary)) {
        continue STATEMENT;
View Full Code Here

    StmtIterator stmtIter = model.listStatements();
    STATEMENT: while (stmtIter.hasNext()) {
      Statement currentStmt = stmtIter.nextStatement();
      RSIterator rsIter =currentStmt.listReifiedStatements();
      while (rsIter.hasNext()) {
        ReifiedStatement currentRS = rsIter.nextRS();
        if (currentRS.hasProperty(RDF.type, RWCF.Temporary)) {
          continue STATEMENT;
        }   
      }
      if (currentStmt.getSubject().hasProperty(RDF.type, RWCF.Temporary)) {
        continue STATEMENT;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.ReifiedStatement

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.