/** * {@inheritDoc} */ public void visit(AtomDVariable variable) { term = ATermUtils.makeVar( variable.getName() ); }
private AtomDObject createRuleDObject(Node node) { if( !node.isLiteral() ) { ATermAppl name = node2term( node ); if( !ATermUtils.isPrimitive( name ) ) { addUnsupportedFeature( "Cannot create rule data variable out of " + node ); return null; } return new AtomDVariable( name.toString() ); } else { return new AtomDConstant( node2term( node ) ); } }
@Override public void visit(SWRLVariable var) { swrlDObject = new AtomDVariable( var.getIRI().toString() ); swrlIObject = new AtomIVariable( var.getIRI().toString() ); }
public void visit(SWRLVariable var) { swrlDObject = new AtomDVariable( var.getIRI().toString() ); swrlIObject = new AtomIVariable( var.getIRI().toString() ); }
/** * {@inheritDoc} */ public void visit(AtomDVariable variable) { term = ATermUtils.makeVar( variable.getName() ); }
private AtomDObject convertAtomDObject(ATermAppl t) { if( ATermUtils.isVar( t ) ) return new AtomDVariable( ((ATermAppl) t.getArgument( 0 )).getName() ); else if( ATermUtils.isLiteral( t ) ) return new AtomDConstant( t ); throw new InternalReasonerException( "Unrecognized term: " + t ); }
public void visit(AtomDVariable variable) { result = ATermUtils.makeVar(variable.getName()); }
private AtomDObject convertAtomDObject(ATermAppl t) { if( ATermUtils.isVar( t ) ) return new AtomDVariable( ((ATermAppl) t.getArgument( 0 )).getName() ); else if( ATermUtils.isLiteral( t ) ) return new AtomDConstant( t ); throw new InternalReasonerException( "Unrecognized term: " + t ); }
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 ) ); }
varCount++; if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom);
varCount++; if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom);
varCount++; if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom);
varCount++; if( kb.isDatatypeProperty( p ) ) { AtomDObject newVar = new AtomDVariable( "var" + varCount ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar ); atoms.add(atom);