private void writeTripleHash(final Statement s, final String id) throws IOException {

    writer.write(
        id
            + ' '
            + PROPERTY_SNOMED_TRIPLE_HASH
            + " \""
            + s.getSubject().getSerialisedId()
            + s.getPredicate().getSerialisedId()
            + s.getObject().getSerialisedId()
            + '\"'
            + LINE_ENDING);
  }
  @Override
  public void write(Statement s) throws IOException, ParseException {
    final String id = NS_SNOMED_STATEMENT_IDENTIFIER + ':' + s.getSerialisedId();

    // Type is rdf:Statement
    writer.write(id + ' ' + PROPERTY_RDF_TYPE + ' ' + CLASS_RDF_STATEMENT + LINE_ENDING);

    // Active
    writer.write(
        id
            + ' '
            + PROPERTY_SNOMED_ACTIVE
            + " \""
            + (s.isActive() == true ? "true" : "false")
            + '\"'
            + XML_SCHEMA_DATATYPE_BOOLEAN
            + LINE_ENDING);

    // Group
    writer.write(
        id
            + ' '
            + PROPERTY_SNOMED_GROUP
            + " \""
            + s.getGroupId()
            + '\"'
            + XML_SCHEMA_DATATYPE_INTEGER
            + LINE_ENDING);

    // Effective Time
    writer.write(
        id
            + ' '
            + PROPERTY_SNOMED_EFFECTIVE_TIME
            + " \""
            + dateTimeFormatter.format(longTimeParser.parse(String.valueOf(s.getEffectiveTime())))
            + '\"'
            + XML_SCHEMA_DATATYPE_DATE
            + LINE_ENDING);

    // Subject
    writer.write(
        id
            + ' '
            + PROPERTY_RDF_SUBJECT
            + ' '
            + NS_SNOMED_CONCEPT_IDENTIFIER
            + ':'
            + s.getSubject().getSerialisedId()
            + LINE_ENDING);

    // Predicate
    writer.write(
        id
            + ' '
            + PROPERTY_RDF_PREDICATE
            + ' '
            + NS_SNOMED_CONCEPT_IDENTIFIER
            + ':'
            + s.getPredicate().getSerialisedId()
            + LINE_ENDING);

    // Object
    writer.write(
        id
            + ' '
            + PROPERTY_RDF_OBJECT
            + ' '
            + NS_SNOMED_CONCEPT_IDENTIFIER
            + ':'
            + s.getObject().getSerialisedId()
            + LINE_ENDING);

    // Modifier
    if (s.getModifier() != null) {
      writer.write(
          id
              + ' '
              + PROPERTY_SNOMED_MODIFIER
              + ' '
              + NS_SNOMED_CONCEPT_IDENTIFIER
              + ':'
              + s.getModifier().getSerialisedId()
              + LINE_ENDING);
    }

    // Module
    if (s.getModule() != null) {
      writer.write(
          id
              + ' '
              + PROPERTY_SNOMED_MODULE
              + ' '
              + NS_SNOMED_CONCEPT_IDENTIFIER
              + ':'
              + s.getModule().getSerialisedId()
              + LINE_ENDING);
    }

    // Characteristic Type
    if (s.getCharacteristicType() != null) {
      writer.write(
          id
              + ' '
              + PROPERTY_SNOMED_CHARACTERISTIC_TYPE
              + ' '
              + NS_SNOMED_CONCEPT_IDENTIFIER
              + ':'
              + s.getCharacteristicType().getSerialisedId()
              + LINE_ENDING);
    }

    // Triple Hash
    writeTripleHash(s, id);
  }