public void addKey(ATermAppl c, Set<ATermAppl> properties) { int varId = 0; Collection<RuleAtom> head = CollectionUtils.makeSet(); Collection<RuleAtom> body = CollectionUtils.makeSet(); AtomIVariable x = new AtomIVariable( "x" ); AtomIVariable y = new AtomIVariable( "y" ); head.add( new SameIndividualAtom( x, y ) ); // Process the body // First add the property atom pairs for each property for( ATermAppl property : properties ) { if( isObjectProperty( property ) ) { AtomIVariable z = new AtomIVariable( "z" + varId ); body.add( new IndividualPropertyAtom( property, x, z ) ); body.add( new IndividualPropertyAtom( property, y, z ) ); } else if( isDatatypeProperty( property ) ) { AtomDVariable z = new AtomDVariable( "z" + varId ); body.add( new DatavaluedPropertyAtom( property, x, z ) ); body.add( new DatavaluedPropertyAtom( property, y, z ) ); } varId++; } // Then add the class atoms for the two subject variables body.add( new ClassAtom( c, x ) ); body.add( new ClassAtom( c, y ) ); addRule( new Rule( head, body ) ); }
public void addKey(ATermAppl c, Set<ATermAppl> properties) { int varId = 0; Collection<RuleAtom> head = CollectionUtils.makeSet(); Collection<RuleAtom> body = CollectionUtils.makeSet(); AtomIVariable x = new AtomIVariable( "x" ); AtomIVariable y = new AtomIVariable( "y" ); head.add( new SameIndividualAtom( x, y ) ); // Process the body // First add the property atom pairs for each property for( ATermAppl property : properties ) { if( isObjectProperty( property ) ) { AtomIVariable z = new AtomIVariable( "z" + varId ); body.add( new IndividualPropertyAtom( property, x, z ) ); body.add( new IndividualPropertyAtom( property, y, z ) ); } else if( isDatatypeProperty( property ) ) { AtomDVariable z = new AtomDVariable( "z" + varId ); body.add( new DatavaluedPropertyAtom( property, x, z ) ); body.add( new DatavaluedPropertyAtom( property, y, z ) ); } varId++; } // Then add the class atoms for the two subject variables body.add( new ClassAtom( c, x ) ); body.add( new ClassAtom( c, y ) ); addRule( new Rule( head, body ) ); }
if( kb.isDatatypeProperty( p ) ) { AtomDConstant arg = new AtomDConstant( nominal ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg ); atoms.add(atom); if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom); processDatatype( newVar, filler, atoms );
if( kb.isDatatypeProperty( p ) ) { AtomDConstant arg = new AtomDConstant( nominal ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg ); atoms.add(atom); if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom); processDatatype( newVar, filler, atoms );
if( kb.isDatatypeProperty( p ) ) { AtomDConstant arg = new AtomDConstant( nominal ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg ); atoms.add(atom); if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom); processDatatype( newVar, filler, atoms );
if( kb.isDatatypeProperty( p ) ) { AtomDConstant arg = new AtomDConstant( nominal ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg ); atoms.add(atom); if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom); processDatatype( newVar, filler, atoms );
public void visit(SWRLDataPropertyAtom atom) { if( atom.getPredicate().isAnonymous() ) { swrlAtom = null; return; } atom.getFirstArgument().accept( this ); AtomIObject subj = swrlIObject; atom.getSecondArgument().accept( this ); AtomDObject obj = swrlDObject; atom.getPredicate().accept( this ); swrlAtom = new DatavaluedPropertyAtom( term, subj, obj ); }
@Override public void visit(SWRLDataPropertyAtom atom) { if( atom.getPredicate().isAnonymous() ) { swrlAtom = null; return; } atom.getFirstArgument().accept( this ); AtomIObject subj = swrlIObject; atom.getSecondArgument().accept( this ); AtomDObject obj = swrlDObject; atom.getPredicate().accept( this ); swrlAtom = new DatavaluedPropertyAtom( term, subj, obj ); }
kb.addDatatypeProperty( p ); AtomDObject do2 = convertAtomDObject( i2 ); atom = new DatavaluedPropertyAtom( p, io1, do2 );
kb.addDatatypeProperty( p ); AtomDObject do2 = convertAtomDObject( i2 ); atom = new DatavaluedPropertyAtom( p, io1, do2 );
atom = new DatavaluedPropertyAtom( pred, argument1, argument2 );