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

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


              System.out.println("    hasReputationModel impossible:"+statement.getObject());             
            } else if(statement.getObject().isResource()) {
              System.out.println("    hasReputationModel resource:"
                  +statement.getObject());
              Resource repResource = statement.getObject().asResource();                 
              StmtIterator stmtI2 = model.listStatements(repResource,
                   (Property)null, (RDFNode)null);
               while(stmtI2.hasNext()) {
                Statement statement2 = stmtI2.nextStatement();
                if(reputationModule.getURI().equalsIgnoreCase(
                    statement2.getPredicate().getURI())) {
View Full Code Here


                if(reputationModule.getURI().equalsIgnoreCase(
                    statement2.getPredicate().getURI())) {
                  System.out.println("      "+reputationModule.getURI()+" property "
                      +statement2.getObject());
                  Resource modResource = statement2.getObject().asResource();                 
                  StmtIterator stmtI3 = model.listStatements(modResource,
                       (Property)null, (RDFNode)null);
                  while(stmtI3.hasNext()) {
                    Statement statement3 = stmtI3.nextStatement();
                    if(statement3.getObject().isLiteral()) {
                      System.out.println("         "+statement3.getPredicate().getLocalName()
View Full Code Here

                          +":"+statement3.getObject());             
                    } else if(statement3.getObject().isResource()) {
                      System.out.println("         "+statement3.getPredicate().getLocalName()
                          +" resource:"+statement3.getObject());
                      Resource anyResource = statement3.getObject().asResource();                 
                      StmtIterator stmtI4 = model.listStatements(anyResource,
                           (Property)null, (RDFNode)null);
                      if(mapsMetric.getURI().equalsIgnoreCase(
                          statement3.getPredicate().getURI())) {
                       
                      } else if(importsFrom.getURI().equalsIgnoreCase(
View Full Code Here

                                  +statement4.getObject());             
                            } else if(statement4.getObject().isResource()) {
                              System.out.println("                importedCommunity resource:"
                                  +statement4.getObject());
                              Resource impResource = statement4.getObject().asResource();                 
                              StmtIterator stmtI5 = model.listStatements(impResource,
                                   (Property)null, (RDFNode)null);
                               while(stmtI5.hasNext()) {
                                Statement statement5 = stmtI5.nextStatement();
                                System.out.println("                      "
                                    +statement5.getPredicate().getLocalName()
View Full Code Here

                                  +statement4.getObject());             
                            } else if(statement4.getObject().isResource()) {
                              System.out.println("                importedMetric resource:"
                                  +statement4.getObject());
                              Resource impResource = statement4.getObject().asResource();                 
                              StmtIterator stmtI5 = model.listStatements(impResource,
                                   (Property)null, (RDFNode)null);
                               while(stmtI5.hasNext()) {
                                Statement statement5 = stmtI5.nextStatement();
                                System.out.println("                      "
                                    +statement5.getPredicate().getLocalName()
View Full Code Here

                                  +statement4.getObject());             
                            } else if(statement4.getObject().isResource()) {
                              System.out.println("                collectsReputationBy resource:"
                                  +statement4.getObject());
                              Resource colResource = statement4.getObject().asResource();                 
                              StmtIterator stmtI5 = model.listStatements(colResource,
                                   (Property)null, (RDFNode)null);
                               while(stmtI5.hasNext()) {
                                Statement statement5 = stmtI5.nextStatement();
                                System.out.println("                      "
                                    +statement5.getPredicate().getLocalName()
View Full Code Here

                                  +statement4.getObject());             
                            } else if(statement4.getObject().isResource()) {
                              System.out.println("                metricTransformation resource:"
                                  +statement4.getObject());
                              Resource metResource = statement4.getObject().asResource();                 
                              StmtIterator stmtI5 = model.listStatements(metResource,
                                   (Property)null, (RDFNode)null);
                               while(stmtI5.hasNext()) {
                                Statement statement5 = stmtI5.nextStatement();
                                System.out.println("                      "
                                    +statement5.getPredicate().getLocalName()
View Full Code Here

                                  +statement4.getObject());             
                            } else if(statement4.getObject().isResource()) {
                              System.out.println("                trust resource:"
                                  +statement4.getObject());
                              Resource truResource = statement4.getObject().asResource();                 
                              StmtIterator stmtI5 = model.listStatements(truResource,
                                   (Property)null, (RDFNode)null);
                               while(stmtI5.hasNext()) {
                                Statement statement5 = stmtI5.nextStatement();
                                System.out.println("                      "
                                    +statement5.getPredicate().getLocalName()
View Full Code Here

        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

        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

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.