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

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


    if (n == 0)
    {
      try
      {
        // System.err.println( "| hello. mask = " + mask );
        final ReifiedStatement rs = R.as(ReifiedStatement.class);
        // System.err.println( "+  we constructed " + rs );

        if ((mask & 15) != 15)
        {
          m.write(System.out, "TTL");
View Full Code Here


    }
  }

  public void testConstructionByURI()
  {
    final ReifiedStatement rs = model.createReifiedStatement("spoo:handle",
        SPO);
    final ReifiedStatement rs2 = SPO.createReifiedStatement("spoo:gripper");
    Assert.assertEquals("recover statement (URI)", SPO, rs.getStatement());
    Assert.assertEquals("recover URI", "spoo:handle", rs.getURI());
    Assert.assertEquals("recover URI", "spoo:gripper", rs2.getURI());
  }
View Full Code Here

  public void testConversion()
  {
    final String uri = "spoo:handle";
    model.createReifiedStatement(uri, SPO);
    final ReifiedStatement rs2 = model.createResource(uri).as(
        ReifiedStatement.class);
    Assert.assertEquals("recover statement", SPO, rs2.getStatement());
  }
View Full Code Here

        ((ReifiedStatement) r).getStatement());
  }

  public void testIsReified()
  {
    final ReifiedStatement rs = model.createReifiedStatement(
        AbstractTestReifiedStatements.aURI, SPO);
    final Resource BS = model
        .createResource(AbstractTestReifiedStatements.anchor + "BS");
    final Property BP = model
        .createProperty(AbstractTestReifiedStatements.anchor + "BP");
View Full Code Here

   */
  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

    if (n == 0)
    {
      try
      {
        // System.err.println( "| hello. mask = " + mask );
        final ReifiedStatement rs = R.as(ReifiedStatement.class);
        // System.err.println( "+  we constructed " + rs );
        Assert.assertTrue(
            "should not reify: not all components present [" + mask
                + "]: " + rs, (mask & 15) == 15);
        // System.err.println( "+  and we passed the assertion." );
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.