Package com.hp.hpl.jena.ontology

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


    Bob.addProperty( hasBioFather, Dad );
    Bob.addRDFType( model.createCardinalityRestriction( null, hasFather, 1 ) );

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

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasFather ), new Resource[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasBioFather ),
        new Resource[] { Dad } );
  }
View Full Code Here


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

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasFather ), new Resource[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasBioFather ),
        new Resource[] { Dad } );
  }

  @Test
  public void testTransitive1() {
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    Property p = model.createAnnotationProperty( ns + "p" );
    model.prepare();

    assertTrue(model.contains(p, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( p, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( p, null ), OWL.AnnotationProperty );

    assertTrue(model.contains(RDFS.label, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, null ), OWL.AnnotationProperty );
View Full Code Here

    Property p = model.createAnnotationProperty( ns + "p" );
    model.prepare();

    assertTrue(model.contains(p, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( p, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( p, null ), OWL.AnnotationProperty );

    assertTrue(model.contains(RDFS.label, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, null ), OWL.AnnotationProperty );
  }
View Full Code Here

    assertTrue(model.contains(p, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( p, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( p, null ), OWL.AnnotationProperty );

    assertTrue(model.contains(RDFS.label, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, null ), OWL.AnnotationProperty );
  }
 
  @Test
  public void testTopBottomPropertyAssertion() throws MalformedURLException {
View Full Code Here

    assertIteratorContains( model.listObjectsOfProperty( p, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( p, null ), OWL.AnnotationProperty );

    assertTrue(model.contains(RDFS.label, RDF.type, OWL.AnnotationProperty));
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, RDF.type ), OWL.AnnotationProperty );
    assertIteratorContains( model.listObjectsOfProperty( RDFS.label, null ), OWL.AnnotationProperty );
  }
 
  @Test
  public void testTopBottomPropertyAssertion() throws MalformedURLException {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );
View Full Code Here

    model.prepare();

    assertTrue( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasParent ), new Resource[] {
        Mom, Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasFather ), new Object[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasMother ), new Object[] { Mom } );
View Full Code Here

    assertTrue( ((PelletInfGraph) model.getGraph()).getKB().isConsistent() );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasParent ), new Resource[] {
        Mom, Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasFather ), new Object[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasMother ), new Object[] { Mom } );

    assertIteratorValues( model.listStatements( null, hasParent, (Resource) null ),
        new Statement[] {
View Full Code Here

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasParent ), new Resource[] {
        Mom, Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasFather ), new Object[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( hasMother ), new Object[] { Mom } );

    assertIteratorValues( model.listStatements( null, hasParent, (Resource) null ),
        new Statement[] {
            ResourceFactory.createStatement( Bob, hasParent, Mom ),
            ResourceFactory.createStatement( Bob, hasParent, Dad ) } );
View Full Code Here

    assertIteratorValues( model.listStatements( Bob, null, Dad ), new Statement[] {
        ResourceFactory.createStatement( Bob, topObjProp, Dad ),
        ResourceFactory.createStatement( Bob, hasParent, Dad ),
        ResourceFactory.createStatement( Bob, hasFather, Dad ) } );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasFather ), new Resource[] { Dad } );

    assertIteratorValues( model.listObjectsOfProperty( Bob, hasMother ), new Resource[] { Mom } );
  }

  @Test
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.