Examples of listStatements()


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

        QueryExecution qExec = QueryExecutionFactory.create(query, DatasetFactory.create(dsg)) ;
        try {
            qExec.setTimeout(abortTime);
            Model model = qExec.execDescribe();
            //ResultSet rs = qExec.execSelect() ;
            for(Iterator<Statement> stmIterator = model.listStatements(); stmIterator.hasNext();) {
                stmIterator.next();
                counter++;
            }
            return counter ;
        } finally { qExec.close() ; }
View Full Code Here

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

      String propertyUrl = line[0];
      String label = line[1];
      builder.append(label);
      builder.append(": ");
     
      StmtIterator iter = model.listStatements(null, model.getProperty(propertyUrl), (Resource)null);
     
      while (iter.hasNext()) {
        Statement stmt = iter.nextStatement();
        builder.append(stmt.getObject().asNode().getLiteralValue().toString());
      }
View Full Code Here

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

      boolean fixed = false;
     
      for ( int j = 0; j < namespaces.length; j++ )
        {
        Model currNS = ModelFactory.createDefaultModel().read( "file:" + nsBase + "/" + namespaces[j] );
        StmtIterator iter = currNS.listStatements( (Resource)null, RDF.type, (RDFNode)null );
        while( iter.hasNext() )
          {
          Resource thisSubj = iter.nextStatement().getSubject();
          if ( thisSubj.getLocalName() != null )
            if ( thisSubj.getLocalName().equals( curr.asNode().getLocalName() ) )
View Full Code Here

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

        int temp = getDepthOf( curr.getSubject() );
        if ( temp > greatestDepth )
          greatestDepth = temp;
        }
      }
    it = out.listStatements();
    Model torem = ModelFactory.createDefaultModel();
    while ( it.hasNext() )
      {
      Statement curr = it.nextStatement();
      if ( getDepthOf( curr.getSubject() ) < greatestDepth )
View Full Code Here

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

     
      boolean fixed = false;
      for ( int j = 0; j < namespaces.length; j++ )
        {
        Model currNS = ModelFactory.createDefaultModel().read( "file:" + nsBase + "/" + namespaces[j] );
        StmtIterator iter = currNS.listStatements( (Resource)null, RDF.type, (RDFNode)null );
        while( iter.hasNext() )
          {
          Resource thisSubj = iter.nextStatement().getSubject();
          if ( thisSubj.getLocalName() != null )
            if ( thisSubj.getLocalName().equals( curr.asNode().getLocalName() ) )
View Full Code Here

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

    this.cleanModel();
  }

  private  void loadRelationsWeight() {
    Model model = getRDFModel();
    StmtIterator itr = model.listStatements();

    while(itr.hasNext()) {
      Statement stmt = itr.nextStatement();
      Double weight = new Double(stmt.getObject().toString());
      weightTable.put(stmt.getSubject().getURI(), weight);
View Full Code Here

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

              RDFNode node = nodes.nextNode();
              if(node.isResource()) {
                System.out.println("   type " + node.asResource().getURI());
              }
            }
            StmtIterator stmtI = model.listStatements(resource, null, (RDFNode)null);
            while(stmtI.hasNext()) {
              Statement statement = stmtI.nextStatement();
              System.out.println("   triple "+statement.getPredicate()+" - "+statement.getObject());
            }
            for(Property property : propertyAccount) {
View Full Code Here

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

            while(stmtI.hasNext()) {
              Statement statement = stmtI.nextStatement();
              System.out.println("   triple "+statement.getPredicate()+" - "+statement.getObject());
            }
            for(Property property : propertyAccount) {
              StmtIterator stmtI1 = model.listStatements(resource, property, (RDFNode)null);
              while(stmtI1.hasNext()) {
                Statement statement = stmtI1.nextStatement();             
                System.out.println("   OnlineAccount "+statement.getObject());
                if(statement.getObject().isResource()) {
                  Resource onlineAccount = statement.getObject().asResource();                 
View Full Code Here

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

                    if(node.isResource()) {
                      System.out.println("      type " + node.asResource().getURI());
                    }
                  }
                  for(Property property2 : propertyAccountName) {
                    StmtIterator stmtI2 = model.listStatements(onlineAccount,
                        property2, (RDFNode)null);
                    Statement statement2 = stmtI2.nextStatement();
                    System.out.println("      AccountName "+statement2.getObject());
                  }
                  for(Property property2 : propertyAccountProfile) {
View Full Code Here

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

                        property2, (RDFNode)null);
                    Statement statement2 = stmtI2.nextStatement();
                    System.out.println("      AccountName "+statement2.getObject());
                  }
                  for(Property property2 : propertyAccountProfile) {
                    StmtIterator stmtI2 = model.listStatements(onlineAccount,
                        property2, (RDFNode)null);
                    Statement statement2 = stmtI2.nextStatement();
                    System.out.println("      AccountProfile "+statement2.getObject());
                  }
                }
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.