Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLIndividual


      }
    }
  }

  public void visit(OWLClassAssertionAxiom axiom) {
    OWLIndividual ind = axiom.getIndividual();
    OWLDescription c = axiom.getDescription();

    if( ind.isAnonymous() )
      isEntailed = reasoner.isSatisfiable( c );
    else
      isEntailed = reasoner.hasType( ind, c );
  }
View Full Code Here


  public void visit(OWLSameIndividualsAxiom axiom) {
    isEntailed = true;

    Iterator<OWLIndividual> i = axiom.getIndividuals().iterator();
    if( i.hasNext() ) {
      OWLIndividual first = i.next();

      while( i.hasNext() ) {
        OWLIndividual next = i.next();

        if( !reasoner.isSameAs( first, next ) ) {
          isEntailed = false;
          return;
        }
View Full Code Here

    OWLPropertyExpression<?,?> prop = (OWLPropertyExpression<?,?>) obj;

    visit( (ATermAppl) ((ATermAppl) term.getArgument( 1 )).getArgument( 0 ) );

    if( prop instanceof OWLObjectProperty ) {
      OWLIndividual ind = (OWLIndividual) obj;

      obj = factory.getOWLObjectValueRestriction( (OWLObjectPropertyExpression) prop, ind );
    }
    else {
      OWLConstant dataVal = (OWLConstant) obj;
View Full Code Here

      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 );
      }
    }
    else if( term.getAFun().equals( ATermUtils.SAMEASFUN ) ) {
      OWLIndividual ind1 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
          .getArgument( 0 ) );;
      OWLIndividual ind2 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );;

      Set<OWLIndividual> inds = new HashSet<OWLIndividual>();
      inds.add( ind1 );
      inds.add( ind2 );

      if( ind1 != null && ind2 != null )
        axiom = factory.getOWLSameIndividualsAxiom( inds );
    }
    else if( term.getAFun().equals( ATermUtils.DIFFERENTFUN ) ) {
      OWLIndividual ind1 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
          .getArgument( 0 ) );;
      OWLIndividual ind2 = (OWLIndividual) conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );;

      Set<OWLIndividual> inds = new HashSet<OWLIndividual>();
      inds.add( ind1 );
      inds.add( ind2 );

      if( ind1 != null && ind2 != null )
        axiom = factory.getOWLDifferentIndividualsAxiom( inds );
    }
    else if( term.getAFun().equals( ATermUtils.ALLDIFFERENTFUN ) ) {
      Set<OWLIndividual> individuals = new HashSet<OWLIndividual>();

      ATermList list = (ATermList) term.getArgument( 0 );
      for( ; !list.isEmpty(); list = list.getNext() ) {
        ATermAppl ind = (ATermAppl) list.getFirst();
        OWLIndividual i = (OWLIndividual) conceptConverter.convert( ind );;
        if( i == null )
          break;

        individuals.add( i );
      }
View Full Code Here

TOP

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

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.