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

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()


      ResIterator i2 = ont.listSubjectsWithProperty(RDFS.subPropertyOf,r);
      // r should not be used in an existing restriction or subPropertyOf relation
      // ignore case where r is a subPropertyOf itself
      Resource s = null;
      while (i2.hasNext() && (s==null || s.equals(r)))
        s = i2.nextResource();
      if (!i1.hasNext() && (s==null || s.equals(r)))
        r.removeProperties();
    }
  }
 
View Full Code Here


    //out.printf("<th>Name</th>%n");
    out.printf("</tr>%n");

    ResIterator iter = model.listSubjects();
    while (iter.hasNext()) {
      Resource elem = iter.nextResource();
      String elemUri = elem.getURI();
      if ( elemUri != null ) {
        String elemUriSlash = elemUri.replace('#' , '/');
       
        // generate anchor for the term using "id" in the row:
View Full Code Here

             ontCount = new ArrayList<String>(),
             ontPrefixes = new ArrayList<String>(),
             ontPrefixCount = new ArrayList<String>(),
             ontPrefixMapping = new ArrayList<String>();
        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();
View Full Code Here

        fullMappingArr = new String[size];
        int i = 0;
       
        while ( wordIt.hasNext() )
          {
          Resource currWord = wordIt.nextResource();
          if ( currWord.isURIResource() )
            {
            fullwords += currWord.getURI() + '\n';
            loosewords += currWord.getLocalName() + '\n';
            looseMappingArr[i] = currWord.getLocalName();
View Full Code Here

    boolean didRepair = false;
   
    ResIterator it = repair.listSubjectsWithProperty( EYE.repairType, EYE.setDatatype );
    while ( it.hasNext() )
      {
      Resource curr = it.nextResource();
        String literal = repair.listObjectsOfProperty( curr, EYE.onLiteral ).nextNode().asNode().getLiteralLexicalForm();

        Resource b = output.createResource( repair.listObjectsOfProperty( curr, EYE.onStatement ).nextNode().asNode().getBlankNodeId() );
        Resource subject = output.createResource( repair.listObjectsOfProperty( b, RDF.subject ).nextNode().asNode().getURI() );
        Property predicate = output.createProperty( repair.listObjectsOfProperty( b, RDF.predicate ).nextNode().asNode().getURI() );
View Full Code Here

      }
   
    it = repair.listSubjectsWithProperty( EYE.repairType, EYE.setLanguage );
    while ( it.hasNext() )
      {
      Resource curr = it.nextResource();
        String literal = repair.listObjectsOfProperty( curr, EYE.onLiteral ).nextNode().asNode().getLiteralLexicalForm();

        Resource b = output.createResource( repair.listObjectsOfProperty( curr, EYE.onStatement ).nextNode().asNode().getBlankNodeId() );
        Resource subject = output.createResource( repair.listObjectsOfProperty( b, RDF.subject ).nextNode().asNode().getURI() );
        Property predicate = output.createProperty( repair.listObjectsOfProperty( b, RDF.predicate ).nextNode().asNode().getURI() );
View Full Code Here

    this.repair = r.model();
   
    ResIterator it1 = repair.listSubjectsWithProperty( EYE.cardinalityFailure );
    while( it1.hasNext() )
      {
      Resource curr = it1.nextResource();
      RDFNode type = repair.listObjectsOfProperty( curr, EYE.onType ).nextNode();
      RDFNode prop = repair.listObjectsOfProperty( curr, EYE.onProperty ).nextNode();
      RDFNode b = repair.listObjectsOfProperty( curr, EYE.cardinality ).nextNode();
      RDFNode maxCardR = null;
      RDFNode minCardR = null;
View Full Code Here

    this.repair = r.model();
   
    ResIterator it1 = repair.listSubjectsWithProperty( EYE.badDatatypeURI );
    while( it1.hasNext() )
      {
      Resource curr = it1.nextResource();
        String datatype = findDatatype( repair.listObjectsOfProperty( curr, EYE.onLiteral ).nextNode().asNode().getLiteralLexicalForm() );
        if ( datatype == null )
          { // Find the default action defined in config
          RDFNode defaultFix = config.listObjectsOfProperty( EYE.repairConfig, EYE.defaultLiteralFix ).nextNode();
          if ( defaultFix.equals( EYE.defaultLanguage ) )
View Full Code Here

    this.output = this.input;   
               
    ResIterator it = repair.listSubjectsWithProperty( EYE.repairType, EYE.defineClass );
    while ( it.hasNext() )
      {
      Resource curr = it.nextResource();
            if ( !curr.hasProperty( EYE.noConsistentTypeFor ) )
                {
                Resource bn = repair.createResource( repair.listObjectsOfProperty( curr, EYE.statementAdded ).nextNode().asNode().getBlankNodeId() );
                Resource subj = output.createResource( repair.listObjectsOfProperty( bn, RDF.subject ).nextNode().asNode().getURI() );
                Property pred = output.createProperty( repair.listObjectsOfProperty( bn, RDF.predicate ).nextNode().asNode().getURI() );
View Full Code Here

  this.repair = r.model();
 
  ResIterator it1 = repair.listSubjectsWithProperty( EYE.badNamespaceURI );
  while( it1.hasNext() )
    {
    Resource curr = it1.nextResource();
    repair.add( curr, EYE.repairConfidence, EYE.low )
          .add( curr, EYE.repairType, EYE.replaceNamespace )
          .add( curr, EYE.checkFix, EYE.namespacePrefix );
    }
 
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.