Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual


    OWLDataProperty pInt = DataProperty( ns + "pInt" );
    OWLDataProperty pDouble = DataProperty( ns + "pDouble" );
    OWLDataProperty pBoolean = DataProperty( ns + "pBoolean" );

    OWLNamedIndividual ind = Individual( ns + indName );

    OWLLiteral valDouble = ind.getDataPropertyValues( pDouble, ont ).iterator().next();
    OWLLiteral valInt = ind.getDataPropertyValues( pInt, ont ).iterator().next();
    OWLLiteral valBoolean = ind.getDataPropertyValues( pBoolean, ont ).iterator().next();

    assertTrue( reasoner.isConsistent() );
   
    removeAxioms(ont, propertyAssertion( ind, pDouble, valDouble ) );
    if( buffering ) {
View Full Code Here


          classifier.classify();
         
          testFamily( ns, classifier );
         
          // force realization
          OWLNamedIndividual ind1 = Individual( ns + "ind1" );
          classifier.getTypes(ind1, true);
         
          testFamily( ns, classifier );
        }
        finally {
View Full Code Here

    // OWLClass GoodChild = Class( ns +
    // "GoodChild" );
    OWLClass Grandchild = Class( ns + "Grandchild" );
    OWLClass Person = Class( ns + "Person" );

    OWLNamedIndividual Abel = Individual( ns + "Abel" );
    OWLNamedIndividual Cain = Individual( ns + "Cain" );
    OWLNamedIndividual Oedipus = Individual( ns + "Oedipus" );
    OWLNamedIndividual Remus = Individual( ns + "Remus" );
    OWLNamedIndividual Romulus = Individual( ns + "Romulus" );

    for( int test = 0; test < 2; test++ ) {
      if( test != 0 ) {
              reasoner.prepareReasoner();
            }
View Full Code Here

  public void testSameAs1() throws OWLException {
    String ns = "urn:test:";

    IRI ontIRI = IRI.create( base + "invalidTransitivity.owl" );

    OWLNamedIndividual a = Individual( ns + "a" );
    OWLNamedIndividual b = Individual( ns + "b" );
    OWLNamedIndividual c = Individual( ns + "c" );

    OWLObjectProperty p = ObjectProperty( ns + "p" );
    OWLObjectProperty q = ObjectProperty( ns + "q" );

    Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
View Full Code Here

  public void testSameAs3() throws OWLException {
    String ns = "urn:test:";

    IRI ontIRI = IRI.create( base + "test.owl" );

    OWLNamedIndividual i1 = Individual( ns + "i1" );
    OWLNamedIndividual i2 = Individual( ns + "i2" );
    OWLNamedIndividual i3 = Individual( ns + "i3" );

    OWLClass c = Class( ns + "c" );

    Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
View Full Code Here

        boolean result = instance.addRule(ruleName, ruleBodyHead, ruleDescription);
        OWLOntology newonto = instance.getStore().getOntology();
        String ID = newonto.getOntologyID().toString().replace("<", "").replace(">", "") + "#";

        if (result) {
            OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory()
                    .getOWLNamedIndividual(IRI.create(ID + "MyRuleA"));
            int axiom = newonto.getAxioms(ruleind).size();
            assertEquals(3, axiom);
            // TODO review the generated test code and remove the default call to fail.
        } else {
View Full Code Here

        boolean result = instance.addRule(ruleName, ruleBodyHead, ruleDescription);
        OWLOntology newonto = instance.getStore().getOntology();

        if (result) {
            OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory()
                    .getOWLNamedIndividual(ruleName);
            int axiom = newonto.getAxioms(ruleind).size();
            assertEquals(3, axiom);
            // TODO review the generated test code and remove the default call to fail.
        } else {
View Full Code Here

        if (result) {
            Iterator<String> keys = ruleBodyHeadMap.keySet().iterator();
            int axiom = 0;
            while (keys.hasNext()) {
                OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory()
                        .getOWLNamedIndividual(IRI.create(ID + keys.next()));
                axiom = axiom + newonto.getAxioms(ruleind).size();
            }
            assertEquals(6, axiom);
            // TODO review the generated test code and remove the default call to fail.
View Full Code Here

        if (result) {
            Iterator<IRI> keys = ruleBodyHeadMap.keySet().iterator();
            int axiom = 0;
            while (keys.hasNext()) {
                OWLNamedIndividual ruleind = newonto.getOWLOntologyManager().getOWLDataFactory()
                        .getOWLNamedIndividual(keys.next());
                axiom = axiom + newonto.getAxioms(ruleind).size();
            }
            assertEquals(6, axiom);
            // TODO review the generated test code and remove the default call to fail.
View Full Code Here

            assertEquals("file", o.getOWLOntologyManager().getOntologyDocumentIRI(o).getScheme());

        assertEquals(coreSource.getRootOntology().getOntologyID().getOntologyIRI(),
            IRI.create(Constants.PEANUTS_MAIN_BASE));
        // Linus is stated to be a foaf:Person
        OWLNamedIndividual iLinus = df.getOWLNamedIndividual(IRI.create(Constants.PEANUTS_MAIN_BASE
                                                                        + "#Linus"));
        // Lucy is stated to be a foaf:Perzon
        OWLNamedIndividual iLucy = df
                .getOWLNamedIndividual(IRI.create(Constants.PEANUTS_MAIN_BASE + "#Lucy"));
        OWLClass cPerzon = df.getOWLClass(IRI.create("http://xmlns.com/foaf/0.1/Perzon"));

        Set<OWLIndividual> instances = cPerzon.getIndividuals(coreSource.getRootOntology());
        assertTrue(!instances.contains(iLinus) && instances.contains(iLucy));
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLNamedIndividual

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.