Package com.hp.hpl.jena.ontology

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


      OntProperty p = model.createDatatypeProperty( ns + "prop_" + datatype.getLocalName() );
      p.addRange( datatype );

      while( i < datatypes.length && datatypes[i] instanceof String ) {
        Literal value = model.createTypedLiteral( (String) datatypes[i], datatype.getURI() );
        ind.addProperty( p, value );
        i++;
      }
    }

    model.prepare();
View Full Code Here


                      p.addRange( datatype );
                    }

          Literal value = model.createTypedLiteral( (String) datatypes[i], datatype
              .getURI() );
          ind.addProperty( p, value );

          assertFalse( value.getLexicalForm() + " should not belong to "
              + datatype.getLocalName(), model.validate().isValid() );
          i++;
        }
View Full Code Here

      int start = i;
      while( i < datatypes.length && datatypes[i] instanceof String ) {
        Individual ind = model.createIndividual( ns + "testInd" + i, OWL.Thing );
        Literal value = model.createTypedLiteral( (String) datatypes[i], datatype.getURI() );
        ind.addProperty( p, value );

        OntClass c = model.createClass( ns + "testCls" + i );
        c.addEquivalentClass( model.createHasValueRestriction( null, p, value ) );

        i++;
View Full Code Here

    a.addProperty( dp, zero );

    b.addRDFType( model.createAllValuesFromRestriction( null, dp, XSD.nonPositiveInteger ) );

    Literal one = model.createTypedLiteral( Integer.valueOf( 1 ) );
    c.addProperty( dp, one );

    model.prepare();

    assertTrue( a.isSameAs( b ) );
    assertTrue( b.isSameAs( a ) );
View Full Code Here

    OntClass C = model.createClass( ns + "C" );
    Individual a = model.createIndividual( ns + "a", C );

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );

    model.prepare();

    Literal oneDecimal = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.decimal.getURI() ) );
View Full Code Here

    ObjectProperty q = model.createObjectProperty( ns + "q" );

    a.addProperty( p, c );

    b.addProperty( p, b );
    c.addProperty( q, a );

    c.addSameAs( b );

    a.addProperty( q, c );
View Full Code Here

    // was used
    assertTrue( !PelletOptions.USE_INCREMENTAL_CONSISTENCY || graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 1 );

    Literal two = model.createTypedLiteral( "2", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    b.addProperty( dp, two );

    graph.getKB().isConsistent();

    assertIteratorValues( b.listPropertyValues( dp ), new Literal[] { two } );
    // check that the update occurred and that the incremental consistency
View Full Code Here

    Individual anon1 = model.createIndividual( C );
    Individual a = model.createIndividual( ns + "a", C );

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );

    model.prepare();

    PelletInfGraph graph = (PelletInfGraph) model.getGraph();
View Full Code Here

    PelletInfGraph graph = (PelletInfGraph) model.getGraph();

    assertTrue( graph.getKB().timers.getTimer( "isIncConsistent" ) == null );
    assertIteratorValues( a.listPropertyValues( dp ), new Literal[] { one } );

    a.addProperty( op, anon1 );

    // check consistency
    model.prepare();

    assertIteratorValues( a.listPropertyValues( op ), new Resource[] { anon1 } );
View Full Code Here

    // check that the update occurred and that the incremental consistency
    // was used
    assertTrue( !PelletOptions.USE_INCREMENTAL_CONSISTENCY || graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() > 0 );

    Individual anon2 = model.createIndividual( C );
    anon2.addProperty( op, a );

    // check consistency
    model.prepare();

    assertIteratorValues( anon2.listPropertyValues( op ), new Resource[] { a } );
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.