Package org.ontoware.rdf2go.model.node

Examples of org.ontoware.rdf2go.model.node.BlankNode


  }
 
  @Test
  public void testDeleteWithBlankNodes() {
    this.modelset.removeAll();
    BlankNode blankNode = this.modelset.createBlankNode();
    assertFalse(this.modelset.containsStatements(a, blankNode, RDF.type, RDF.Statement));
    this.modelset.addStatement(a, blankNode, RDF.type, RDF.Statement);
    assertTrue(this.modelset.containsStatements(a, blankNode, RDF.type, RDF.Statement));
    this.modelset.removeStatement(a, blankNode, RDF.type, RDF.Statement);
    assertFalse(this.modelset.containsStatements(a, blankNode, RDF.type, RDF.Statement));
View Full Code Here


    assertFalse(this.modelset.containsStatements(a, Variable.ANY, RDF.predicate, predicate));
    assertFalse(this.modelset.containsStatements(a, Variable.ANY, RDF.object, object));
    assertFalse(this.modelset.containsStatements(a, Variable.ANY, RDF.type, RDF.Statement));
   
    Statement stmt = this.modelset.createStatement(a, subject, predicate, object);
    BlankNode blankNode = this.modelset.addReificationOf(stmt);
    assertTrue(this.modelset.containsStatements(a, blankNode, RDF.subject, subject));
    assertTrue(this.modelset.containsStatements(a, blankNode, RDF.predicate, predicate));
    assertTrue(this.modelset.containsStatements(a, blankNode, RDF.object, object));
    assertTrue(this.modelset.containsStatements(a, blankNode, RDF.type, RDF.Statement));
   
View Full Code Here

  }
 
  @Test
  public void testGetAllReificationsOf() {
    Statement s = this.modelset.createStatement(a, b, c);
    BlankNode reificationBlankNode = this.modelset.addReificationOf(s);
   
    Collection<Resource> reifications = this.modelset.getAllReificationsOf(s);
    assertTrue(reifications.contains(reificationBlankNode));
    assertEquals(1, reifications.size());
  }
View Full Code Here

   
  }
 
  private static BlankNode transform(BlankNode source, Map<String,BlankNode> map, Model target) {
    String bnodeSourceId = source.getInternalID();
    BlankNode bnodeTarget = map.get(bnodeSourceId);
    if(bnodeTarget == null) {
      bnodeTarget = target.createBlankNode();
      map.put(bnodeSourceId, bnodeTarget);
    }
    return bnodeTarget;
View Full Code Here

        }
      }

      try {
        if (eval == null) {
          BlankNode bnodeEval = model.createBlankNode();
          model.addStatement(null,bnodeEval, RDF.type, model.createURI(S3B_SSCF.Evaluation));
          model.addStatement(null,bnodeEval, model.createURI(SIOC.postedBy),person.getResource());
          model.addStatement(null,bnodeEval, model.createURI(S3B_SSCF.value),model.createDatatypeLiteral(value.toString(),XSD._string));
          model.addStatement(null,this.resource,model.createURI(S3B_SSCF.isEvaluatedWith),bnodeEval);
        } else {
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.BlankNode

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.