Hi!

On Thu, Dec 15, 2011 at 12:44, Thomas Beale
<thomas.beale at oceaninformatics.com> wrote:
>> I have to say, the more I look at YAML, the more I wonder what the
>> designers were thinking. For example, in this section of the spec,
> http://yaml.org/spec/current.html#id2532720
>> multi-line quoted strings are only allowed if the 'key' is also quoted
>> (the strange looking JSON approach);
>> if the key is not quoted (i.e.
>> 'simple') then the value can't be quoted either. That's just nonsense!

Are you sure that is what it says?

"Double quoted scalars are restricted to a single line when contained
inside a simple key."

Is it not rather that you may not use a multiline double quoted string
as a KEY (at all). It does NOT forbid you to use multiline?double
quoted strings in the value, no matter if or how you quote your keys.

I have certainly seen?double?quoted values for unquoted keys coming
from serializers claiming to be specification conformant.

Are any of your keys so long and complicated that they would need
multiline quoted strings?

>> I am glad I am only implementing a serialiser, not a parser...

In many less exotic languages they are already implemented :-)
Then you configure them and then throw your object trees at them.

An example of very unfinished work in progress, using poorly readable
ordering and based on the openEHR java-ref-impl (and probably exposing
too many fields) is attached below.

Best regards,
Erik Sundvall
erik.sundvall at liu.se?http://www.imt.liu.se/~erisu/? Tel: +46-13-286733

