Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.Individual


      }
   
      if (resource instanceof Individual) {
      //get all individuals same as this one
        for (Iterator i=resource.listSameAs(); i.hasNext();) {
          Individual individual = (Individual) i.next();
          //add labels
          for (Iterator j =individual.listLabels(null); j.hasNext();) {
            Literal l = (Literal) i.next();
            synonyms.put(l.toString(), "1");
          }
        }
      } else if (resource instanceof OntClass) {
View Full Code Here


        occurs.add( cls );
        renderHierarchy( out, sub, occurs, depth + 1 );
        occurs.remove( cls );
      }
      for (Iterator i=cls.listInstances(); i.hasNext(); ) {
        Individual individual = (Individual) i.next();
        renderURI(out, individual.getModel(), individual.getURI());
        out.print(" [");
        for (Iterator j=individual.listLabels(null); j.hasNext();) {
          out.print(((Literal)j.next()).getString()+", ");
        }
        out.print("] ");
        out.println();
      }
View Full Code Here

      //list instances
      for (Iterator i=cls.listInstances(); i.hasNext(); ) {
        //add search terms for each instance

        //list labels
        Individual individual = (Individual) i.next();
        for (Iterator j=individual.listLabels(null); j.hasNext();) {
          Literal l = (Literal) j.next();
          OntologyImpl.addSearchTerm(l.toString(), individual);
        }
      }
    }
View Full Code Here

      }
   
      if (resource instanceof Individual) {
      //get all individuals same as this one
        for (Iterator i=resource.listSameAs(); i.hasNext();) {
          Individual individual = (Individual) i.next();
          //add labels
          for (Iterator j =individual.listLabels(null); j.hasNext();) {
            Literal l = (Literal) i.next();
            synonyms.put(l.toString(), "1");
          }
        }
      } else if (resource instanceof OntClass) {
View Full Code Here

        occurs.add( cls );
        renderHierarchy( out, sub, occurs, depth + 1 );
        occurs.remove( cls );
      }
      for (Iterator i=cls.listInstances(); i.hasNext(); ) {
        Individual individual = (Individual) i.next();
        renderURI(out, individual.getModel(), individual.getURI());
        out.print(" [");
        for (Iterator j=individual.listLabels(null); j.hasNext();) {
          out.print(((Literal)j.next()).getString()+", ");
        }
        out.print("] ");
        out.println();
      }
View Full Code Here

  }

  private void createIndividual(List<String> row) throws Exception {
    // create individual
    Individual ind = null;
    try {
      int id = 0;

      ind = createIndividual(row, id, classForTerms);
View Full Code Here

        Resource r = res[i];
        final String str = row.get(i).trim();
        if (str.length() > 0) {
          if (r instanceof OntClass) {
            OntClass cls = (OntClass) r;
            Individual ind2 = createIndividual(row, i, cls);
            ObjectProperty p = getPropertyForARangeClass(cls);
            if (cls == null || ind2 == null || p == null
                || ind == null) {
              System.err.println("cls " + cls + "  p " + p
                  + "  ind2 " + ind2 + " ind " + ind);
View Full Code Here

        // #221 retain the original camelCase in the URLs
        //resourceString = ns_ + getGoodName(row, id, allowColon).toLowerCase();
        resourceString = ns_ + getGoodName(str, allowColon);
      }
     
      Individual ind = newOntModel.createIndividual(resourceString, cs);
      ind.addProperty(RDFS.label, str);
      log.info("ind created " + ind);
      return ind;
    }
    return null;
  }
View Full Code Here

      inferenceModel.close();
    }
  }

  public PackageHandle getPackageHandleFor(String uniqueName, String localName) {
    Individual individual = fetchIndividual(uniqueName, localName,  IJavaModelEntities.JAVA_PACKAGE);
   
    return new PackageHandle(individual, this);
  }
View Full Code Here

   
    return new PackageHandle(individual, this);
  }
 
  public InterfaceHandle getInterfaceHandleFor(String uniqueName, String localName) {
    Individual individual = fetchIndividual(uniqueName, localName, IJavaModelEntities.JAVA_INTERFACE);
   
    return new InterfaceHandle(individual, this);
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.ontology.Individual

Copyright © 2018 www.massapicom. 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.