Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntModel.createIndividual()


    long e = System.currentTimeMillis();
    System.out.println( "Consistent? " + consistent + " (" + (e - s) + "ms)" );

    // perform ABox addition which results in a consistent KB
    Resource concept = model.getResource( mindswap + "GraduateStudent" );
    Individual individual = model.createIndividual( mindswappers + "JohnDoe", concept );

    // perform incremental consistency check
    s = System.currentTimeMillis();
    consistent = pelletJenaGraph.isConsistent();
    e = System.currentTimeMillis();
View Full Code Here


    System.out.println( "Total time " + (e - s) + " ms)" );
    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );

    // perform ABox addition which results in a consistent KB
    Resource concept = model.getResource( mindswap + "GraduateStudent" );
    Individual individual = model.createIndividual( mindswappers + "JohnDoe", concept );

    // perform incremental consistency check
    s = System.currentTimeMillis();
    model.prepare();
    e = System.currentTimeMillis();
View Full Code Here

        Resource RedMeatCourse = model.getResource( ns + "RedMeatCourse" );
        Resource PastaWithLightCreamCourse = model.getResource( ns + "PastaWithLightCreamCourse" );
       
        // create two individuals Lunch and dinner that are instances of 
        // PastaWithLightCreamCourse and RedMeatCourse, respectively
        model.createIndividual( ns + "MyLunch", PastaWithLightCreamCourse);
        model.createIndividual( ns + "MyDinner", RedMeatCourse);
       
        String queryBegin =
            "PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\r\n" +
            "PREFIX food: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#>\r\n" +
View Full Code Here

        Resource PastaWithLightCreamCourse = model.getResource( ns + "PastaWithLightCreamCourse" );
       
        // create two individuals Lunch and dinner that are instances of 
        // PastaWithLightCreamCourse and RedMeatCourse, respectively
        model.createIndividual( ns + "MyLunch", PastaWithLightCreamCourse);
        model.createIndividual( ns + "MyDinner", RedMeatCourse);
       
        String queryBegin =
            "PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\r\n" +
            "PREFIX food: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#>\r\n" +
            "PREFIX wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>\r\n" +
View Full Code Here

        else if (c_ont.isRestriction()) {
          res = createRestriction(base,c_ont.asRestriction());
      }   
        else if (c_ont.isIndividual()) {
          debugDisplay("  asIndividual          ");// + r.asIndividual().toString() );
          res = local.createIndividual(c_ont);
       
      else if (c_ont.isIntersectionClass()) {
        debugDisplay("  asIntersectionClass " + c_ont.asIntersectionClass().toString());
        res = local.createIntersectionClass(c_ont.getURI(),c_ont.asIntersectionClass().getOperands());
      }
View Full Code Here

        OntModel model = ModelFactory.createOntologyModel();

        OntClass jenaclass = model.createClass(CLAZZ.toString());
        ObjectProperty jenaobprop = model.createObjectProperty(OP.toString());
        DatatypeProperty jenadataprop = model.createDatatypeProperty(DP.toString());
        Individual jenasub = model.createIndividual(SUBJECT.toString(), jenaclass);
        Individual jenaobj = model.createIndividual(OBJECT.toString(), jenaclass);
        AnnotationProperty jenaanno = model.createAnnotationProperty(label.toString());
        Literal value = model.createTypedLiteral(VALUE, DATATYPE.toString());

        model.add(jenasub, jenaobprop, jenaobj);
View Full Code Here

        OntClass jenaclass = model.createClass(CLAZZ.toString());
        ObjectProperty jenaobprop = model.createObjectProperty(OP.toString());
        DatatypeProperty jenadataprop = model.createDatatypeProperty(DP.toString());
        Individual jenasub = model.createIndividual(SUBJECT.toString(), jenaclass);
        Individual jenaobj = model.createIndividual(OBJECT.toString(), jenaclass);
        AnnotationProperty jenaanno = model.createAnnotationProperty(label.toString());
        Literal value = model.createTypedLiteral(VALUE, DATATYPE.toString());

        model.add(jenasub, jenaobprop, jenaobj);
        model.add(jenasub, jenadataprop, value);
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    DatatypeProperty prop = model.createDatatypeProperty( ns + "prop" );
    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );
    x.addProperty( prop, "literal" );

    model.prepare();

    assertTrue( ((PelletInfGraph) model.getGraph()).isConsistent() );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    DatatypeProperty prop = model.createDatatypeProperty( ns + "prop" );
    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );
    x.addProperty( prop, "literal1" );
    x.addProperty( prop, "literal2" );
    x.addProperty( prop, "literal3" );

    assertTrue( !model.validate().isValid() );
View Full Code Here

    DatatypeProperty sub = model.createDatatypeProperty( ns + "sub" );
    sub.addSuperProperty( prop );

    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createCardinalityRestriction( null, prop, 2 ) );
    Individual x = model.createIndividual( ns + "x", C );

    Literal val1 = model.createLiteral( "val1" );
    x.addProperty( prop, val1 );
    Literal val2 = model.createLiteral( "val2" );
    x.addProperty( sub, val2 );
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.