Examples of addRDFType()


Examples of com.hp.hpl.jena.ontology.Individual.addRDFType()

    OntClass CONJ = model.createIntersectionClass( null, conj );

    Individual i1 = model.createIndividual( ns + "i1", C );
    i1.addRDFType( D );
    Individual i2 = model.createIndividual( ns + "i2", C );
    i2.addRDFType( D );
    Individual i3 = model.createIndividual( ns + "i3", C );
    i3.addRDFType( E );

    // check consistency
    model.prepare();
View Full Code Here

Examples of com.hp.hpl.jena.ontology.Individual.addRDFType()

    Individual i1 = model.createIndividual( ns + "i1", C );
    i1.addRDFType( D );
    Individual i2 = model.createIndividual( ns + "i2", C );
    i2.addRDFType( D );
    Individual i3 = model.createIndividual( ns + "i3", C );
    i3.addRDFType( E );

    // check consistency
    model.prepare();

    // add individual
View Full Code Here

Examples of com.hp.hpl.jena.ontology.Individual.addRDFType()

    // check that the update occurred and that the incremental consistency
    // was used
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() > 0 );
    assertIteratorValues( model.listIndividuals(), new Resource[] { i1, i2, i3, i4 } );

    i4.addRDFType( model.createCardinalityRestriction( null, p, 1 ) );
    graph.getKB().timers.getTimer( "isIncConsistent" ).reset();

    model.prepare();

    // check that incremental consistency was not used
View Full Code Here

Examples of com.hp.hpl.jena.ontology.Individual.addRDFType()

    model.prepare();

    // check that incremental consistency was not used
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 0 );

    i4.addRDFType( E );

    // check that the kb is now inconsistent and that incremental
    // consistency was used
    assertFalse( ((PelletInfGraph) model.getGraph()).isConsistent() );
    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() > 0 );
View Full Code Here

Examples of com.hp.hpl.jena.ontology.Individual.addRDFType()

    // load everything and check consistency
    assertTrue( model.validate().isValid() );

    // add a type relation for an existing individual
    a.addRDFType( cls );

    // verify instance relation
    assertTrue( model.contains( a, RDF.type, cls ) );
    assertIteratorValues( cls.listInstances( false ), new Resource[] { a } );
    // check for direct types to make sure we don't get results from base
View Full Code Here

Examples of com.hp.hpl.jena.ontology.ObjectProperty.addRDFType()

    ObjectProperty hasRelative = model.createObjectProperty( ns + "hasRelative" );
    // a person knows all his/her relatives
    hasRelative.addSuperProperty( knows );
    // being a relative is transitive (but knowing someone is not
    // transitive)
    hasRelative.addRDFType( OWL.TransitiveProperty );

    ObjectProperty hasParent = model.createObjectProperty( ns + "hasParent" );
    // a parent is also a relative
    hasParent.addSuperProperty( hasRelative );
View Full Code Here

Examples of com.hp.hpl.jena.ontology.ObjectProperty.addRDFType()

    OntModel ont = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );

    OntClass C = ont.createClass( "C" );

    ObjectProperty p1 = ont.createObjectProperty( "p1" );
    p1.addRDFType( OWL.TransitiveProperty );

    ObjectProperty p2 = ont.createObjectProperty( "p2" );

    Individual x = ont.createIndividual( OWL.Thing );
    Individual y = ont.createIndividual( OWL.Thing );
View Full Code Here

Examples of com.hp.hpl.jena.ontology.ObjectProperty.addRDFType()

    OntModel ont = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );

    OntClass C = ont.createClass( "C" );

    ObjectProperty p1 = ont.createObjectProperty( "p1" );
    p1.addRDFType( OWL.TransitiveProperty );

    ObjectProperty p2 = ont.createObjectProperty( "p2" );

    Individual x = ont.createIndividual( OWL.Thing );
    Individual y = ont.createIndividual( OWL.Thing );
View Full Code Here

Examples of com.hp.hpl.jena.ontology.ObjectProperty.addRDFType()

    ObjectProperty hasRelative = model.createObjectProperty( ns + "hasRelative" );
    // a person knows all his/her relatives
    hasRelative.addSuperProperty( knows );
    // being a relative is transitive (but knowing someone is not
    // transitive)
    hasRelative.addRDFType( OWL.TransitiveProperty );

    ObjectProperty hasParent = model.createObjectProperty( ns + "hasParent" );
    // a parent is also a relative
    hasParent.addSuperProperty( hasRelative );
View Full Code Here

Examples of org.wikier.trioo.jtrioo.rdf.meta.RDFMetaResource.addRdfType()

        String prefix = NamespacesManager.getInstance().getPrefix(ns);
        if (prefix == null) {
          throw new MappingNotFoundException("namespace " + ns);
        }
        CURIE curie = new CURIE(prefix, URIUtils.getReference(node.toString()));
        metaResource.addRdfType(curie);
      }
    }
    rs = null; //FIXME: how a ResultSet can be closed?
    Class cls = this.session.getAssociatedClass(metaResource);
    if (cls == null) {
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.