[Volute] r4107 - trunk/projects/dm/vo-dml/models/provenancedm

Volute commit messages volutecommits at g-vo.org
Tue May 30 11:54:57 CEST 2017


Author: kriebe
Date: Tue May 30 11:54:56 2017
New Revision: 4107

Log:
Added small Python scripts for extracting model element descriptions to yaml-file and for adding it to vo-dml.xml file,
useful for saving the descriptions even if model is constructed from scratch or with a different modeling tool.

Added:
   trunk/projects/dm/vo-dml/models/provenancedm/ProvenanceDM.descriptions
   trunk/projects/dm/vo-dml/models/provenancedm/ProvenanceDM.descriptions_new
   trunk/projects/dm/vo-dml/models/provenancedm/add_descriptions.py
   trunk/projects/dm/vo-dml/models/provenancedm/extract_descriptions.py

Added: trunk/projects/dm/vo-dml/models/provenancedm/ProvenanceDM.descriptions
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/projects/dm/vo-dml/models/provenancedm/ProvenanceDM.descriptions	Tue May 30 11:54:56 2017	(r4107)
@@ -0,0 +1,213 @@
+ivoa: |
+    <Enter note text here>
+ivoa.real: |
+    Base Data Types V1.0 (2014)
+ivoa.nonnegativeinteger: |
+    Base Data Types V1.0 (2014)
+ivoa.datetime: |
+    Base Data Types V1.0 (2014)
+ivoa.anyURI: |
+    Base Data Types V1.0 (2014)
+ivoa.Unit: |
+    Base Data Types V1.0 (2014)
+string: |
+    Base Data Types V1.0 (2014)
+boolean: |
+    Base Data Types V1.0 (2014)
+complex: |
+    Base Data Types V1.0 (2014)
+rational: |
+    Base Data Types V1.0 (2014)
+integer: |
+    Base Data Types V1.0 (2014)
+ivoa.Quantity: |
+    Base Data Types V1.0 (2014)
+ivoa.Quantity.unit: |
+    TODO : Missing description : please, update your UML model asap.
+ivoa.IntegerQuantity: |
+    Base Data Types V1.0 (2014)
+ivoa.IntegerQuantity.value: |
+    TODO : Missing description : please, update your UML model asap.
+ivoa.RealQuantity: |
+    Base Data Types V1.0 (2014)
+ivoa.RealQuantity.value: |
+    TODO : Missing description : please, update your UML model asap.
+provenance: |
+    Provenance package - provides a data model for describing provenance
+provenance.AgentRole: |
+    Enumeration of possible agent roles.
+    This is extendible.
+provenance.AgentRole.Observer: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Creator: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Author: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Editor: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Publisher: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Operator: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Coordinator: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Provider: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity: |
+    This document provides a data model for describing provenance.
+provenance.Activity.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.startTime: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.endTime: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.used: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.wasAssociatedWith: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.parameter: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.activityDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.activity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription: |
+    This document provides a data model for describing provenance.
+provenance.ActivityDescription.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.type: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.subtype: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.doculink: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.usedDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.parameterDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity: |
+    This document provides a data model for describing provenance.
+provenance.Entity.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.type: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.rights: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.wasGeneratedBy: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.wasAttributedTo: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.entityDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.usedEntity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription: |
+    This document provides a data model for describing provenance.
+provenance.EntityDescription.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.category: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.doculink: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.wasGeneratedByDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Used: |
+    This document provides a data model for describing provenance.
+provenance.Used.usedDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Used.used: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedBy: |
+    This document provides a data model for describing provenance.
+provenance.WasGeneratedBy.wasGeneratedByDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedBy.wasGeneratedBy: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedByDescription: |
+    This document provides a data model for describing provenance.
+provenance.WasGeneratedByDescription.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedByDescription.wasGeneratedByDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Agent: |
+    This document provides a data model for describing provenance.
+provenance.Agent.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Agent.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Agent.type: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAssociatedWith: |
+    This document provides a data model for describing provenance.
+provenance.WasAssociatedWith.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAssociatedWith.wasAssociatedWith: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAttributedTo: |
+    This document provides a data model for describing provenance.
+provenance.WasAttributedTo.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAttributedTo.wasAttributedTo: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityFlow: |
+    This document provides a data model for describing provenance.
+provenance.ActivityFlow.hadStep: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Collection: |
+    This document provides a data model for describing provenance.
+provenance.Collection.hadMember: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.HadStep: |
+    This document provides a data model for describing provenance.
+provenance.HadStep.activity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.HadMember: |
+    This document provides a data model for describing provenance.
+provenance.HadMember.entity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Parameter: |
+    This document provides a data model for describing provenance.
+provenance.Parameter.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Parameter.value: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Parameter.parameterDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription: |
+    This document provides a data model for describing provenance.
+provenance.ParameterDescription.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.datatype: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.unit: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.ucd: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.utype: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.UsedDescription: |
+    This document provides a data model for describing provenance.
+provenance.UsedDescription.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.UsedDescription.usedDescription: |
+    TODO : Missing description : please, update your UML model asap.

