OWL2Datatype(@Nonnull XSDVocabulary xsd, @Nonnull Category category, boolean finite, @Nonnull String regEx) { iri = xsd.getIRI(); shortForm = xsd.getShortForm(); prefixedName = xsd.getPrefixedName(); this.category = category; this.finite = finite; regExpression = regEx; }
OWL2Datatype(XSDVocabulary xsd, Category category, boolean finite, String regEx) { iri = xsd.getIRI(); shortForm = xsd.getShortForm(); prefixedName = xsd.getPrefixedName(); this.category = category; this.finite = finite; regExpression = regEx; pattern = Pattern.compile(regEx, Pattern.DOTALL); }
OWL2Datatype(XSDVocabulary xsd, Category category, boolean finite, String regEx) { iri = xsd.getIRI(); shortForm = xsd.getShortForm(); prefixedName = xsd.getPrefixedName(); this.category = category; this.finite = finite; regExpression = regEx; pattern = Pattern.compile(regEx, Pattern.DOTALL); }
OWL2Datatype(XSDVocabulary xsd, Category category, boolean finite, String regEx) { iri = xsd.getIRI(); shortForm = xsd.getShortForm(); prefixedName = xsd.getPrefixedName(); this.category = category; this.finite = finite; regExpression = regEx; pattern = Pattern.compile(regEx, Pattern.DOTALL); }
@Override public boolean getBoolean() throws LiteralException { if (!isBoolean()) throw new LiteralException( "cannot convert value of type " + this.literal.getDatatype() + " to " + XSDVocabulary.BOOLEAN .getPrefixedName()); return Boolean.parseBoolean(this.literal.getLiteral()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(int i) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(i), XSDVocabulary.INT.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(double d) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(d), XSDVocabulary.DOUBLE.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(short s) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(s), XSDVocabulary.SHORT.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(boolean b) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(b), XSDVocabulary.BOOLEAN.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull BigInteger i) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(i), XSDVocabulary.INTEGER.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull XSDDuration duration) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(duration), XSDVocabulary.DURATION.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull URI uri) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(uri), XSDVocabulary.ANY_URI.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull XSDDateTime dateTime) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(dateTime), XSDVocabulary.DATE_TIME.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull XSDDate date) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(date), XSDVocabulary.DATE.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull String s) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(s), XSDVocabulary.STRING.getPrefixedName()); }
@NonNull @Override public SQWRLLiteralResultValue getLiteralValue(@NonNull XSDTime time) { return new DefaultSQWRLLiteralResultValue(getOWLLiteralFactory().getOWLLiteral(time), XSDVocabulary.TIME.getPrefixedName()); }
@NonNull @Override public XSDTime getTime() throws LiteralException { if (!isTime()) throw new LiteralException( "cannot convert value of type " + this.literal.getDatatype() + " to " + XSDVocabulary.TIME.getPrefixedName()); return new XSDTime(this.literal.getLiteral()); }
@NonNull @Override public XSDDate getDate() throws LiteralException { if (!isDate()) throw new LiteralException( "cannot convert value of type " + this.literal.getDatatype() + " to " + XSDVocabulary.DATE.getPrefixedName()); return new XSDDate(this.literal.getLiteral()); }
@NonNull @Override public XSDDuration getDuration() throws LiteralException { if (!isDuration()) throw new LiteralException( "cannot convert value of type " + this.literal.getDatatype() + " to " + XSDVocabulary.DURATION .getPrefixedName()); return new XSDDuration(this.literal.getLiteral()); }
@NonNull @Override public XSDDateTime getDateTime() throws LiteralException { if (!isDateTime()) throw new LiteralException( "cannot convert value of type " + this.literal.getDatatype() + " to " + XSDVocabulary.DATE_TIME .getPrefixedName()); return new XSDDateTime(this.literal.getLiteral()); }