Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLObjectProperty


    if( !addAxioms ) {
      // no need to mark simple properties during removal
      return;
    }
   
    OWLObjectProperty prop = getNamedProperty( ope );
    simpleProperties.add( prop );

    prop.accept( this );
    Role role = kb.getRBox().getRole( term );
    role.setForceSimple( true );
  }
View Full Code Here


  }

  void verify() {
    for( Map.Entry<OWLObjectProperty, Set<OWLObjectPropertyAxiom>> entry : compositePropertyAxioms
        .entrySet() ) {
      OWLObjectProperty nonSimpleProperty = entry.getKey();

      if( !simpleProperties.contains( nonSimpleProperty ) )
        continue;

      Set<OWLObjectPropertyAxiom> axioms = entry.getValue();
      for( OWLObjectPropertyAxiom axiom : axioms )
        addUnsupportedAxiom( axiom );

      ATermAppl name = ATermUtils.makeTermAppl( nonSimpleProperty.getURI().toString() );
      Role role = kb.getRBox().getRole( name );
      role.removeSubRoleChains();
    }
  }
View Full Code Here

      return;
    }

    Object[] disjs = axiom.getProperties().toArray();
    for( int i = 0; i < disjs.length - 1; i++ ) {
      OWLObjectProperty prop1 = (OWLObjectProperty) disjs[i];
      addSimpleProperty( prop1 );
      for( int j = i + 1; j < disjs.length; j++ ) {
        OWLObjectProperty prop2 = (OWLObjectProperty) disjs[j];
        addSimpleProperty( prop2 );
        prop1.accept( this );
        ATermAppl p1 = term;
        prop2.accept( this );
        ATermAppl p2 = term;

        kb.addDisjointProperty( p1, p2 );
      }
    }
