Examples of createIndividual()


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

        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

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

        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

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

        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

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

    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

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

    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

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

    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

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

    String ns = "urn:test:";

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

    OntClass Country = model.createClass( ns + "Country" );
    Individual USA = model.createIndividual( ns + "USA", Country );
    Individual UnitedStates = model.createIndividual( ns + "UnitedStates", Country );

    OntProperty livesIn = model.createObjectProperty( ns + "livesIn" );
    livesIn.convertToFunctionalProperty();
View Full Code Here

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

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

    OntClass Country = model.createClass( ns + "Country" );
    Individual USA = model.createIndividual( ns + "USA", Country );
    Individual UnitedStates = model.createIndividual( ns + "UnitedStates", Country );

    OntProperty livesIn = model.createObjectProperty( ns + "livesIn" );
    livesIn.convertToFunctionalProperty();

    OntClass Person = model.createClass( ns + "Person" );
View Full Code Here

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

    OntProperty livesIn = model.createObjectProperty( ns + "livesIn" );
    livesIn.convertToFunctionalProperty();

    OntClass Person = model.createClass( ns + "Person" );
    Individual JohnDoe = model.createIndividual( ns + "JohnDoe", Person );
    JohnDoe.addProperty( livesIn, USA );
    JohnDoe.addProperty( livesIn, UnitedStates );

    assertTrue( model.contains( JohnDoe, RDF.type, Person ) );
    assertTrue( model.contains( USA, OWL.sameAs, UnitedStates ) );
View Full Code Here

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

        XSD.integer, "77", XSD.xlong, "214", XSD.negativeInteger, "-123",
        XSD.nonNegativeInteger, "2", XSD.nonPositiveInteger, "0", XSD.positiveInteger,
        "500", XSD.xshort, "476", XSD.xstring, "Test", XSD.time, "13:02:00", };

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    Individual ind = model.createIndividual( ns + "test", OWL.Thing );
    for( int i = 0; i < datatypes.length; ) {
      Resource datatype = (Resource) datatypes[i++];
      OntProperty p = model.createDatatypeProperty( ns + "prop_" + datatype.getLocalName() );
      p.addRange( datatype );
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.