Added: trunk/projects/dm/vo-dml/models/provenancedm/ProvenanceDM.descriptions_new
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/projects/dm/vo-dml/models/provenancedm/ProvenanceDM.descriptions_new	Tue May 30 11:54:56 2017	(r4107)
@@ -0,0 +1,213 @@
+ivoa: |
+    <Enter note text here>
+ivoa.real: |
+    Base Data Types V1.0 (2014)
+ivoa.nonnegativeinteger: |
+    Base Data Types V1.0 (2014)
+ivoa.datetime: |
+    Base Data Types V1.0 (2014)
+ivoa.anyURI: |
+    Base Data Types V1.0 (2014)
+ivoa.Unit: |
+    Base Data Types V1.0 (2014)
+string: |
+    Base Data Types V1.0 (2014)
+boolean: |
+    Base Data Types V1.0 (2014)
+complex: |
+    Base Data Types V1.0 (2014)
+rational: |
+    Base Data Types V1.0 (2014)
+integer: |
+    Base Data Types V1.0 (2014)
+ivoa.Quantity: |
+    Base Data Types V1.0 (2014)
+ivoa.Quantity.unit: |
+    TODO : Missing description : please, update your UML model asap.
+ivoa.IntegerQuantity: |
+    Base Data Types V1.0 (2014)
+ivoa.IntegerQuantity.value: |
+    TODO : Missing description : please, update your UML model asap.
+ivoa.RealQuantity: |
+    Base Data Types V1.0 (2014)
+ivoa.RealQuantity.value: |
+    TODO : Missing description : please, update your UML model asap.
+provenance: |
+    Provenance package - provides a data model for describing provenance
+provenance.AgentRole: |
+    Enumeration of possible agent roles.
+    This is extendible.
+provenance.AgentRole.Observer: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Creator: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Author: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Editor: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Publisher: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Operator: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Coordinator: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.AgentRole.Provider: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity: |
+    This document provides a data model for describing provenance.
+provenance.Activity.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.startTime: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.endTime: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.used: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.wasAssociatedWith: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.parameter: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.activityDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Activity.activity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription: |
+    This document provides a data model for describing provenance.
+provenance.ActivityDescription.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.type: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.subtype: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.doculink: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.usedDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityDescription.parameterDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity: |
+    This document provides a data model for describing provenance.
+provenance.Entity.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.type: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.rights: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.wasGeneratedBy: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.wasAttributedTo: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.entityDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Entity.usedEntity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription: |
+    This document provides a data model for describing provenance.
+provenance.EntityDescription.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.category: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.doculink: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.EntityDescription.wasGeneratedByDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Used: |
+    This document provides a data model for describing provenance.
+provenance.Used.usedDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Used.used: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedBy: |
+    This document provides a data model for describing provenance.
+provenance.WasGeneratedBy.wasGeneratedByDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedBy.wasGeneratedBy: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedByDescription: |
+    This document provides a data model for describing provenance.
+provenance.WasGeneratedByDescription.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasGeneratedByDescription.wasGeneratedByDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Agent: |
+    This document provides a data model for describing provenance.
+provenance.Agent.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Agent.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Agent.type: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAssociatedWith: |
+    This document provides a data model for describing provenance.
+provenance.WasAssociatedWith.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAssociatedWith.wasAssociatedWith: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAttributedTo: |
+    This document provides a data model for describing provenance.
+provenance.WasAttributedTo.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.WasAttributedTo.wasAttributedTo: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ActivityFlow: |
+    This document provides a data model for describing provenance.
+provenance.ActivityFlow.hadStep: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Collection: |
+    This document provides a data model for describing provenance.
+provenance.Collection.hadMember: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.HadStep: |
+    This document provides a data model for describing provenance.
+provenance.HadStep.activity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.HadMember: |
+    This document provides a data model for describing provenance.
+provenance.HadMember.entity: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Parameter: |
+    This document provides a data model for describing provenance.
+provenance.Parameter.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Parameter.value: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.Parameter.parameterDescription: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription: |
+    This document provides a data model for describing provenance.
+provenance.ParameterDescription.id: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.name: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.datatype: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.unit: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.ucd: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.utype: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.ParameterDescription.annotation: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.UsedDescription: |
+    This document provides a data model for describing provenance.
+provenance.UsedDescription.role: |
+    TODO : Missing description : please, update your UML model asap.
+provenance.UsedDescription.usedDescription: |
+    TODO : Missing description : please, update your UML model asap.

