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

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


      }     

      // add (sequenced) sub-elements
      NodeIterator ni = ctx.getModel().getSeq(r).iterator();
      while (ni.hasNext()) {
        Statement stmt = element.asStatement((Resource) ni.nextNode());
        if (stmt.getPredicate().equals(RDF.value)) {
          // add literal value
          RDFNode value = stmt.getObject();
          if (value.isLiteral())
            elem.appendChild(doc.createTextNode(value.toString()))
View Full Code Here


      // don't add ordinals
      if (stmt.getPredicate().getOrdinal()==0) s.add(stmt);
    }
    NodeIterator ni = rdf.getModel().getSeq(rdf).iterator();
    while (ni.hasNext()) {
      Statement stmt = asStatement((Resource) ni.nextNode());
      if (s.contains(stmt)) s.remove(stmt);
    }
    return s;
  }
View Full Code Here

        while ( it.hasNext() ) {
            Resource curr = it.nextResource();
            totalModelTriples += Double.parseDouble( curr.getProperty( EYE.modelSize ).getLiteral().getLexicalForm() );
            NodeIterator it2 = stats.listObjectsOfProperty( curr, EYE.usedOntology );
            while ( it2.hasNext() ) {
                Resource bn = stats.createResource( it2.nextNode().asNode().getBlankNodeId() );
                String ont = bn.getProperty( EYE.ontURI ).getObject().asNode().getURI();
                String prefix = bn.getProperty( EYE.prefix ).getLiteral().getLexicalForm();
                inc( onts, ontCount, ont );
                if ( !ontPrefixes.contains( prefix ) )
                    ontPrefixMapping.add( ont );
View Full Code Here

  Resource classType = ((OntModel)input).getProfile().CLASS();
 
  NodeIterator it = repair.listObjectsOfProperty( EYE.unknownClass );
  while( it.hasNext() )
    {
    RDFNode curr = it.nextNode();
    Resource subject = repair.listSubjectsWithProperty( EYE.unknownClass, curr ).nextResource();
      Resource stmtBnode = repair.createResource();
    repair.add( subject, EYE.repairConfidence, EYE.moderate )
          .add( subject, EYE.repairType, EYE.defineClass )
          .add( subject, EYE.checkFix, RDF.Statement )
View Full Code Here

      int numVals = strToInt( numValsR.asNode().getLiteralLexicalForm() );
     
      NodeIterator it1b = m.listObjectsOfProperty( m.createResource( type.asNode().getURI() ), RDFS.subClassOf );
      while (it1b.hasNext() )
        {
        b = it1b.nextNode();
          try
            {
            if ( b.isAnon() )
              {
              if ( m.listObjectsOfProperty( m.createResource( b.asNode().getBlankNodeId() ), OWL.onProperty ).nextNode().equals( prop ) )
View Full Code Here

        NodeIterator it1c = repair.listObjectsOfProperty( repair.createResource( repair.listObjectsOfProperty( curr, EYE.values ).nextNode().asNode().getBlankNodeId() ), RDFS.member);
        String defaultURI = "http://www.w3.org/2001/XMLSchema#String"; // This will be used later too (config file it??)
       
        while ( it1c.hasNext() )
          {
          RDFNode member = it1c.nextNode();
          String uri = member.asNode().getLiteralDatatypeURI();
          if ( uri == null )
            uri = defaultURI; // Default datatype URI
          if ( types.contains( uri ) )
            {
View Full Code Here

        if ( fix.equals( EYE.removeType ) )
          {
          NodeIterator it2 = repair.listObjectsOfProperty( curr, EYE.statementRemoved );
          while ( it2.hasNext() )
            {
            Resource bn = repair.createResource( it2.nextNode().asNode().getBlankNodeId() );
            Resource subj = (Resource)repair.listObjectsOfProperty( bn, RDF.subject ).nextNode();
            Property pred = input.createProperty( repair.listObjectsOfProperty( bn, RDF.predicate ).nextNode().asNode().getURI() );
            RDFNode obj = repair.listObjectsOfProperty( bn, RDF.object ).nextNode();
            output.remove( subj, pred, obj );
            }
View Full Code Here

          NodeIterator itb = ((OntModel)output).getBaseModel().listObjectsOfProperty( output.createResource( res.asNode().getURI() ), RDF.type );
          output.add( newClass, RDF.type, RDFS.Class );
          output.add( output.createResource( res.asNode().getURI() ), RDF.type, newClass );
          while ( itb.hasNext() )
            {
            RDFNode thisType = itb.nextNode();
            output.add( newClass, RDFS.subClassOf, thisType );
            output.remove( output.createStatement( output.createResource( res.asNode().getURI() ), RDF.type, thisType ) );
            }
          }
        }
View Full Code Here

    if ( x.equals( y ) )
      return true;
    else
      while ( it.hasNext() )
        {
        RDFNode curr = it.nextNode();
        if ( !curr.equals( x ) )
          if ( curr.isURIResource() )
            {
            if ( xSubClassOfY( input.createResource( curr.asNode().getURI() ), y ) )
              return true;
View Full Code Here

    {
    int greatestDepth = 1;
    NodeIterator it = input.listObjectsOfProperty( node, RDFS.subClassOf );
    while ( it.hasNext() )
      {
      RDFNode thisnode = it.nextNode();
      Resource curr = null;
      if ( thisnode.isURIResource() )
        curr = input.createResource( thisnode.asNode().getURI() );
      else
        curr = input.createResource( thisnode.asNode().getBlankNodeId() );
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.