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

Examples of com.hp.hpl.jena.rdf.model.StmtIterator.nextStatement()


    ResIterator subjects = config.listSubjectsWithProperty( EYE.nsURI, config.createLiteral( uri ) );
    if ( subjects.hasNext() )
      {
      StmtIterator prefixes = config.listStatements( subjects.nextResource(), EYE.prefix, (RDFNode)null );
      if ( prefixes.hasNext() )
        return prefixes.nextStatement().getObject().asNode().getLiteralLexicalForm();
      }
    return null; // Return null otherwise
    }

  private String getConfigsUriFromPrefix ( String pre )
View Full Code Here


    ResIterator subjects = config.listSubjectsWithProperty( EYE.prefix, config.createLiteral( pre ) );
    if ( subjects.hasNext() )
      {
      StmtIterator uris = config.listStatements( subjects.nextResource(), EYE.nsURI, (RDFNode)null );
      if ( uris.hasNext() )
        return uris.nextStatement().getObject().asNode().getLiteralLexicalForm();
      }
    return null; // Return null otherwise
    }
 
  private void changeNsUri( String from, String to )
View Full Code Here

    Model toDel = ModelFactory.createDefaultModel();
    Resource newUri = output.createResource( to );
    StmtIterator it = output.listStatements( output.createResource( from ), null, (RDFNode)null );
    while ( it.hasNext() )
      {
      Statement curr = it.nextStatement();
      toDel.add( curr );
      toAdd.add( newUri, curr.getPredicate(), curr.getObject() );
      }
   
    it = output.listStatements( null, null, output.createResource( from ) );
View Full Code Here

      }
   
    it = output.listStatements( null, null, output.createResource( from ) );
    while ( it.hasNext() )
      {
      Statement curr = it.nextStatement();
      toDel.add( curr );
      toAdd.add( curr.getSubject(), curr.getPredicate(), newUri );
      }
   
    output.remove( toDel );
View Full Code Here

          Model toAdd = ModelFactory.createDefaultModel();
          String replacement = it2.nextNode().asNode().getLiteralLexicalForm();
         
          while( it3.hasNext() )
            {
            Statement torem = it3.nextStatement();
            toDel.add( torem );
            toAdd.add( torem.getSubject(), toAdd.createProperty( replacement ), torem.getObject() );
            }
         
          input.remove( toDel );
View Full Code Here

  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);
    }
    this.weightTable.put(DEFAULT_URI,DEFAULT_VALUE);
  }
View Full Code Here

    Property identifier = ResourceFactory.createProperty(
        riNamespace + "identifier");
    StmtIterator stmtI1 = model.listStatements(resource,
        identifier, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate identifier property //
      if(!statement.getObject().isLiteral()) {         
        if(!ModelException.throwException(ModelException.COMMUNITY,
            "identifier property of Community resource:"+
            resource.getURI()+" is not a literal")) {
View Full Code Here

    Property foafAccountName = ResourceFactory.createProperty(
        foafNamespace + "accountName");
    StmtIterator stmtI1 = model.listStatements(resource,
        foafAccountName, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate name property //
      if(!statement.getObject().isLiteral()) {         
        if(!ModelException.throwException(ModelException.ONLINEACCOUNT,
            "name property of OnlineAccount resource:"+
            resource.getURI()+" is not a literal")) {
View Full Code Here

    Property foafAccountProfilePage = ResourceFactory.createProperty(
        foafNamespace + "accountProfilePage");
    stmtI1 = model.listStatements(resource,
        foafAccountProfilePage, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate name property //
      if(!statement.getObject().isLiteral()) {         
        if(!ModelException.throwException(ModelException.ONLINEACCOUNT,
            "name property of OnlineAccount resource:"+
            resource.getURI()+" is not a literal")) {
View Full Code Here

    Property belongsTo = ResourceFactory.createProperty(
        riNamespace + "belongsTo");   
    stmtI1 = model.listStatements(resource,
        belongsTo, (RDFNode)null);
    while(stmtI1.hasNext()) {
      Statement statement = stmtI1.nextStatement();
      // validate belongsTo property //
      if(!statement.getObject().isResource()) {         
        if(!ModelException.throwException(ModelException.ONLINEACCOUNT,
            "belongsTo property of resource:"+
            resource.getURI()+" is not a resource")) {
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.