@Override public Optional<TermType> inferTypeFromArgumentTypes(ImmutableList<Optional<TermType>> argumentTypes) { argumentValidator.validate(argumentTypes); return termTypeInferenceRule.inferTypeFromArgumentTypes(argumentTypes); }
protected static TermType castStringLangType(TermType termType) { switch (termType.getColType()) { case LANG_STRING: case STRING: return termType; default: return TYPE_FACTORY.getTermType(STRING); } } }
protected TermTypeImpl(String name, TermTypeAncestry parentAncestry, boolean isAbstract) { this.name = name; this.isAbstract = isAbstract; this.ancestry = parentAncestry.newAncestry(this); }
default RDFDatatype getXsdDatetimeDatatype() { return getDatatype(XSD.DATETIME); } }
public NonIntegerNumericInferenceRule(TypeFactory typeFactory) { integerDatatype = typeFactory.getXsdIntegerDatatype(); decimalDatatype = typeFactory.getXsdDecimalDatatype(); }
private static Predicate.COL_TYPE getCastType(TermType termType) { Predicate.COL_TYPE type = termType.getColType(); switch (type) { case OBJECT: case BNODE: case NULL: return LITERAL; default: return type; } }
@Override public ConcreteNumericRDFDatatype getCommonPropagatedOrSubstitutedType(ConcreteNumericRDFDatatype otherType){ if (equals(otherType)) return this; if (promotedHierarchy.contains(otherType)) return otherType; TypePropagationSubstitutionHierarchy otherHierarchy = otherType.getPromotionSubstitutionHierarchy(); if (otherHierarchy.contains(this)) return this; return promotedHierarchy.getClosestCommonType(otherHierarchy); }
/** * Do not use this construction if you know the language tag! */ public PredefinedTermTypeInferenceRule(Predicate.COL_TYPE predefinedColType) { this(TYPE_FACTORY.getTermType(predefinedColType)); }
private static int COLTYPEtoInt(ObjectRDFType t) { return t.isBlankNode() ? OBJ_TYPE_BNode : OBJ_TYPE_URI; }
private ConcreteNumericRDFDatatypeImpl(IRI datatypeIRI, TermTypeAncestry parentAncestry, TypePropagationSubstitutionHierarchy promotedParentHierarchy, boolean appendToPromotedHierarchy) { super(datatypeIRI, parentAncestry, false); promotedHierarchy = appendToPromotedHierarchy ? promotedParentHierarchy.newHierarchy(this) : promotedParentHierarchy; }
@Override public ImmutableList<TermType> getExpectedBaseArgumentTypes() { return argumentValidator.getExpectedBaseArgumentTypes(); }
@Override public TermType getExpectedBaseType(int index) { return argumentValidator.getExpectedBaseType(index); }
default RDFDatatype getXsdDecimalDatatype() { return getDatatype(XSD.DECIMAL); }
private static Predicate.COL_TYPE getCastType(TermType termType) { Predicate.COL_TYPE type = termType.getColType(); switch (type) { case OBJECT: case BNODE: case NULL: return LITERAL; default: return type; } }
default RDFDatatype getXsdFloatDatatype() { return getDatatype(XSD.FLOAT); }
UndeterminedTripleObjectType(String predicateName, TermType tripleObjectType) { super("Internal bug: undetermined type (" + tripleObjectType.getColType() + ") for " + predicateName); } }
default RDFDatatype getXsdStringDatatype() { return getDatatype(XSD.STRING); }
default RDFDatatype getXsdIntegerDatatype() { return getDatatype(XSD.INTEGER); }
default RDFDatatype getXsdBooleanDatatype() { return getDatatype(XSD.BOOLEAN); }
default RDFDatatype getXsdDoubleDatatype() { return getDatatype(XSD.DOUBLE); }