Examples of listInstances()


Examples of com.hp.hpl.jena.ontology.IntersectionClass.listInstances()

    IntersectionClass class3 = ontmodel.createIntersectionClass( null, list );

    UnionClass class4 = ontmodel.createUnionClass( null, list );

    assertIteratorValues( class3.listInstances(), new Resource[] { inds[2], inds[3] } );

    assertIteratorValues( class4.listInstances(), new Resource[] {
        inds[0], inds[1], inds[2], inds[3], inds[4], inds[5] } );

  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.IntersectionClass.listInstances()

    IntersectionClass class3 = ontmodel.createIntersectionClass( null, list );

    UnionClass class4 = ontmodel.createUnionClass( null, list );

    assertIteratorValues( class3.listInstances(), new Resource[] { inds[2], inds[3] } );

    assertIteratorValues( class4.listInstances(), new Resource[] {
        inds[0], inds[1], inds[2], inds[3], inds[4], inds[5] } );

  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.IntersectionClass.listInstances()

    graph.getKB().timers.getTimer( "isIncConsistent" ).reset();
   
    ontmodel.prepare();

    assertIteratorValues( class3.listInstances(), new Resource[] {
        inds[2], inds[3], inds[4], inds[5] } );

    assertIteratorValues( class4.listInstances(), new Resource[] {
        inds[0], inds[1], inds[2], inds[3], inds[4], inds[5] } );
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

        Iterator<OntClass> classesIterator = classes.iterator();

        //Para cada classe recuperar a lista de suas instancias
        while(classesIterator.hasNext()){
            OntClass classe = (OntClass)classesIterator.next();
            ExtendedIterator<? extends OntResource> individuals = classe.listInstances();
            //adicionar cada instancia ao conjunto a ser retornado
            while (individuals.hasNext()){
                Individual thisInstance = (Individual) individuals.next();
                instancias.add(thisInstance);
          }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

    OntClass Person = model.getOntClass("http://xmlns.com/foaf/0.1/Person");
    Property workHomepage = model.getProperty("http://xmlns.com/foaf/0.1/workInfoHomepage");
    Property foafName = model.getProperty("http://xmlns.com/foaf/0.1/name");
   
    // get all instances of Person class
    Iterator<?> i = Person.listInstances();
    while( i.hasNext() ) {
        Individual ind = (Individual) i.next();
       
        // get the info about this specific individual
        String name = ((Literal) ind.getPropertyValue( foafName )).getString();
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

        OntClass ontClass = model.getOntClass(classURI);
        if (ontClass == null || ontClass.isAnon() || isClassNotValid(ontClass)) {
            log.warn("Can not find class with uri {}, skipping ...", classURI);
        } else {
            log.debug("Computing instance closure of class {} ", classURI);
            List<? extends OntResource> instances = ontClass.listInstances(true).toList();
            for (OntResource instance : instances) {
                if (instance == null || instance.isAnon() || !instance.isIndividual()) {
                    continue;
                } else {
                    Individual individual = instance.asIndividual();
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

              nounClass.getLocalName())) {
            newStart = i + 1;
            break out;
          }

          ExtendedIterator<? extends OntResource> instances = nounClass
              .listInstances();
          while (instances.hasNext()) {
            String nounInstance = instances.next().getLocalName();
            if (sentence.getTokens().get(i).getText().equals(
                nounInstance)) {
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

    //�������ʵ��
    else if ("ʵ��".equals(p)) {
      OntClass s_c = this.getOntModel().getOntClass(subject);
      if (s_c != null) {
        QueryResult qr = new QueryResult(OntologyElement.INDIVIDUAL);
        Iterator it = s_c.listInstances();
        while (it.hasNext()) {
          Individual ind = (Individual) it.next();
          if (ind != null) {
            qr.add(wrap(ind));
          }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

    OntClass Person = model.getOntClass("http://xmlns.com/foaf/0.1/Person");
    Property workHomepage = model.getProperty("http://xmlns.com/foaf/0.1/workInfoHomepage");
    Property foafName = model.getProperty("http://xmlns.com/foaf/0.1/name");
   
    // get all instances of Person class
    Iterator<?> i = Person.listInstances();
    while( i.hasNext() ) {
        Individual ind = (Individual) i.next();
       
        // get the info about this specific individual
        String name = ((Literal) ind.getPropertyValue( foafName )).getString();
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntClass.listInstances()

 
    assertIteratorValues( S0.listInstances(), theList );
 
    assertIteratorValues( R0.listInstances(), new Resource[] { a[7], a[9] } );
 
    assertIteratorValues( R1.listInstances(), new Resource[] { a[2], a[3], a[4], a[5], a[6] } );
 
    Model rValues = ModelFactory.createDefaultModel();
    addStatements( rValues, a[0], r, a[7], a[9] );
    addStatements( rValues, a[1], r, a[2], a[3], a[4], a[5], a[6] );
    addStatements( rValues, a[2], r, a[4], a[5], a[6] );
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.