Examples of SWRLIArgument


Examples of org.semanticweb.owlapi.model.SWRLIArgument


    public SWRLSameIndividualAtom parseSameAsAtom() throws ParserException {
        consumeToken(ManchesterOWLSyntax.SAME_AS.toString());
        consumeToken("(");
        SWRLIArgument obj1 = parseIObject();
        consumeToken(",");
        SWRLIArgument obj2 = parseIObject();
        consumeToken(")");
        return dataFactory.getSWRLSameIndividualAtom(obj1, obj2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

            List<SWRLDArgument> args = listTranslator.translateList(mainIRI);
            return dataFactory.getSWRLBuiltInAtom(builtInIRI, args);
        }
        else if (consumer.isSWRLClassAtom(firstObject)) {
            // C(?x) or C(ind)
            SWRLIArgument iObject = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
            IRI classIRI = consumer.getResourceObject(firstObject, CLASS_PREDICATE.getIRI(), true);
            OWLClassExpression desc = consumer.translateClassExpression(classIRI);
            return dataFactory.getSWRLClassAtom(desc, iObject);
        }
        else if (consumer.isSWRLDataRangeAtom(firstObject)) {
            // DR(?x) or DR(val)
            SWRLDArgument dObject = translateSWRLAtomDObject(firstObject, ARGUMENT_1.getIRI());
            IRI dataRangeIRI = consumer.getResourceObject(firstObject, DATA_RANGE.getIRI(), true);
            OWLDataRange dataRange = consumer.translateDataRange(dataRangeIRI);
            return dataFactory.getSWRLDataRangeAtom(dataRange, dObject);
        }
        else if (consumer.isSWRLDataValuedPropertyAtom(firstObject)) {
            SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
            SWRLDArgument arg2 = translateSWRLAtomDObject(firstObject, ARGUMENT_2.getIRI());
            IRI dataPropertyIRI = consumer.getResourceObject(firstObject, PROPERTY_PREDICATE.getIRI(), true);
            OWLDataPropertyExpression prop = consumer.translateDataPropertyExpression(dataPropertyIRI);
            return dataFactory.getSWRLDataPropertyAtom(prop, arg1, arg2);
        }
        else if (consumer.isSWRLIndividualPropertyAtom(firstObject)) {
            SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
            SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject, ARGUMENT_2.getIRI());
            IRI objectPropertyIRI = consumer.getResourceObject(firstObject, PROPERTY_PREDICATE.getIRI(), true);
            OWLObjectPropertyExpression prop = consumer.translateObjectPropertyExpression(objectPropertyIRI);
            return dataFactory.getSWRLObjectPropertyAtom(prop, arg1, arg2);
        }
        else if (consumer.isSWRLSameAsAtom(firstObject)) {
            SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
            SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject, ARGUMENT_2.getIRI());
            return dataFactory.getSWRLSameIndividualAtom(arg1, arg2);
        }
        else if (consumer.isSWRLDifferentFromAtom(firstObject)) {
            SWRLIArgument arg1 = translateSWRLAtomIObject(firstObject, ARGUMENT_1.getIRI());
            SWRLIArgument arg2 = translateSWRLAtomIObject(firstObject, ARGUMENT_2.getIRI());
            return dataFactory.getSWRLDifferentIndividualsAtom(arg1, arg2);
        }
        throw new RuntimeException("Don't know how to translate SWRL Atom: " + firstObject);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

   
  }

  final public SWRLClassAtom ClassAtom() throws ParseException {
    OWLClassExpression ce;
    SWRLIArgument arg0;
    jj_consume_token(CLASSATOM);
    jj_consume_token(OPENPAR);
    ce = ClassExpression();
    arg0 = IArg();
    jj_consume_token(CLOSEPAR);
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

   
  }

  final public SWRLObjectPropertyAtom ObjectPropertyAtom() throws ParseException {
    OWLObjectPropertyExpression prop;
    SWRLIArgument arg0;
    SWRLIArgument arg1;
    jj_consume_token(OBJECTPROPERTYATOM);
    jj_consume_token(OPENPAR);
    prop = ObjectPropertyExpression();
    arg0 = IArg();
    arg1 = IArg();
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

   
  }

  final public SWRLDataPropertyAtom DataPropertyAtom() throws ParseException {
    OWLDataProperty prop;
    SWRLIArgument arg0;
    SWRLDArgument arg1;
    jj_consume_token(DATAPROPERTYATOM);
    jj_consume_token(OPENPAR);
    prop = DataPropertyIRI();
    arg0 = IArg();
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

                                                                                                                                                  return dataFactory.getSWRLBuiltInAtom(iri, args);

  }

  final public SWRLSameIndividualAtom SameIndividualAtom() throws ParseException {
    SWRLIArgument arg0;
    SWRLIArgument arg1;
    jj_consume_token(SAMEINDIVIDUALATOM);
    jj_consume_token(OPENPAR);
    arg0 = IArg();
    arg1 = IArg();
    jj_consume_token(CLOSEPAR);
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

                                                                      return dataFactory.getSWRLSameIndividualAtom(arg0, arg1);

  }

  final public SWRLDifferentIndividualsAtom DifferentIndividualsAtom() throws ParseException {
    SWRLIArgument arg0;
    SWRLIArgument arg1;
    jj_consume_token(DIFFERENTINDIVIDUALSATOM);
    jj_consume_token(OPENPAR);
    arg0 = IArg();
    arg1 = IArg();
    jj_consume_token(CLOSEPAR);
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

      ATermAppl i = (ATermAppl) term.getArgument( 0 );
      OWLObject type = conceptConverter.convert( (ATermAppl) term
          .getArgument( 1 ) );
     
      if( type instanceof OWLClassExpression ) {
        SWRLIArgument io = parseToAtomIObject( i )
        atom = factory.getSWRLClassAtom( (OWLClassExpression) type, io );
      }
      else if( type instanceof OWLDataRange ) {
        SWRLDArgument io = parseToAtomDObject( i )
        atom = factory.getSWRLDataRangeAtom( (OWLDataRange) type, io );
      }
      else {
        throw new InternalReasonerException( "Cannot convert to SWRL atom: "
            + ATermUtils.toString( term ) );
      }
    }
    else if( term.getAFun().equals( ATermUtils.PROPFUN ) ) {
      ATermAppl p = (ATermAppl) term.getArgument( 0 );
      ATermAppl i1 = (ATermAppl) term.getArgument( 1 );
      ATermAppl i2 = (ATermAppl) term.getArgument( 2 );
      SWRLIArgument io1 = parseToAtomIObject( i1 );

      if( kb.isObjectProperty( p ) ) {
        SWRLIArgument io2 = parseToAtomIObject( i2 );
        OWLObjectProperty op = factory.getOWLObjectProperty( IRI.create( p.getName() ) );
        atom = factory.getSWRLObjectPropertyAtom( op, io1, io2 );
      }
      else if( kb.isDatatypeProperty( p ) ) {
        SWRLDArgument do2 = parseToAtomDObject( i2 );
        OWLDataProperty dp = factory.getOWLDataProperty( IRI.create( p.getName() ) );
        atom = factory.getSWRLDataPropertyAtom( dp, io1, do2 );
      }
    }
    else if( term.getAFun().equals( ATermUtils.SAMEASFUN ) ) {
      ATermAppl i1 = (ATermAppl) term.getArgument( 0 );
      ATermAppl i2 = (ATermAppl) term.getArgument( 1 );
      SWRLIArgument io1 = parseToAtomIObject( i1 );
      SWRLIArgument io2 = parseToAtomIObject( i2 );
     
      atom = factory.getSWRLSameIndividualAtom( io1, io2 );     
    }
    else if( term.getAFun().equals( ATermUtils.DIFFERENTFUN ) ) {
      ATermAppl i1 = (ATermAppl) term.getArgument( 0 );
      ATermAppl i2 = (ATermAppl) term.getArgument( 1 );
      SWRLIArgument io1 = parseToAtomIObject( i1 );
      SWRLIArgument io2 = parseToAtomIObject( i2 );
     
      atom = factory.getSWRLDifferentIndividualsAtom( io1, io2 );     
    }
    else if( term.getAFun().equals( ATermUtils.BUILTINFUN ) ) {
      ATermList args = (ATermList) term.getArgument( 0 );
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

 
  public SWRLAtom toSWRL(OWLDataFactory factory) {
   
    OWLClass classPredicate = factory.getOWLClass(IRI.create(classResource.getURI().toString()));
   
    SWRLIArgument argumentResource;
    if(argument1 instanceof ResourceAtom){
      OWLIndividual owlIndividual = factory.getOWLNamedIndividual(IRI.create(argument1.getURI().toString()));
      argumentResource = factory.getSWRLIndividualArgument(owlIndividual);
    }
    else{
View Full Code Here

Examples of org.semanticweb.owlapi.model.SWRLIArgument

    @Override
    public SWRLAtom toSWRL(OWLDataFactory factory) {
        OWLObjectProperty owlObjectProperty = factory.getOWLObjectProperty(IRI.create(objectProperty.getURI()
                .toString()));

        SWRLIArgument swrliArgument1;
        SWRLIArgument swrliArgument2;

        if (argument1 instanceof VariableAtom) {
            swrliArgument1 = factory.getSWRLVariable(IRI.create(argument1.getURI().toString()));
        } else {
            OWLIndividual owlIndividual = factory.getOWLNamedIndividual(IRI.create(argument1.getURI()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.