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

Examples of com.hp.hpl.jena.rdf.model.Model.createStatement()


    m_Statements = new Statement[] {
        model.createStatement( m_Names[0], m_Predicates[0], m_BNodes[0] ),
        model.createStatement( m_Names[0], m_Predicates[0], m_Names[1] ),
        model.createStatement( m_Names[0], m_Predicates[0], m_Literals[0] ),
        model.createStatement( m_Names[1], m_Predicates[1], m_Names[0] ),
        model.createStatement( m_Names[1], m_Predicates[1], m_BNodes[1] ),
        model.createStatement( m_Names[2], m_Predicates[2], m_Names[3] ),
        model.createStatement( m_Names[2], m_Predicates[3], m_Names[0] ) };
    for( int i = 0; i < m_Statements.length; i++ ) {
      m_Model.addStatement( m_Statements[i] );
    }
View Full Code Here


        model.createStatement( m_Names[0], m_Predicates[0], m_BNodes[0] ),
        model.createStatement( m_Names[0], m_Predicates[0], m_Names[1] ),
        model.createStatement( m_Names[0], m_Predicates[0], m_Literals[0] ),
        model.createStatement( m_Names[1], m_Predicates[1], m_Names[0] ),
        model.createStatement( m_Names[1], m_Predicates[1], m_BNodes[1] ),
        model.createStatement( m_Names[2], m_Predicates[2], m_Names[3] ),
        model.createStatement( m_Names[2], m_Predicates[3], m_Names[0] ) };
    for( int i = 0; i < m_Statements.length; i++ ) {
      m_Model.addStatement( m_Statements[i] );
    }
View Full Code Here

        model.createStatement( m_Names[0], m_Predicates[0], m_Names[1] ),
        model.createStatement( m_Names[0], m_Predicates[0], m_Literals[0] ),
        model.createStatement( m_Names[1], m_Predicates[1], m_Names[0] ),
        model.createStatement( m_Names[1], m_Predicates[1], m_BNodes[1] ),
        model.createStatement( m_Names[2], m_Predicates[2], m_Names[3] ),
        model.createStatement( m_Names[2], m_Predicates[3], m_Names[0] ) };
    for( int i = 0; i < m_Statements.length; i++ ) {
      m_Model.addStatement( m_Statements[i] );
    }

    m_Comments = new String[] { "comment1" };
View Full Code Here

  public void testAddWithBNodes() {
    Model model = ModelFactory.createDefaultModel();
    Resource newBNode = ResourceFactory.createResource( AnonId.create().getLabelString() );
    int oldSize = m_Model.getStatements().size();
   
    List<Statement> statements = Arrays.asList( model.createStatement( (Resource)m_BNodes[0],
        m_Predicates[0], m_BNodes[1] ), model.createStatement( newBNode, m_Predicates[0],
        m_BNodes[0] ), model.createStatement( (Resource)m_BNodes[0], m_Predicates[0], newBNode ) );
    m_Model.addAllStatementsWithExistingBNodesOnly( statements );
   
    assertEquals( oldSize + 3, m_Model.getStatements().size() );
View Full Code Here

    Model model = ModelFactory.createDefaultModel();
    Resource newBNode = ResourceFactory.createResource( AnonId.create().getLabelString() );
    int oldSize = m_Model.getStatements().size();
   
    List<Statement> statements = Arrays.asList( model.createStatement( (Resource)m_BNodes[0],
        m_Predicates[0], m_BNodes[1] ), model.createStatement( newBNode, m_Predicates[0],
        m_BNodes[0] ), model.createStatement( (Resource)m_BNodes[0], m_Predicates[0], newBNode ) );
    m_Model.addAllStatementsWithExistingBNodesOnly( statements );
   
    assertEquals( oldSize + 3, m_Model.getStatements().size() );
    // assertEquals( newBNode, m_Model.getUniqueObject(
View Full Code Here

    Resource newBNode = ResourceFactory.createResource( AnonId.create().getLabelString() );
    int oldSize = m_Model.getStatements().size();
   
    List<Statement> statements = Arrays.asList( model.createStatement( (Resource)m_BNodes[0],
        m_Predicates[0], m_BNodes[1] ), model.createStatement( newBNode, m_Predicates[0],
        m_BNodes[0] ), model.createStatement( (Resource)m_BNodes[0], m_Predicates[0], newBNode ) );
    m_Model.addAllStatementsWithExistingBNodesOnly( statements );
   
    assertEquals( oldSize + 3, m_Model.getStatements().size() );
    // assertEquals( newBNode, m_Model.getUniqueObject(
    // (Resource)m_BNodes[0], m_Predicates[0] ) );
View Full Code Here

    }

    Model model = ((JenaSimalRepository) getRepository()).getModel();
    Property o = Doap.CATEGORY;
    com.hp.hpl.jena.rdf.model.Resource r = model.createResource(uri);
    Statement s = model.createStatement(r, RDF.type, o);
    model.add(s);

    IDoapCategory cat = new Category(r);
    cat.setSimalID(getNewID());
    return cat;
View Full Code Here

      throw new DuplicateURIException(
          "Attempt to create a second homepage with the URI " + uri);
    }

    com.hp.hpl.jena.rdf.model.Resource r = model.createResource(uri);
    Statement s = model.createStatement(r, RDF.type, FOAF.Document);
    model.add(s);

    IDocument page = new Document(r);
    return page;
  }
View Full Code Here

   
    public boolean containsProject(String uri) {
      Model model = getModel();
        Property o = model.createProperty("http://usefulinc.com/ns/doap#Project");
        com.hp.hpl.jena.rdf.model.Resource r = model.createResource(uri);
        Statement doap = model.createStatement(r, RDF.type, o);

        o = model.createProperty(RDFUtils.SIMAL_PROJECT);
        Statement simal = model.createStatement(r, RDF.type, o);
        return model.contains(doap) || model.contains(simal);
      }
View Full Code Here

        Property o = model.createProperty("http://usefulinc.com/ns/doap#Project");
        com.hp.hpl.jena.rdf.model.Resource r = model.createResource(uri);
        Statement doap = model.createStatement(r, RDF.type, o);

        o = model.createProperty(RDFUtils.SIMAL_PROJECT);
        Statement simal = model.createStatement(r, RDF.type, o);
        return model.contains(doap) || model.contains(simal);
      }


    public IProject findProjectBySeeAlso(String seeAlso)
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.