private String getTypeColumnForSELECT ( Term ht , AliasIndex index , Optional < TermType > optionalTermType ) { if ( ht instanceof Variable ) { // Such variable does not hold this information, so we have to look // at the database metadata. return index . getTypeColumn ( ( Variable ) ht ) . map ( QualifiedAttributeID :: getSQLRendering ) // By default, we assume that the variable is an IRI. . orElseGet ( ( ) -> String . valueOf ( OBJECT . getQuestCode ( ) ) ) ; } else { COL_TYPE colType = optionalTermType . flatMap ( this :: extractColType ) // By default, we apply the "most" general COL_TYPE . orElse ( STRING ) ; return String . valueOf ( colType . getQuestCode ( ) ) ; } }
Infers the type of a projected term .