Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntProperty


    Resource a = model.getResource( ns + "a" );
    Resource b = model.getResource( ns + "b" );
    Resource c = model.getResource( ns + "c" );

    OntProperty higher = model.getOntProperty( ns + "higher" );

    assertIteratorValues( model.listStatements( null, higher, (RDFNode) null ),
        new Statement[] {
            model.createStatement( a, higher, b ),
            model.createStatement( b, higher, c ),
View Full Code Here


    Individual a = model.getIndividual( ns + "a" );
    Individual b = model.getIndividual( ns + "b" );
    Individual c = model.getIndividual( ns + "c" );
    Individual d = model.getIndividual( ns + "d" );

    OntProperty higher = model.getOntProperty( ns + "higher" );

    assertIteratorValues( model.listStatements( null, higher, (RDFNode) null ),
        new Statement[] {
            model.createStatement( a, higher, b ),
            model.createStatement( b, higher, c ),
View Full Code Here

    Individual Bob = model.getIndividual( ns + "Bob" );
    Individual Mom = model.getIndividual( ns + "Mom" );
    Individual Dad = model.getIndividual( ns + "Dad" );

    OntProperty hasParent = model.getObjectProperty( ns + "hasParent" );
    OntProperty hasFather = model.getObjectProperty( ns + "hasFather" );
    OntProperty hasMother = model.getObjectProperty( ns + "hasMother" );
    OntProperty topObjProp = model.getObjectProperty( OWL2.topObjectProperty.getURI() );

    model.prepare();

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

  public void testPropertyAssertions2() {
    String ns = "urn:test:";

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    OntClass Person = model.createClass( ns + "Person" );
    OntProperty hasFather = model.createObjectProperty( ns + "hasFather" );
    OntProperty hasBioFather = model.createObjectProperty( ns + "hasBioFather", true );
    hasBioFather.addSuperProperty( hasFather );
    Person.addSuperClass( model.createMinCardinalityRestriction( null, hasBioFather, 1 ) );

    Individual Bob = model.createIndividual( ns + "Bob", Person );
    Individual Dad = model.createIndividual( ns + "Dad", Person );
    Bob.addProperty( hasBioFather, Dad );
View Full Code Here

    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" );
    Individual JohnDoe = model.createIndividual( ns + "JohnDoe", Person );
    JohnDoe.addProperty( livesIn, USA );
    JohnDoe.addProperty( livesIn, UnitedStates );
View Full Code Here

  public void testMultipleDatatypes() {
    String ns = "urn:test:";

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

    OntProperty f = model.createDatatypeProperty( ns + "f" );
    f.addRange( XSD.xfloat );

    OntProperty d = model.createDatatypeProperty( ns + "d" );
    d.addRange( XSD.xdouble );

    OntClass C = model.createClass( ns + "C" );
    C.addSuperClass( model.createMinCardinalityRestriction( null, f, 5 ) );
    C.addSuperClass( model.createMinCardinalityRestriction( null, d, 5 ) );
View Full Code Here

    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 );

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

        while( i < datatypes.length && datatypes[i] instanceof String ) {
          OntModel model = ModelFactory
              .createOntologyModel( PelletReasonerFactory.THE_SPEC );
          Individual ind = model.createIndividual( ns + "test", OWL.Thing );

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

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

    for( int i = 0; i < datatypes.length; ) {
      Resource datatype = (Resource) datatypes[i++];
      OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

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

      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() );
View Full Code Here

    Resource a = model.getResource( ns + "a" );
    Resource b = model.getResource( ns + "b" );
    Resource c = model.getResource( ns + "c" );

    OntProperty higher = model.getOntProperty( ns + "higher" );

    assertIteratorValues( model.listStatements( null, higher, (RDFNode) null ),
        new Statement[] {
            model.createStatement( a, higher, b ),
            model.createStatement( b, higher, c ),
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.ontology.OntProperty

Copyright © 2018 www.massapicom. 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.