code: void validate(KnowledgeSource knowledgeSource) throws
              LinkValidationFailedException, KnowledgeSourceReadException {
          List<String> invalidPropIds = new ArrayList<>();
          List<PropositionDefinition> propDefs = knowledgeSource.readPropositionDefinitions(this.propIdsAsSet.toArray(new String[this.propIdsAsSet.size()]));
          Set<String> foundPropIds = new HashSet<>();
          for (PropositionDefinition propDef : propDefs) {
              foundPropIds.add(propDef.getId());
          }
          for (String propId : this.propIdsAsSet) {
              if (!foundPropIds.contains(propId)) {
                  invalidPropIds.add(propId);
              }
          }
          if (!invalidPropIds.isEmpty()) {
              throw new LinkValidationFailedException(
                      "Invalid proposition id(s): "
                      + StringUtils.join(invalidPropIds, ", "));
          }
      }
docs: Validates the fields of this link specification against the knowledge
  source.
  
  @param knowledgeSource a {@link KnowledgeSource}. Guaranteed not
  <code>null</code>.
  
  @throws QueryResultsHandlerValidationFailedException if validation
  failed.
  @throws KnowledgeSourceReadException if the knowledge source could not be
  read.