code: protected Optional<IRI> extractIRI(ImmutableTerm term) {
          if (term instanceof IRIConstant) {
              return Optional.of(((IRIConstant) term).getIRI());
          }
          // TODO: look for the RDF building function (and check the type is an IRI)
          else if (term instanceof ImmutableFunctionalTerm) {
              return ((ImmutableFunctionalTerm) term).getArity() == 1
                      ? extractIRI(((ImmutableFunctionalTerm) term).getTerms().get(0))
                      : Optional.empty();
          }
          else if (term instanceof ValueConstant) {
              return Optional.of(rdfFactory.createIRI( ((ValueConstant) term).getValue()));
          }
          return Optional.empty();
      }
docs: TODO: make it more robust