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

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()


    }
    NodeIterator objects = model.listObjects();
    while (objects.hasNext() && result.size() < DataSource.MAX_INDEX_SIZE) {
      RDFNode o = objects.next();
      if (!o.isURIResource()) continue;
      result.add(o.asResource());
    }
    return result;
  }
}
View Full Code Here


      }
      Property p = result.createProperty(
          rewrite(stmt.getPredicate().getURI()));
      RDFNode o = stmt.getObject();
      if (o.isURIResource()) {
        o = result.createResource(rewrite(o.asResource().getURI()));
      }
      result.add(s, p, o);
    }
    return result;
  }
View Full Code Here

      Set<RDFNode> nodes = new HashSet<RDFNode>();
      StmtIterator it = r.listProperties(OWL.inverseOf);
      while (it.hasNext()) {
        RDFNode object = it.next().getObject();
        if (!object.isResource()) continue;
        StmtIterator it2 = object.asResource().listProperties(property);
        while (it2.hasNext()) {
          nodes.add(it2.next().getObject());
        }
      }
      return nodes;
View Full Code Here

            System.out.println("  " + resourceName+" class:"+resource.getClass());
            NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
            while(nodes.hasNext()) {
              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();
View Full Code Here

                  Resource onlineAccount = statement.getObject().asResource();                 
                  NodeIterator nodess = model.listObjectsOfProperty(onlineAccount, RDF.type);
                  while(nodess.hasNext()) {
                    RDFNode node = nodess.nextNode();
                    if(node.isResource()) {
                      System.out.println("      type " + node.asResource().getURI());
                    }
                  }
                  for(Property property2 : propertyAccountName) {
                    StmtIterator stmtI2 = model.listStatements(onlineAccount,
                        property2, (RDFNode)null);
View Full Code Here

          while(nodes.hasNext()) {
            RDFNode node = nodes.nextNode();
            if(node.isLiteral()) {
              System.out.println("   l " + node.asLiteral().getString());
            } else if(node.isResource()) {
              System.out.println("   r " + node.asResource().getURI());
            }
          }         
        }
    } else {
        System.out.println("No subject with RDF.type were found in the database");
View Full Code Here

                    System.out.println("  " + resourceName+" class:"+resource.getClass());
                    NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
                    while(nodes.hasNext()) {
                        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();
View Full Code Here

                                Resource onlineAccount = statement.getObject().asResource();                                                   
                                NodeIterator nodess = model.listObjectsOfProperty(onlineAccount, RDF.type);
                                while(nodess.hasNext()) {
                                    RDFNode node = nodess.nextNode();
                                    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();
View Full Code Here

            System.out.println("  " + resourceName+" class:"+resource.getClass());
            NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
            while(nodes.hasNext()) {
              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();
View Full Code Here

                  NodeIterator nodess = model.listObjectsOfProperty(
                      onlineAccount, RDF.type);
                  while(nodess.hasNext()) {
                    RDFNode node = nodess.nextNode();
                    if(node.isResource()) {
                      System.out.println("      type " + node.asResource().getURI());
                    }
                  }
                  for(Property property2 : propertyAccountName) {
                    StmtIterator stmtI2 = model.listStatements(onlineAccount,
                        property2, (RDFNode)null);
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.