code: public String getTitle() {
          final Map<IRI, List<String>> titles = triples.stream()
              .filter(triple -> titleCandidates.contains(triple.getPredicate()))
              .filter(triple -> triple.getObject() instanceof Literal)
              .collect(groupingBy(Triple::getPredicate, mapping(triple ->
                              ((Literal) triple.getObject()).getLexicalForm(), toList())));
          return titleCandidates.stream().filter(titles::containsKey)
              .map(titles::get).flatMap(List::stream).findFirst()
              .orElseGet(this::getSubject);
      }
docs: Get the title.
  
  @return a title for the resource