Package com.hp.hpl.jena.ontology

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


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

    Resource C = model.createClass( ns + "C" );
    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Literal k = model.createLiteral( "k" );
    Property p = model.createDatatypeProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
View Full Code Here


  public void testTopBottomPropertyAssertion() throws MalformedURLException {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    Resource a = model.createResource( "a", OWL.Thing );
    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
View Full Code Here

  public void testTopBottomPropertyInferences() throws MalformedURLException {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    Resource a = model.createResource( "a", OWL.Thing );
    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Property p = model.createProperty( "p" );
    Property dp = model.createProperty( "dp" );
   
    model.add( a, p, b );
View Full Code Here

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

    assertTrue( model.validate().isValid() );
View Full Code Here

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

    assertTrue( model.validate().isValid() );

    assertPropertyValues( model, x, prop, val1, val2 );
View Full Code Here

    String ns = "urn:test:"

    Resource c = model.createResource(ns+"C")
    Property p1 = model.createProperty(ns+"P1");
    Property p2 = model.createProperty(ns+"P2");
    Literal l = model.createLiteral("VAL");
   
    Statement s1 = new StatementImpl(c, p1, l);
    Statement s2 = new StatementImpl(c, p2, l);

    model.add(s1);
View Full Code Here

    String ns = "urn:test:"

    Resource c = model.createResource(ns+"C")
    Property p1 = model.createProperty(ns+"P1");
    Property p2 = model.createProperty(ns+"P2");
    Literal l = model.createLiteral("VAL");
   
    Statement s1 = new StatementImpl(c, p1, l);
    Statement s2 = new StatementImpl(c, p2, l);

    model.add(s1);
View Full Code Here

  public void testTopBottomPropertyAssertion() throws MalformedURLException {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    Resource a = model.createResource( "a", OWL.Thing );
    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Statement[] stats = new Statement[] {
      model.createStatement( a, OWL2.topObjectProperty, b ),
      model.createStatement( a, OWL2.topDataProperty, lit ),
      model.createStatement( a, OWL2.bottomObjectProperty, b ),
View Full Code Here

  public void testTopBottomPropertyInferences() throws MalformedURLException {
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    Resource a = model.createResource( "a", OWL.Thing );
    Resource b = model.createResource( "b", OWL.Thing );
    Literal lit = model.createLiteral( "l" );

    Property p = model.createProperty( "p" );
    Property dp = model.createProperty( "dp" );
   
    model.add( a, p, b );
View Full Code Here

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

    Resource C = model.createClass( ns + "C" );
    Resource i = model.createResource( ns + "i" );
    Resource j = model.createResource( ns + "j" );
    Literal k = model.createLiteral( "k" );
    Property p = model.createDatatypeProperty( ns + "p" );
    RDFList list = model.createList( new RDFNode[] { p } );

    model.add( C, OWL2.hasKey, list );
    model.add( i, RDF.type, C );
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.