Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLDataProperty


        this.predicate = predicate;
    }

    public void handleTriple(URI subject, URI predicate, OWLConstant object) throws OWLException {
        OWLIndividual subj = getDataFactory().getOWLIndividual(subject);
        OWLDataProperty prop = getDataFactory().getOWLDataProperty(predicate);
        addAxiom(getDataFactory().getOWLDataPropertyAssertionAxiom(subj, prop, object));
    }
View Full Code Here


      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() );
View Full Code Here

    OWLOntology ont = loadOntology( base + "RemoveLiteral.owl" );

    Reasoner reasoner = new Reasoner( OWL.manager );
    reasoner.setOntology( ont );

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

    OWLIndividual ind = Individual( ns + "ind1" );

    OWLConstant valDouble = ind.getDataPropertyValues( ont ).get(pDouble).iterator().next();
    OWLConstant valInt = ind.getDataPropertyValues( ont ).get(pInt).iterator().next();
View Full Code Here

  public void visit(OWLEquivalentDataPropertiesAxiom axiom) {
    isEntailed = true;
 
    Iterator<OWLDataPropertyExpression> i = axiom.getProperties().iterator();
    if( i.hasNext() ) {
      OWLDataProperty first = (OWLDataProperty) i.next();

      while( i.hasNext() && isEntailed ) {
        OWLDataProperty next = (OWLDataProperty) i.next();

        isEntailed = reasoner.isEquivalentProperty( first, next );
      }
    }
  }
View Full Code Here

    }

    Object[] disjs = axiom.getProperties().toArray();
    for( int i = 0; i < disjs.length; i++ ) {
      for( int j = i + 1; j < disjs.length; j++ ) {
        OWLDataProperty desc1 = (OWLDataProperty) disjs[i];
        OWLDataProperty desc2 = (OWLDataProperty) disjs[j];
        desc1.accept( this );
        ATermAppl p1 = term;
        desc2.accept( this );
        ATermAppl p2 = term;

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

              .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 );
View Full Code Here

        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() ) );
        atom = factory.getSWRLDataValuedPropertyAtom( dp, io1, do2 );
      }
    }
    else if( term.getAFun().equals( ATermUtils.SAMEASFUN ) ) {
      ATermAppl i1 = (ATermAppl) term.getArgument( 0 );
View Full Code Here

            OWLRestrictedDataRangeFacetVocabulary.MIN_EXCLUSIVE, 1);
    OWLDataRangeRestriction dataRangeRestriction = factory
        .getOWLDataRangeRestriction(dataRange,
            dataRangeFacetRestriction);

    OWLDataProperty p = factory.getOWLDataProperty(URI
        .create("http://example#p"));
    OWLDataSomeRestriction dataSomeRestriction = factory
        .getOWLDataSomeRestriction(p, dataRangeRestriction);

    OWLClass c = factory.getOWLClass(URI.create("http://example#c"));
View Full Code Here

TOP

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

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.