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

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


        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

     
      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

    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

              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

            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

                    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

                        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

    } else {
        System.out.println("No subject with RDF.type were found in the database");
    }
   
    Resource resourceOnlineAccount = ResourceFactory.createResource(foafNamespace+ "OnlineAccount" )
    StmtIterator stmtI = model.listStatements(null, RDF.type, resourceOnlineAccount);
    if (stmtI.hasNext()) {
      System.out.println("The database contains RDF.type OnlineAccount for:");
      while(stmtI.hasNext()) {
          Statement statement = stmtI.nextStatement();
          System.out.println("  "+statement.getSubject()+" - "+statement.getPredicate()+
View Full Code Here

              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();
              if (statement.getPredicate().toString().equals("http://xmlns.com/foaf/0.1/name")){
                userName = statement.getObject().toString();
              }
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.