@Override public void visit(SWRLLiteralArgument cons) { cons.getLiteral().accept( this ); swrlDObject = new AtomDConstant( term ); }
public Literal set( AtomDVariable key, ATermAppl value ) { AtomDConstant constant = new AtomDConstant( value ); DataValueCollector collector = new DataValueCollector(); constant.accept( collector ); return set( key, collector.getValue() ); }
/** * {@inheritDoc} */ public void visit(AtomDConstant constant) { term = constant.getValue(); }
public void visit(SWRLLiteralArgument cons) { cons.getLiteral().accept( this ); swrlDObject = new AtomDConstant( term ); }
public Literal set( AtomDVariable key, ATermAppl value ) { AtomDConstant constant = new AtomDConstant( value ); DataValueCollector collector = new DataValueCollector(); constant.accept( collector ); return set( key, collector.getValue() ); }
/** * {@inheritDoc} */ public void visit(AtomDConstant constant) { term = constant.getValue(); }
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 ) ); } }
public String toString() { return ATermUtils.toString( getValue() ); }
if( builtin != null ) { ATermAppl value = (ATermAppl) facetRestriction.getArgument( 1 ); atoms.add( new BuiltInAtom( builtin, var, new AtomDConstant( value ) ) );
public String toString() { return ATermUtils.toString( getValue() ); }
if( builtin != null ) { ATermAppl value = (ATermAppl) facetRestriction.getArgument( 1 ); atoms.add( new BuiltInAtom( builtin, var, new AtomDConstant( value ) ) );
public void visit(AtomDConstant constant) { ATermAppl canonical; final ATermAppl literal = constant.getValue(); try { canonical = abox.getKB().getDatatypeReasoner() .getCanonicalRepresentation(literal); } catch( InvalidLiteralException e ) { final String msg = format( "Invalid literal (%s) in SWRL data constant: %s", literal, e.getMessage() ); if( PelletOptions.INVALID_LITERAL_AS_INCONSISTENCY ) { log.fine( msg ); canonical = literal; } else { log.severe( msg ); throw new InternalReasonerException( msg, e ); } } catch( UnrecognizedDatatypeException e ) { final String msg = format( "Unrecognized datatype in literal appearing (%s) in SWRL data constant: %s", literal, e.getMessage() ); log.severe( msg ); throw new InternalReasonerException( msg, e ); } result = canonical; }
if( builtin != null ) { ATermAppl value = (ATermAppl) facetRestriction.getArgument( 1 ); atoms.add( new BuiltInAtom( builtin, var, new AtomDConstant( value ) ) );
public void visit( AtomDConstant constant ) { ATermAppl canonical; final ATermAppl literal = constant.getValue(); try { canonical = abox.getKB().getDatatypeReasoner().getCanonicalRepresentation( literal ); } catch( InvalidLiteralException e ) { final String msg = format( "Invalid literal (%s) in SWRL data constant: %s", literal, e.getMessage() ); if( PelletOptions.INVALID_LITERAL_AS_INCONSISTENCY ) { canonical = literal; } else { log.severe( msg ); throw new InternalReasonerException( msg, e ); } } catch( UnrecognizedDatatypeException e ) { final String msg = format( "Unrecognized datatype in literal appearing (%s) in SWRL data constant: %s", literal, e.getMessage() ); log.severe( msg ); throw new InternalReasonerException( msg, e ); } abox.copyOnWrite(); value = abox.getLiteral( canonical ); if ( value == null ) value = abox.addLiteral( canonical ); }
if( builtin != null ) { ATermAppl value = (ATermAppl) facetRestriction.getArgument( 1 ); atoms.add( new BuiltInAtom( builtin, var, new AtomDConstant( value ) ) );
public void visit( AtomDConstant constant ) { ATermAppl canonical; final ATermAppl literal = constant.getValue(); try { canonical = abox.getKB().getDatatypeReasoner().getCanonicalRepresentation( literal ); } catch( InvalidLiteralException e ) { final String msg = format( "Invalid literal (%s) in SWRL data constant: %s", literal, e.getMessage() ); if( PelletOptions.INVALID_LITERAL_AS_INCONSISTENCY ) { canonical = literal; } else { log.severe( msg ); throw new InternalReasonerException( msg, e ); } } catch( UnrecognizedDatatypeException e ) { final String msg = format( "Unrecognized datatype in literal appearing (%s) in SWRL data constant: %s", literal, e.getMessage() ); log.severe( msg ); throw new InternalReasonerException( msg, e ); } abox.copyOnWrite(); value = abox.getLiteral( canonical ); if ( value == null ) value = abox.addLiteral( canonical ); }
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(AtomDConstant constant) { ATermAppl canonical; final ATermAppl literal = constant.getValue(); try { canonical = abox.getKB().getDatatypeReasoner() .getCanonicalRepresentation(literal); } catch( InvalidLiteralException e ) { final String msg = format( "Invalid literal (%s) in SWRL data constant: %s", literal, e.getMessage() ); if( PelletOptions.INVALID_LITERAL_AS_INCONSISTENCY ) { canonical = literal; } else { throw new InternalReasonerException( msg, e ); } } catch( UnrecognizedDatatypeException e ) { final String msg = format( "Unrecognized datatype in literal appearing (%s) in SWRL data constant: %s", literal, e.getMessage() ); throw new InternalReasonerException( msg, e ); } result = new ConstantNodeProvider(abox.addLiteral(canonical)); }
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 ); }
ATermAppl nominal = (ATermAppl) filler.getArgument( 0 ); if( kb.isDatatypeProperty( p ) ) { AtomDConstant arg = new AtomDConstant( nominal ); RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg ); atoms.add(atom);