Added: trunk/projects/dm/vo-dml/models/provenancedm/add_descriptions.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/projects/dm/vo-dml/models/provenancedm/add_descriptions.py	Tue May 30 11:54:56 2017	(r4107)
@@ -0,0 +1,68 @@
+import argparse
+import yaml
+from lxml import etree
+
+def main():
+    parser = argparse.ArgumentParser(description='Add model descriptions to a vo-dml.xml file, using a descriptions-file')
+
+    parser.add_argument('vodml', metavar='vodml_file', type=str,
+        default="ProvenanceDM.vo-dml.xml",
+        help='name of vo-dml.xml file from which descriptions shall be updated')
+
+    parser.add_argument('description', metavar='description_file', type=str,
+        #default=None,
+        help='name of description file which contains model descriptions for given vodml-ids')
+
+    parser.add_argument('-o', '--output', metavar='output_file', type=str,
+        default=None,
+        help='name of output file into which the updated vo-dml.xml shall be written')
+
+    args = parser.parse_args()
+    vodmlfilename = args.vodml
+
+    # vodmlfilename = "ProvenanceDM.vo-dml.xml"
+    descriptionfilename = args.description
+    if args.output is not None:
+        outputfilename = args.output
+    else:
+        # construct filename based on vodmlfilename
+        outputfilename = vodmlfilename.replace('.vo-dml.xml', '-new.vo-dml.xml')
+
+    # read in vodml-file
+    f = open(vodmlfilename, 'r')
+    tree = etree.parse(f)
+    f.close()
+
+    # read descriptions from a separate yaml file
+    with open(descriptionfilename, 'r') as fdesc:
+        try:
+            descriptions = yaml.load(fdesc)
+        except yaml.YAMLError as exc:
+            print(exc)
+
+    # get the tree root
+    root = tree.getroot()
+
+    # find all vodml-ids (recursively) and their sibling description
+    for e in root.xpath(".//vodml-id"):
+
+        vodml_id = e
+        parent = e.getparent()
+        desc = parent.find("description")
+
+        if desc is not None:
+            # replace with read model descriptions, if exists; remove final \n
+            if vodml_id.text in descriptions:
+                desc.text = descriptions[vodml_id.text].rstrip("\n")
+            # else: leave it as it is
+
+
+    outputfile = open(outputfilename, 'wb')
+    xml = etree.tostring(root)
+    outputfile.write(xml)
+    outputfile.close()
+    print("File '%s' was read, descriptions from '%s' were added and written to file '%s'" % (vodmlfilename, descriptionfilename, outputfilename))
+
+
+if __name__ == '__main__':
+    main()
\ No newline at end of file

Added: trunk/projects/dm/vo-dml/models/provenancedm/extract_descriptions.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/projects/dm/vo-dml/models/provenancedm/extract_descriptions.py	Tue May 30 11:54:56 2017	(r4107)
@@ -0,0 +1,59 @@
+import argparse
+from lxml import etree
+
+
+def main():
+    parser = argparse.ArgumentParser(description='Extract model descriptions from a vo-dml.xml file')
+
+    parser.add_argument('vodml', metavar='vodml_file', type=str,
+        default="ProvenanceDM.vo-dml.xml",
+        help='name of vo-dml.xml file from which descriptions shall be extracted')
+
+    parser.add_argument('--output', metavar='description_file', type=str,
+        default=None,
+        help='name of output file into which the vodml-ids and descriptions shall be written; will be constructed automatically (<model>.descriptions), if not provided')
+
+    args = parser.parse_args()
+    vodmlfilename = args.vodml
+
+    # construct description filename, if needed
+    if args.output is not None:
+        descriptionfilename = args.output
+    else:
+        descriptionfilename = vodmlfilename.replace('.vo-dml.xml', '.descriptions')
+
+    f = open(vodmlfilename, 'r')
+
+    tree = etree.parse(f)
+    f.close()
+
+    root = tree.getroot()
+
+    # find all vodml-ids and their sibling description,
+    # write to file
+    descfile = open(descriptionfilename, 'w')
+
+    for e in root.xpath("//vodml-id"):
+
+        vodml_id = e.text
+        desc =  e.getparent().getparent().find("description")
+        desc = desc.text.strip()
+
+        #print("'vodml-id': '%s'" % vodml_id)
+        #print("'description': '%s'" % desc)
+
+        # replace each \n by \n and 4 whitespaces, because need to get
+        # indentation right for yaml multiline string
+        desc = desc.replace("\n", "\n    ")
+
+        # print directly as yaml dictionary:
+        descfile.write("%s: |\n" % vodml_id)
+        descfile.write("    %s\n" % desc)
+
+    descfile.close()
+
+    print("File '%s' was read and descriptions for each vodml-id were written to file '%s'" % (vodmlfilename, descriptionfilename))
+
+
+if __name__ == '__main__':
+    main()
\ No newline at end of file


More information about the Volutecommits mailing list