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

Examples of com.hp.hpl.jena.rdf.model.NodeIterator.nextNode()


      subbiest = RDFS.Resource;
   
    NodeIterator it1 = repair.listObjectsOfProperty( EYE.hasNoType );
    while( it1.hasNext() )
      {
      RDFNode curr = it1.nextNode();
     
      Resource thisres = null;
     
      if ( curr.isURIResource() )
        thisres = repair.createResource( curr.asNode().getURI() );
View Full Code Here


      Statement currFailure = it.nextStatement();
      Resource subj = currFailure.getSubject();
      NodeIterator it2 = repair.listObjectsOfProperty( subj, EYE.repairType );
      while ( it2.hasNext() )
        {
        RDFNode curr = it2.nextNode();
        if ( curr.equals( EYE.decreaseNumProperties ) )
          {
          NodeIterator it3 = repair.listObjectsOfProperty( subj, EYE.statementRemoved );
          while ( it3.hasNext() )
            {
View Full Code Here

        if ( curr.equals( EYE.decreaseNumProperties ) )
          {
          NodeIterator it3 = repair.listObjectsOfProperty( subj, EYE.statementRemoved );
          while ( it3.hasNext() )
            {
            Resource remStat = (Resource)it3.nextNode();
            Resource remS = (Resource)repair.listObjectsOfProperty( remStat, RDF.subject ).nextNode();
            Property remP = output.createProperty( repair.listObjectsOfProperty( remStat, RDF.predicate ).nextNode().asNode().getURI() );
            RDFNode remO = repair.listObjectsOfProperty( remStat, RDF.object ).nextNode();
            output.remove( remS, remP, remO );
            }
View Full Code Here

    ArrayList<String> l = new ArrayList<String>();
    String popular = null;
    int popCount = 0;
    while ( it3.hasNext() )
      {
      String test = it3.nextNode().asNode().getURI();
      int testCount = typeCounts[ types.indexOf( test ) ];
      if ( testCount > popCount )
        {
        popCount = testCount;
        if ( popular != null )
View Full Code Here

    ResIterator it = repair.listSubjectsWithProperty( EYE.hasNoType );
    while ( it.hasNext() ) {
      NodeIterator it2 = repair.listObjectsOfProperty( it.nextResource(), EYE.statementAdded );
      while ( it2.hasNext() )
        {
        Resource bnode = repair.createResource( it2.nextNode().asNode().getBlankNodeId() );
       
        Resource subj =  (Resource)repair.listObjectsOfProperty( bnode, RDF.subject ).nextNode();
        Property pred = output.createProperty( repair.listObjectsOfProperty( bnode, RDF.predicate ).nextNode().asNode().getURI() );
        RDFNode obj = repair.listObjectsOfProperty( bnode, RDF.object ).nextNode();
       
View Full Code Here

        namespaces = children.clone();
   
    NodeIterator it = repair.listObjectsOfProperty( EYE.unknownPredicate );
    while ( it.hasNext() )
      {
      curr = it.nextNode();
     
      boolean fixed = false;
      for ( int j = 0; j < namespaces.length; j++ )
        {
        Model currNS = ModelFactory.createDefaultModel().read( "file:" + nsBase + "/" + namespaces[j] );
View Full Code Here

        if (it2.hasNext())
          {
          boolean oneKept = false;
          while ( it2.hasNext() )
            {
            RDFNode curra = it2.nextNode();
            if ( m.getNsPrefixURI( curra.asNode().getLiteralLexicalForm() ) != null )
              if ( m.getNsPrefixURI( curra.asNode().getLiteralLexicalForm() ).equals( uri ) )   // The prefix is still used in the model
                {
                if ( oneKept )
                  m.removeNsPrefix( curra.asNode().getLiteralLexicalForm() );
View Full Code Here

        {
      subject = it.nextStatement().getSubject();                
      curr = repair.listObjectsOfProperty( subject, EYE.onResource ).nextNode();
        NodeIterator it2 = repair.listObjectsOfProperty( subject, EYE.newValue );
        if ( it2.hasNext() )
          fixURI( it2.nextNode().asNode().getLiteralLexicalForm() );
        }                           
    }
 
    private void fixURI(String replacement)
      {
View Full Code Here

          {
          // Replace all instances of statement predicate curr in input with replacement
          StmtIterator it3 = input.listStatements((Resource)null, input.createProperty( repair.listObjectsOfProperty( curr, EYE.unknownPredicate ).nextNode().asNode().getURI() ), (RDFNode)null);
          Model toDel = ModelFactory.createDefaultModel();
          Model toAdd = ModelFactory.createDefaultModel();
          String replacement = it2.nextNode().asNode().getLiteralLexicalForm();
         
          while( it3.hasNext() )
            {
            Statement torem = it3.nextStatement();
            toDel.add( torem );
View Full Code Here

        NodeIterator it2 = repair.listObjectsOfProperty( curr, EYE.forReason );
        RDFNode uri = repair.listObjectsOfProperty( curr, EYE.badURI ).nextNode();
        String work = uri.asNode().getLiteralLexicalForm();
        while ( it2.hasNext() )
          {
          String fault = it2.nextNode().asNode().getURI();
          repair.add( curr, EYE.checkFix, RDF.subject );
          repair.remove( repair.listStatements( curr, EYE.newValue, work ) );
          if ( fault.contains( "unrecognisedScheme" ) )
              { String fixed = analyseUnrecognisedScheme( config, curr, work );
              }
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.