public ATermAppl getCanonicalRepresentation(ATermAppl input) throws InvalidLiteralException { if( !ATermUtils.isLiteral( input ) ) throw new IllegalArgumentException(); if( !name.equals( input.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) throw new IllegalArgumentException(); return input; }
public ATermAppl getCanonicalRepresentation(ATermAppl input) throws InvalidLiteralException { if( !ATermUtils.isLiteral( input ) ) throw new IllegalArgumentException(); if( !name.equals( input.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) throw new IllegalArgumentException(); return input; }
public ATermAppl getLiteral(Object value) { if( value instanceof ATermAppl ) { final ATermAppl a = (ATermAppl) value; if( ATermUtils.isLiteral( a ) ) if( name.equals( a.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) return a; } throw new IllegalArgumentException(); }
public ATermAppl getLiteral(Object value) { if (value instanceof ATermAppl) { final ATermAppl a = (ATermAppl) value; if (ATermUtils.isLiteral(a)) if (name.equals(a.getArgument(ATermUtils.LIT_URI_INDEX))) return a; } throw new IllegalArgumentException(); }
public ATermAppl getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !name.equals( literal.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) throw new IllegalArgumentException(); return literal; }
public void visitValue(ATermAppl term) { ATermAppl nominal = (ATermAppl) term.getArgument( 0 ); if( ATermUtils.isLiteral( nominal ) ) isDatatype = true; }
public ATermAppl getLiteral(Object value) { if( value instanceof ATermAppl ) { final ATermAppl a = (ATermAppl) value; if( ATermUtils.isLiteral( a ) ) if( name.equals( a.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) return a; } throw new IllegalArgumentException(); }
public ATermAppl getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !name.equals( literal.getArgument( ATermUtils.LIT_URI_INDEX ) ) ) throw new IllegalArgumentException(); return literal; }
public void visitValue(ATermAppl term) { ATermAppl nominal = (ATermAppl) term.getArgument( 0 ); if( !ATermUtils.isLiteral( nominal ) ) kb.addIndividual( nominal ); }
public Literal addLiteral(ATermAppl dataValue, DependencySet ds) { if( dataValue == null || !ATermUtils.isLiteral( dataValue ) ) { throw new InternalReasonerException( "Invalid value to create a literal. Value: " + dataValue ); } return createLiteral( dataValue, ds ); }
public Double getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !literal.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( literal ); try { return DatatypeConverter.parseDouble( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( name, lexicalForm ); } }
public void visitValue(ATermAppl term) { ATermAppl nom = (ATermAppl) term.getArgument( 0 ); if( !ATermUtils.isLiteral( nom ) ) m_Expressivity.addNominal(nom); else m_Expressivity.setHasUserDefinedDatatype( true ); }
protected Node initNode(ATermAppl name) { if (ATermUtils.isLiteral(name)) { return abox.addLiteral(name); } else { abox.copyOnWrite(); return abox.getIndividual(name); } }
public Float getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !literal.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( literal ); try { return DatatypeConverter.parseFloat( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( name, lexicalForm ); } }
public Float getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !literal.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( literal ); try { return DatatypeConverter.parseFloat( lexicalForm ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( name, lexicalForm ); } }
public Number getValue(ATermAppl literal) throws InvalidLiteralException { if( !ATermUtils.isLiteral( literal ) ) throw new IllegalArgumentException(); if( !literal.getArgument( ATermUtils.LIT_URI_INDEX ).equals( name ) ) throw new IllegalArgumentException(); final String lexicalForm = ATermUtils.getLiteralValue( literal ); try { return OWLRealUtils.getCanonicalObject( DatatypeConverter.parseLong( lexicalForm ) ); } catch( NumberFormatException e ) { throw new InvalidLiteralException( name, lexicalForm ); } }
public void visitValue(ATermAppl term) { ATermAppl nominal = (ATermAppl) term.getArgument(0); if (ATermUtils.isLiteral(nominal)) { visitLiteral(nominal); obj = factory.getOWLDataOneOf((OWLLiteral) obj); } else { obj = factory.getOWLObjectOneOf(convertIndividual(nominal)); } }
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 visitOneOf(ATermAppl term) { ATermList list = (ATermList) term.getArgument( 0 ); visitList( list ); if( list.isEmpty() || !ATermUtils.isLiteral( (ATermAppl) ((ATermAppl) list.getFirst()).getArgument( 0 ) ) ) createClassExpression( OWL.oneOf ); else createDataExpression( OWL.oneOf ); }
private SWRLDArgument parseToAtomDObject(ATermAppl t) { if( ATermUtils.isVar( t ) ) { return factory.getSWRLVariable( IRI.create( ((ATermAppl) t.getArgument( 0 )).getName() ) ); } else if( ATermUtils.isLiteral( t ) ) { return factory.getSWRLLiteralArgument( (OWLLiteral) conceptConverter.convert( t ) ); } throw new InternalReasonerException( "Unrecognized term: " + t ); } }