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 ) ); }
RuleAtom atom = new IndividualPropertyAtom( p, var, arg ); atoms.add(atom); RuleAtom atom = new IndividualPropertyAtom( p, var, newVar ); atoms.add(atom); varCount = processClass( newVar, filler, atoms, varCount );
RuleAtom atom = new IndividualPropertyAtom( p, var, arg ); atoms.add(atom); RuleAtom atom = new IndividualPropertyAtom( p, var, newVar ); atoms.add(atom); varCount = processClass( newVar, filler, atoms, varCount );
RuleAtom atom = new IndividualPropertyAtom( p, var, arg ); atoms.add(atom); RuleAtom atom = new IndividualPropertyAtom( p, var, newVar ); atoms.add(atom); varCount = processClass( newVar, filler, atoms, varCount );
RuleAtom atom = new IndividualPropertyAtom( p, var, arg ); atoms.add(atom); RuleAtom atom = new IndividualPropertyAtom( p, var, newVar ); atoms.add(atom); varCount = processClass( newVar, filler, atoms, varCount );
@Override public void visit(SWRLObjectPropertyAtom atom) { if( atom.getPredicate().isAnonymous() ) { swrlAtom = null; return; } atom.getFirstArgument().accept( this ); AtomIObject subj = swrlIObject; atom.getSecondArgument().accept( this ); AtomIObject obj = swrlIObject; atom.getPredicate().accept( this ); swrlAtom = new IndividualPropertyAtom( term, subj, obj ); }
public void visit(SWRLObjectPropertyAtom atom) { if( atom.getPredicate().isAnonymous() ) { swrlAtom = null; return; } atom.getFirstArgument().accept( this ); AtomIObject subj = swrlIObject; atom.getSecondArgument().accept( this ); AtomIObject obj = swrlIObject; atom.getPredicate().accept( this ); swrlAtom = new IndividualPropertyAtom( term, subj, obj ); }
kb.addObjectProperty( p ); AtomIObject io2 = convertAtomIObject( i2 ); atom = new IndividualPropertyAtom( p, io1, io2 );
kb.addObjectProperty( p ); AtomIObject io2 = convertAtomIObject( i2 ); atom = new IndividualPropertyAtom( p, io1, io2 );
atom = new IndividualPropertyAtom( pred, argument1, argument2 );