code: @Override
      public void serialize(Relationship relationship, JsonGenerator jg, SerializerProvider
              serializerProvider) throws IOException {
          jg.writeStartObject();
  
          jg.writeFieldName(FIELD_ID);
          jg.writeString(relationship.getId());
  
          jg.writeFieldName(FIELD_NAME);
          jg.writeString(relationship.getName());
  
          jg.writeFieldName(FIELD_SOURCE);
          jg.writeString(relationship.getSource().toString());
  
          jg.writeFieldName(FIELD_TARGET);
          jg.writeString(relationship.getTarget().toString());
  
          if (relationship.getProperties() != null && !relationship.getProperties().isEmpty()) {
              jg.writeFieldName(FIELD_PROPERTIES);
              jg.writeStartObject();
              for (Map.Entry<String, Object> property : relationship.getProperties().entrySet()) {
                  jg.writeFieldName(property.getKey());
                  jg.writeObject(property.getValue());
              }
              jg.writeEndObject();
          }
  
          jg.writeEndObject();
      }
docs: <pre>compact:
  {
  "id": "1337",
  "source": "/tenants/28026b36-8fe4-4332-84c8-524e173a68bf",
  "name": "contains",
  "target": "28026b36-8fe4-4332-84c8-524e173a68bf/environments/test"
  }</pre>
  <p>
  <pre>embedded:
  {
  "@context": "http://hawkular.org/inventory/0.1.0/relationship.jsonld",
  "id": "1337",
  "name": "contains",
  "source": {
  id: "/tenants/28026b36-8fe4-4332-84c8-524e173a68bf",
  shortId: "28026b36-8fe4-4332-84c8-524e173a68bf",
  type: "Tenant"
  },
  "target": {
  id: "28026b36-8fe4-4332-84c8-524e173a68bf/environments/test",
  shortId: "test",
  type: "Environment"
  }
  }</pre>