Examples of OntModelSpec


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

  }

  @Test
  public void testPropertyRestrictionsInSuperclasses() {
    String ns = "urn:test:";
    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( new PelletReasoner() );

    OntModel model = ModelFactory.createOntologyModel( spec, null );

    OntClass X = model.createClass( ns + "X" );
    ObjectProperty hasX = model.createObjectProperty( ns + "hasX" );
View Full Code Here

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

    String ns = "urn:test:";

    Reasoner r = PelletReasonerFactory.theInstance().create();
    // ReasonerRegistry.getOWLMicroReasoner();

    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( r );
    OntModel model = ModelFactory.createOntologyModel( spec, null );

    OntClass A = model.createClass( ns + "A" );
    OntClass B = model.createClass( ns + "B" );
    ObjectProperty P = model.createObjectProperty( ns + "P" );
View Full Code Here

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

  }

  @Test
  public void testSameAs2() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    Property prop = model.createProperty( "http://test#prop" );
    i1.addProperty( prop, "test" );
View Full Code Here

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

    assertIteratorContains( i2.listProperties(), model.createStatement( i2, prop, "test" ) );
  }

  @Test
  public void testSameAs3() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    OntClass c = model.createEnumeratedClass( "http://test#C", model.createList( new RDFNode[] {
        i1, i2 } ) );
View Full Code Here

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

  }

  @Test
  public void testHasValueReasoning() {
    String ns = "urn:test:";
    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( spec, null );
    OntClass HomeOwner = model.createClass( ns + "HomeOwner" );
    Individual bob = model.createIndividual( ns + "bob", HomeOwner );
    ObjectProperty hasNeighbor = model.createObjectProperty( ns + "hasNeighbor" );
    OntClass NeighborOfBob = model.createClass( ns + "NeighborOfBob" );
View Full Code Here

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

    Individual d = cls.createIndividual( ns + "d" );
    Individual e = cls.createIndividual( ns + "e" );
    Individual f = cls.createIndividual( ns + "f" );
    Individual g = cls.createIndividual( ns + "g" );

    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    // spec.setReasoner( ReasonerRegistry.getDIGReasoner() );
    spec.setReasoner( PelletReasonerFactory.theInstance().create() );
    model = ModelFactory.createOntologyModel( spec, model );

    // This is the ABox data used in this example:
    //
    // hasParent hasParent hasRelative
View Full Code Here

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

    Model schema = ModelFactory.createDefaultModel();   
    schema.add(A, RDFS.subClassOf, B);
    schema.add(B, RDFS.subClassOf, C);

    // create a fresh spec
    OntModelSpec fixedSchemaSpec = new OntModelSpec( OntModelSpec.OWL_MEM );
    // create a reasoner with a fixed schema and set the spec to use it
    fixedSchemaSpec.setReasoner(PelletReasonerFactory.theInstance().create().bindFixedSchema(schema));
   
    // create a new model whihc will have the schema loaded automatically
    OntModel model = ModelFactory.createOntologyModel(fixedSchemaSpec);

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

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

  }

  @Test
  public void testPropertyRestrictionsInSuperclasses() {
    String ns = "urn:test:";
    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( new PelletReasoner() );

    OntModel model = ModelFactory.createOntologyModel( spec, null );

    OntClass X = model.createClass( ns + "X" );
    ObjectProperty hasX = model.createObjectProperty( ns + "hasX" );
View Full Code Here

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

    String ns = "urn:test:";

    Reasoner r = PelletReasonerFactory.theInstance().create();
    // ReasonerRegistry.getOWLMicroReasoner();

    OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
    spec.setReasoner( r );
    OntModel model = ModelFactory.createOntologyModel( spec, null );

    OntClass A = model.createClass( ns + "A" );
    OntClass B = model.createClass( ns + "B" );
    ObjectProperty P = model.createObjectProperty( ns + "P" );
View Full Code Here

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

  }

  @Test
  public void testSameAs2() {
    OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
    ontModelSpec.setReasoner( new PelletReasoner() );
    OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
    Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
    Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
    Property prop = model.createProperty( "http://test#prop" );
    i1.addProperty( prop, "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.