!<http://www.openehr.org/releases/1.0.2/class/openehr.am.archetype.ARCHETYPE>
adl_version: '1.4'
archetype_id: openEHR-DEMOGRAPHIC-PERSON.person.v1
concept: at0000
original_language: ISO_639-1::pt-br
translations:
  en:
    language: ISO_639-1::en
    author: {email: sergio at lampada.uerj.br, organisation: Universidade
do Estado do Rio de Janeiro - UERJ, name: Sergio Miranda Freire}
description:
  original_author: {email: sergio at lampada.uerj.br, organisation:
Universidade do Estado do Rio de Janeiro - UERJ, name: Sergio Miranda
Freire & Rigoleta Dutra Mediano Dias,
    date: 22/05/2009}
  other_contributors: ['Sebastian Garde, Ocean Informatics, Germany
(Editor)', 'Omer Hotomaroglu, Turkey (Editor)', 'Heather
      Leslie, Ocean Informatics, Australia (Editor)']
  lifecycle_state: Authordraft
  details:
  - language: ISO_639-1::en
    purpose: Representation of a person's demographic data.
    keywords: [demographic service, person's data]
    use: Used in demographic service to collect a person's data.
    copyright: ? openEHR Foundation
    original_resource_uri: {}
  - language: ISO_639-1::pt-br
    purpose: Representa??o dos dados demogr?ficos de uma pessoa.
    keywords: [servi?o demogr?fico, dados de uma pessoa]
    use: Usado em servi?o demogr?ficos para coletar os dados de uma pessoa.
    copyright: ? openEHR Foundation
    original_resource_uri: {}
  other_details: {references: 'ISO/TS 22220:2008(E) - Identification
of Subject of Care - Technical Specification - International
      Organization for Standardization.'}
definition:
  attributes:
  - rm_attribute_name: details
    children:
    - includes:
      - expression:
          left_operand: {item: archetype_id/value, reference_type:
CONSTANT, type: STRING}
          right_operand:
            item: {pattern: '(person_details)[a-zA-Z0-9_-]*\.v1'}
            reference_type: CONSTANT
            type: String
          operator: OP_MATCHES
          precedence_overridden: false
          type: BOOLEAN
      rm_type_name: ITEM_TREE
      occurrences: [1, 1]
      node_i_d: at0001
      any_allowed: false
      path: /details[at0001]
    any_allowed: false
    path: /details
  - rm_attribute_name: identities
    children:
    - includes:
      - expression:
          left_operand: {item: archetype_id/value, reference_type:
CONSTANT, type: STRING}
          right_operand:
            item: {pattern: '(person_name)[a-zA-Z0-9_-]*\.v1'}
            reference_type: CONSTANT
            type: String
          operator: OP_MATCHES
          precedence_overridden: false
          type: BOOLEAN
      rm_type_name: PARTY_IDENTITY
      occurrences: [1, 1]
      node_i_d: at0002
      any_allowed: false
      path: /identities[at0002]
    any_allowed: false
    path: /identities
  - rm_attribute_name: contacts
    children:
    - attributes:
      - rm_attribute_name: addresses
        children:
        - includes:
          - expression:
              left_operand: {item: archetype_id/value, reference_type:
CONSTANT, type: STRING}
              right_operand:
                item: {pattern: '(address)([a-zA-Z0-9_-]+)*\.v1'}
                reference_type: CONSTANT
                type: String
              operator: OP_MATCHES
              precedence_overridden: false
              type: BOOLEAN
          - expression:
              left_operand: {item: archetype_id/value, reference_type:
CONSTANT, type: STRING}
              right_operand:
                item: {pattern: '(electronic_communication)[a-zA-Z0-9_-]*\.v1'}
                reference_type: CONSTANT
                type: String
              operator: OP_MATCHES
              precedence_overridden: false
              type: BOOLEAN
          rm_type_name: ADDRESS
          occurrences: [1, 1]
          node_i_d: at0030
          any_allowed: false
          path: /contacts[at0003]/addresses[at0030]
        any_allowed: false
        path: /contacts[at0003]/addresses
      rm_type_name: CONTACT
      occurrences: [1, 1]
      node_i_d: at0003
      any_allowed: false
      path: /contacts[at0003]
    any_allowed: false
    path: /contacts
  - rm_attribute_name: relationships
    children:
    - attributes:
      - rm_attribute_name: details
        children:
        - attributes:
          - rm_attribute_name: items
            children:
            - attributes:
              - rm_attribute_name: value
                children:
                - attributes: []
                  rm_type_name: DV_TEXT
                  occurrences: [1, 1]
                  any_allowed: true
                  path: /relationships[at0004]/details/items[at0040]/value
                - attributes:
                  - rm_attribute_name: defining_code
                    children:
                    - reference: ac0000
                      rm_type_name: CodePhrase
                      occurrences: [1, 1]
                      any_allowed: false
                      path:
/relationships[at0004]/details/items[at0040]/value/defining_code
                    any_allowed: false
                    path:
/relationships[at0004]/details/items[at0040]/value/defining_code
                  rm_type_name: DV_CODED_TEXT
                  occurrences: [1, 1]
                  any_allowed: false
                  path: /relationships[at0004]/details/items[at0040]/value
                any_allowed: false
                path: /relationships[at0004]/details/items[at0040]/value
              rm_type_name: ELEMENT
              occurrences: [1, 1]
              node_i_d: at0040
              any_allowed: false
              path: /relationships[at0004]/details/items[at0040]
            any_allowed: false
            path: /relationships[at0004]/details/items
          rm_type_name: ITEM_TREE
          occurrences: [1, 1]
          any_allowed: false
          path: /relationships[at0004]/details
        any_allowed: false
        path: /relationships[at0004]/details
      rm_type_name: PARTY_RELATIONSHIP
      occurrences: [1, 1]
      node_i_d: at0004
      any_allowed: false
      path: /relationships[at0004]
    any_allowed: false
    path: /relationships
  rm_type_name: PERSON
  occurrences: [1, 1]
  node_i_d: at0000
  any_allowed: false
  path: /
ontology:
  term_definitions_list:
  - language: pt-br
    definitions:
    - code: at0000
      items: {text: Dados da pessoa, description: Dados da pessoa.}
    - code: at0001
      items: {text: Detalhes, description: Detalhes demogr?ficos da pessoa.}
    - code: at0002
      items: {text: Nome, description: Conjunto de dados que
especificam o nome da pessoa.}
    - code: at0003
      items: {text: Contatos, description: Contatos da pessoa.}
    - code: at0004
      items: {text: Relacionamentos, description: 'Relacionamentos de
uma pessoa, especialmente la?os familiares.'}
    - code: at0030
      items: {text: Endere?o, description: 'Endere?os vinculados a um
?nico contato, ou seja, com o mesmo per?odo de validade.'}
    - code: at0040
      items: {text: Grau de parentesco, description: Define o grau de
parentesco entre as pessoas envolvidas.}
  - language: en
    definitions:
    - code: at0000
      items: {text: Person, description: Personal demographic data.}
    - code: at0001
      items: {text: Demographic details, description: A person's
demographic details.}
    - code: at0002
      items: {text: Name, description: A person's name.}
    - code: at0003
      items: {text: Contacts, description: A person's contacts.}
    - code: at0004
      items: {text: Relationships, description: 'A person''s
relationships, especially family ties.'}
    - code: at0030
      items: {text: Addresses, description: 'Addresses linked to a
single contact, i.e. with the same time validity.'}
    - code: at0040
      items: {text: Relationship type, description: Defines the type
of relationship between related persons.}
  constraint_definitions_list:
  - language: pt-br
    definitions:
    - code: ac0000
      items: {text: C?digos para tipo de parentesco, description:
c?digos v?lidos para tipo de parentesco.}
  - language: en
    definitions:
    - code: ac0000
      items: {text: Codes for type of relationship, description: Valid
codes for type of relationship.}
  term_binding_list: []
  constraint_binding_list: []
is_controlled: false


Reply via email to