Package com.hp.hpl.jena.ontology

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


    OntModel ontModel = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );
    ontModel.read( base + "basicFamilyReference.owl" );
    ontModel.read( base + "basicFamilyRules.owl" );

    Resource nella = ontModel.createResource( luigiFamily.resolve( "#Nella" ).toString() );
    Property hasUncle = ontModel.createProperty( luigiFamily.resolve( "#hasUncle" ).toString() );
    Resource dino = ontModel.createResource( luigiFamily.resolve( "#Dino" ).toString() );
    assertFalse( ontModel.contains( nella, hasUncle, dino ) );

  }
View Full Code Here


  public void testDifferentFromInBody() throws Exception {
    OntModel ontModel = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );
    ontModel.read( base + "sibling-rule.n3", "TTL" );

    Resource alice = ontModel.createResource( "family:alice" );
    Property sibling = ontModel.createProperty( "family:sibling" );
    Resource bob = ontModel.createResource( "family:bob" );
    assertTrue( ontModel.contains( alice, sibling, bob ) );
    assertTrue( ontModel.contains( bob, sibling, alice ) );

    assertEquals( Collections.singletonList(bob), ontModel.listObjectsOfProperty( alice, sibling ).toList() );
View Full Code Here

    OntModel ontModel = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );
    ontModel.read( base + "basicFamilyReference.owl" );
    ontModel.read( base + "basicFamilyRules.owl" );

    Resource nella = ontModel.createResource( luigiFamily.resolve( "#Nella" ).toString() );
    Property hasUncle = ontModel.createProperty( luigiFamily.resolve( "#hasUncle" ).toString() );
    Resource dino = ontModel.createResource( luigiFamily.resolve( "#Dino" ).toString() );
    assertFalse( ontModel.contains( nella, hasUncle, dino ) );

  }
View Full Code Here

  public void testDifferentFromInBody() throws Exception {
    OntModel ontModel = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );
    ontModel.read( base + "sibling-rule.n3", "TTL" );

    Resource alice = ontModel.createResource( "family:alice" );
    Property sibling = ontModel.createProperty( "family:sibling" );
    Resource bob = ontModel.createResource( "family:bob" );
    assertTrue( ontModel.contains( alice, sibling, bob ) );
    assertTrue( ontModel.contains( bob, sibling, alice ) );

    assertEquals( Collections.singletonList(bob), ontModel.listObjectsOfProperty( alice, sibling ).toList() );
View Full Code Here

    model.prepare();

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

    Property feet = model.createProperty( ns + "lengthInFeet" );
    Property inches = model.createProperty( ns + "lengthInInches" );

    RDFNode lit12 = model.createTypedLiteral( 12.0f );
    RDFNode lit24 = model.createTypedLiteral( 24.0f );
View Full Code Here

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

    Property feet = model.createProperty( ns + "lengthInFeet" );
    Property inches = model.createProperty( ns + "lengthInInches" );

    RDFNode lit12 = model.createTypedLiteral( 12.0f );
    RDFNode lit24 = model.createTypedLiteral( 24.0f );

    Model inferences = ModelFactory.createDefaultModel();
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.