Examples of listStatements()


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

        com.hp.hpl.jena.graph.Graph graph = new JenaGraph(mGraph);
        Model model = ModelFactory.createModelForGraph(graph);
        Literal typedLiteral = model.createTypedLiteral("<elem>foo</elem>", XMLLiteralType.theXMLLiteralType);
        model.add(RDFS.Class, RDFS.label, typedLiteral);
        Assert.assertEquals(1, mGraph.size());
        StmtIterator iter = model.listStatements(RDFS.Class, RDFS.label, (Resource)null);
        Assert.assertTrue(iter.hasNext());
        RDFNode gotObject = iter.nextStatement().getObject();
        Assert.assertEquals(typedLiteral, gotObject);
    }
   
View Full Code Here

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

        model.add(bnode, RDF.type, RDF.Statement);
        model.add(bnode, RDF.subject, RDFS.Resource);
        model.add(bnode, RDF.predicate, RDF.type);
        model.add(bnode, RDF.object, RDFS.Resource);
        model.add(bnode, RDFS.comment, "we knew that before");
        StmtIterator stmts = model.listStatements(RDFS.Resource, null, (RDFNode)null);
        Statement returnedStmt = stmts.nextStatement();
        RSIterator rsIterator = returnedStmt.listReifiedStatements();
        Assert.assertTrue("got back reified statement", rsIterator.hasNext());
        //recreating jena-graph
        graph = new JenaGraph(mGraph);
View Full Code Here

Examples of com.hp.hpl.jena.util.MonitorModel.listStatements()

        additions.clear();
        deletions.clear();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s4, s5});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {s1, s2});
        TestUtil.assertIteratorValues(this, monitor.listStatements(), new Object[] {s3, s4, s5});
       
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
    }
  
View Full Code Here

Examples of de.fuberlin.wiwiss.d2rq.jena.ModelD2RQ.listStatements()

  public static void main(String[] args) {
    // Set up the ModelD2RQ using a mapping file
    ModelD2RQ m = new ModelD2RQ("file:doc/example/mapping-iswc.ttl");
   
    // Find anything with an rdf:type of iswc:InProceedings
    StmtIterator paperIt = m.listStatements(null, RDF.type, ISWC.InProceedings);
   
    // List found papers and print their titles
    while (paperIt.hasNext()) {
      Resource paper = paperIt.nextStatement().getSubject();
      System.out.println("Paper: " + paper.getProperty(DC.title).getString());
View Full Code Here

Examples of ubiware.integration.soprano.TCPClientModel.listStatements()

      double durationinseconds = (endTime - startTime) / 1000.0;
      System.out.println("done adding "+ statementList.size()+ " statements in " +durationinseconds+ " seconds");
     
      startTime = System.currentTimeMillis();
      for (Statement statement : statementList){
        SopranoStatementIterator it = model.listStatements(statement);
        while (it.hasNext()){
          it.next();
        }
      }
      endTime = System.currentTimeMillis();
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.