View Full Code Here

            subs = null;
            break;
          }
          subs.add( p );
        }
        OWLObjectProperty sup = (OWLObjectProperty) conceptConverter
            .convert( (ATermAppl) term.getArgument( 1 ) );

        if( subs != null && sup != null ) {
          axiom = factory.getOWLObjectPropertyChainSubPropertyAxiom( subs, sup );
        }
      }
      else {
        OWLObject p1 = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );
        OWLObject p2 = conceptConverter.convert( (ATermAppl) term.getArgument( 1 ) );

        if( p1 != null && p2 != null ) {
          if( p1 instanceof OWLObjectPropertyExpression && p2 instanceof OWLObjectPropertyExpression )
            axiom = factory.getOWLSubObjectPropertyAxiom( (OWLObjectPropertyExpression) p1,
                (OWLObjectPropertyExpression) p2 );
          else if( p1 instanceof OWLDataProperty && p2 instanceof OWLDataProperty )
            axiom = factory.getOWLSubDataPropertyAxiom( (OWLDataProperty) p1,
                (OWLDataProperty) p2 );
        }
      }
    }
    else if( term.getAFun().equals( ATermUtils.EQPROPFUN ) ) {
      OWLObject p1 = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );
      OWLObject p2 = conceptConverter.convert( (ATermAppl) term.getArgument( 1 ) );

      if( p1 != null && p2 != null ) {
        if( p1 instanceof OWLObjectProperty && p2 instanceof OWLObjectProperty )
          axiom = factory.getOWLEquivalentObjectPropertiesAxiom( SetUtils.create(
              (OWLObjectProperty) p1, (OWLObjectProperty) p2 ) );
        else if( p1 instanceof OWLDataProperty && p2 instanceof OWLDataProperty )
          axiom = factory.getOWLEquivalentDataPropertiesAxiom( SetUtils.create(
              (OWLDataProperty) p1, (OWLDataProperty) p2 ) );
      }
    }
    else if( term.getAFun().equals( ATermUtils.DOMAINFUN ) ) {
      OWLObject p = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );
      OWLDescription c = (OWLDescription) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );

      if( c != null && p != null ) {
        if( p instanceof OWLObjectProperty )
          axiom = factory.getOWLObjectPropertyDomainAxiom(
              (OWLObjectPropertyExpression) p, c );
        else
          axiom = factory
              .getOWLDataPropertyDomainAxiom( (OWLDataPropertyExpression) p, c );
      }
    }
    else if( term.getAFun().equals( ATermUtils.RANGEFUN ) ) {
      OWLPropertyRange e = (OWLPropertyRange) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );
      if( e != null ) {
        if( e instanceof OWLDescription ) {
          OWLObjectProperty p = (OWLObjectProperty) conceptConverter
              .convert( (ATermAppl) term.getArgument( 0 ) );
          if( p != null )
            axiom = factory.getOWLObjectPropertyRangeAxiom( p, (OWLDescription) e );
        }
        else {
          OWLDataProperty p = (OWLDataProperty) conceptConverter
              .convert( (ATermAppl) term.getArgument( 0 ) );
          if( p != null )
            axiom = factory.getOWLDataPropertyRangeAxiom( p, (OWLDataRange) e );
        }
      }
    }
    else if( term.getAFun().equals( ATermUtils.INVPROPFUN ) ) {
      OWLObjectProperty p1 = (OWLObjectProperty) conceptConverter.convert( (ATermAppl) term
          .getArgument( 0 ) );
      OWLObjectProperty p2 = (OWLObjectProperty) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );

      if( p1 != null && p2 != null )
        axiom = factory.getOWLInverseObjectPropertiesAxiom( p1, p2 );
    }
    else if( term.getAFun().equals( ATermUtils.TRANSITIVEFUN ) ) {
      OWLObjectProperty p = (OWLObjectProperty) conceptConverter.convert( (ATermAppl) term
          .getArgument( 0 ) );

      if( p != null )
        axiom = factory.getOWLTransitiveObjectPropertyAxiom( p );
    }
    else if( term.getAFun().equals( ATermUtils.FUNCTIONALFUN ) ) {
      OWLObject p = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );

      if( p != null ) {
        if( p instanceof OWLObjectProperty )
          axiom = factory
              .getOWLFunctionalObjectPropertyAxiom( (OWLObjectPropertyExpression) p );
        else if( p instanceof OWLDataProperty )
          axiom = factory
              .getOWLFunctionalDataPropertyAxiom( (OWLDataPropertyExpression) p );
      }
    }
    else if( term.getAFun().equals( ATermUtils.INVFUNCTIONALFUN ) ) {
      OWLObjectProperty p = (OWLObjectProperty) conceptConverter.convert( (ATermAppl) term
          .getArgument( 0 ) );

      if( p != null )
        axiom = factory.getOWLInverseFunctionalObjectPropertyAxiom( p );
    }
    else if( term.getAFun().equals( ATermUtils.SYMMETRICFUN ) ) {
      OWLObject p = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );

      if( p != null && p instanceof OWLObjectPropertyExpression )
        axiom = factory
            .getOWLSymmetricObjectPropertyAxiom( (OWLObjectPropertyExpression) p );
    }
    else if( term.getAFun().equals( ATermUtils.ASYMMETRICFUN ) ) {
      OWLObject p = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );

      if( p != null && p instanceof OWLObjectPropertyExpression )
        axiom = factory
            .getOWLAntiSymmetricObjectPropertyAxiom( (OWLObjectPropertyExpression) p );
    }
    else if( term.getAFun().equals( ATermUtils.REFLEXIVEFUN ) ) {
      OWLObject p = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );

      if( p != null && p instanceof OWLObjectPropertyExpression )
        axiom = factory
            .getOWLReflexiveObjectPropertyAxiom( (OWLObjectPropertyExpression) p );
    }
    else if( term.getAFun().equals( ATermUtils.IRREFLEXIVEFUN ) ) {
      OWLObject p = conceptConverter.convert( (ATermAppl) term.getArgument( 0 ) );

      if( p != null && p instanceof OWLObjectPropertyExpression )
        axiom = factory
            .getOWLIrreflexiveObjectPropertyAxiom( (OWLObjectPropertyExpression) p );
    }
    else if( term.getAFun().equals( ATermUtils.TYPEFUN ) ) {
      OWLIndividual i = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
          .getArgument( 0 ) );
      OWLDescription c = (OWLDescription) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );

      if( i != null && c != null )
        axiom = factory.getOWLClassAssertionAxiom( i, c );
    }
    else if( term.getAFun().equals( ATermUtils.PROPFUN ) ) {
      OWLIndividual subj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term.getArgument( 1 ) );

      if( subj == null )
        axiom = null;
      else if( ATermUtils.isLiteral( (ATermAppl) term.getArgument( 2 ) ) ) {
        OWLDataProperty pred = (OWLDataProperty) conceptConverter.convert( (ATermAppl) term
            .getArgument( 0 ) );
        OWLConstant obj = (OWLConstant) conceptConverter.convert( (ATermAppl) term
            .getArgument( 2 ) );
        if( pred != null && obj != null )
          axiom = factory.getOWLDataPropertyAssertionAxiom( subj, pred, obj );
      }
      else {
        OWLObjectProperty pred = (OWLObjectProperty) conceptConverter
            .convert( (ATermAppl) term.getArgument( 0 ) );
        OWLIndividual obj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term.getArgument( 2 ) );
        if( pred != null && obj != null )
          axiom = factory.getOWLObjectPropertyAssertionAxiom( subj, pred, obj );
      }
    }
    else if( term.getAFun().equals( ATermUtils.NOTFUN )
        && ((ATermAppl) term.getArgument( 0 )).getAFun().equals( ATermUtils.PROPFUN ) ) {
      term = (ATermAppl) term.getArgument( 0 );
      OWLIndividual subj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );

      if( subj == null )
        axiom = null;
      else if( ATermUtils.isLiteral( (ATermAppl) term.getArgument( 2 ) ) ) {
        OWLDataProperty pred = (OWLDataProperty) conceptConverter.convert( (ATermAppl) term
            .getArgument( 0 ) );
        OWLConstant obj = (OWLConstant) conceptConverter.convert( (ATermAppl) term
            .getArgument( 2 ) );
        if( pred != null && obj != null )
          axiom = factory.getOWLNegativeDataPropertyAssertionAxiom( subj, pred, obj );
      }
      else {
        OWLObjectProperty pred = (OWLObjectProperty) conceptConverter
            .convert( (ATermAppl) term.getArgument( 0 ) );
        OWLIndividual obj = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
            .getArgument( 2 ) );;
        if( pred != null && obj != null )
          axiom = factory.getOWLNegativeObjectPropertyAssertionAxiom( subj, pred, obj );
View Full Code Here

      ATermAppl i2 = (ATermAppl) term.getArgument( 2 );
      SWRLAtomIObject io1 = parseToAtomIObject( i1 );

      if( kb.isObjectProperty( p ) ) {
        SWRLAtomIObject io2 = parseToAtomIObject( i2 );
        OWLObjectProperty op = factory.getOWLObjectProperty( URI.create( p.getName() ) );
        atom = factory.getSWRLObjectPropertyAtom( op, io1, io2 );
      }
      else if( kb.isDatatypeProperty( p ) ) {
        SWRLAtomDObject do2 = parseToAtomDObject( i2 );
        OWLDataProperty dp = factory.getOWLDataProperty( URI.create( p.getName() ) );
View Full Code Here

TOP

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

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.