public void visit(DatavaluedPropertyAtom atom) { tester = new TestDataProperty( atom.getPredicate(), atom.getArgument1(), atom .getArgument2() ); }
/** * Set the variables this pattern uses in the given map. * @param currentBinding */ public void setCurrentBinding( VariableBinding currentBinding ) { currentBinding.set( pattern.getArgument1(), subject ); currentBinding.set( pattern.getArgument2(), object ); }
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 ) ); }
/** * Checks to see if an object is set (either bound, or a constant) * @return */ private boolean isObjectSet() { return binding.get( pattern.getArgument2() ) != null; }
private Role getRole() { if ( role == null ) role = abox.getRole( pattern.getPredicate() ); return role; }
private Individual getSubject() { return binding.get( pattern.getArgument1() ); }
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 ) ); }
/** * Set the variables this pattern uses in the given map. * @param currentBinding */ public void setCurrentBinding( VariableBinding currentBinding ) { currentBinding.set( pattern.getArgument1(), subject ); currentBinding.set( pattern.getArgument2(), object ); }
/** * Checks to see if an object is set (either bound, or a constant) * @return */ private boolean isObjectSet() { return binding.get( pattern.getArgument2() ) != null; }
private Role getRole() { if ( role == null ) role = abox.getRole( pattern.getPredicate() ); return role; }
private Individual getSubject() { return binding.get( pattern.getArgument1() ); }
public void visit(DatavaluedPropertyAtom atom) { tester = new TestDataProperty( atom.getPredicate(), atom.getArgument1(), atom .getArgument2() ); }
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 );
private Literal getObject() { return binding.get( pattern.getArgument2() ); }
public String toString() { return URIUtils.getLocalName(getPredicate().getName())+"("+getArgument1()+","+getArgument2()+")"; }
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 );
private Literal getObject() { return binding.get( pattern.getArgument2() ); }
public String toString() { return URIUtils.getLocalName(getPredicate().getName())+"("+getArgument1()+","+getArgument2()+")"; }
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 );
/** * {@inheritDoc} */ public void visit(DatavaluedPropertyAtom atom) { ATermAppl p = atom.getPredicate(); ATermAppl s = translate( atom.getArgument1() ); ATermAppl o = translate( atom.getArgument2() ); term = ATermUtils.makePropAtom( p, s, o ); }