Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLAxiom



    public void handle(String id, String value) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(id);
            OWLAxiom ax = getDataFactory().getOWLAntiSymmetricObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
        else {
            addAnnotation(id, OBOVocabulary.IS_ANTI_SYMMETRIC.getName(), getBooleanConstant(false));
        }
View Full Code Here


        OWLObjectProperty first = getOWLObjectProperty(id);
        OWLObjectProperty second = getOWLObjectProperty(value);
        List<OWLObjectProperty> chain = new ArrayList<OWLObjectProperty>();
        chain.add(first);
        chain.add(second);
        OWLAxiom ax = getDataFactory().getOWLObjectPropertyChainSubPropertyAxiom(chain, first);
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

    public void ontologiesChanged(List<? extends OWLOntologyChange> changes) throws OWLException {
        for (OWLOntologyChange change : changes) {
            if (!change.isAxiomChange() || !ontologies.contains(change.getOntology()))
                continue;

      final OWLAxiom axiom = change.getAxiom();

            if (change instanceof AddAxiom)
        addAxiom( axiom );
            else if (change instanceof RemoveAxiom)
        removeAxiom( axiom );
View Full Code Here

      // for the ATerm->OWLObject translation to work we need
      // all the entities referred in the ATerm to be defined
      // entities. therefore, we add a dummy axiom to the KB
      // that will add the definitions for each entity.
      OWLAxiom axiom = null;
      if( object instanceof OWLDescription ) {
        OWLDescription c = (OWLDescription) object;
        axiom = factory.getOWLSubClassAxiom( c, c );
      }
      else if( object instanceof OWLObjectProperty ) {
        OWLObjectProperty p = (OWLObjectProperty) object;
        axiom = factory.getOWLSubObjectPropertyAxiom( p, p );
      }
      else if( object instanceof OWLDataProperty ) {
        OWLDataProperty p = (OWLDataProperty) object;
        axiom = factory.getOWLSubDataPropertyAxiom( p, p );
      }
      else if( object instanceof OWLIndividual ) {
        OWLIndividual ind = (OWLIndividual) object;
        axiom = factory.getOWLClassAssertionAxiom( ind, factory.getOWLThing() );
      }
      if( axiom != null )
        axiom.accept( atermConverter );

      OWLObject converted = owlapiConverter.convert( aterm );

      assertEquals( object, converted );
    } catch( Exception e ) {
View Full Code Here

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( x, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( x, C ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom<?>> antecedent = new HashSet<SWRLAtom<?>>();
    Set<SWRLAtom<?>> consequent = new HashSet<SWRLAtom<?>>();

    antecedent.add( classAtom( Class( "C" ), iVariable( "x" ) ) );
    consequent.add( classAtom( Class( "D" ), iVariable( "x" ) ) );

    OWLAxiom expected = rule( antecedent, consequent );

    assertEquals( expected, actual );
  }
View Full Code Here

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( x, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( x, C ) };

    ATermAppl rule = ATermUtils.makeRule( name, head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom<?>> antecedent = new HashSet<SWRLAtom<?>>();
    Set<SWRLAtom<?>> consequent = new HashSet<SWRLAtom<?>>();

    antecedent.add( classAtom( Class( "C" ), iVariable( "x" ) ) );
    consequent.add( classAtom( Class( "D" ), iVariable( "x" ) ) );

    OWLAxiom expected = rule( name.getName(), antecedent, consequent );

    assertEquals( expected, actual );
  }
View Full Code Here

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( x, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( x, C ) };

    ATermAppl rule = ATermUtils.makeRule( name, head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom<?>> antecedent = new HashSet<SWRLAtom<?>>();
    Set<SWRLAtom<?>> consequent = new HashSet<SWRLAtom<?>>();

    antecedent.add( classAtom( Class( "C" ), iVariable( "x" ) ) );
    consequent.add( classAtom( Class( "D" ), iVariable( "x" ) ) );

    OWLAxiom expected = rule( name.getArgument( 0 ).toString(), true, antecedent, consequent );

    assertEquals( expected, actual );
  }
View Full Code Here

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( i, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( i, C ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom<?>> antecedent = new HashSet<SWRLAtom<?>>();
    Set<SWRLAtom<?>> consequent = new HashSet<SWRLAtom<?>>();

    antecedent.add( classAtom( Class( "C" ), SWRL.individual( OWL.Individual( "i" ) ) ) );
    consequent.add( classAtom( Class( "D" ), SWRL.individual( OWL.Individual( "i" ) ) ) );

    OWLAxiom expected = rule( antecedent, consequent );

    assertEquals( expected, actual );
  }
View Full Code Here

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makePropAtom( q, x, y ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makePropAtom( p, x, y ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom<?>> antecedent = new HashSet<SWRLAtom<?>>();
    Set<SWRLAtom<?>> consequent = new HashSet<SWRLAtom<?>>();

    antecedent.add( propertyAtom( ObjectProperty( "p" ), iVariable( "x" ), iVariable( "y" ) ) );
    consequent.add( propertyAtom( ObjectProperty( "q" ), iVariable( "x" ), iVariable( "y" ) ) );

    OWLAxiom expected = rule( antecedent, consequent );

    assertEquals( expected, actual );
  }
View Full Code Here

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makePropAtom( r, x, y ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makePropAtom( s, x, y ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom<?>> antecedent = new HashSet<SWRLAtom<?>>();
    Set<SWRLAtom<?>> consequent = new HashSet<SWRLAtom<?>>();

    antecedent.add( propertyAtom( DataProperty( "s" ), iVariable( "x" ), dVariable( "y" ) ) );
    consequent.add( propertyAtom( DataProperty( "r" ), iVariable( "x" ), dVariable( "y" ) ) );

    OWLAxiom expected = rule( antecedent, consequent );

    assertEquals( expected, actual );
  }
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.OWLAxiom

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.