sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.
https://sbml.org/software/libsbml
Other
39 stars 28 forks source link

`createdDate` and `modifiedDate` should be optional attributes on `ModelHistory` #259

Closed matthiaskoenig closed 2 years ago

matthiaskoenig commented 2 years ago

Hi all, the libsbml library enforces to write the createdDate and modifiedDate on the ModelHistory because they are required fields. To be able to write the history element (to encode the creators) one has to add dummy information for this fields. Because I don't want any git diffs on my models on recreation but still write the creators I have to add the following block to every history I create to be able to set the history.

<dcterms:created rdf:parseType="Resource">                                                                                                                                                                                 
  <dcterms:W3CDTF>1900-01-01T00:00:00Z</dcterms:W3CDTF>                                                                                                                                                                    
</dcterms:created>                                                                                                                                                                                                         
<dcterms:modified rdf:parseType="Resource">                                                                                                                                                                                
  <dcterms:W3CDTF>1900-01-01T00:00:00Z</dcterms:W3CDTF>                                                                                                                                                                    
</dcterms:modified>     

To my knowledge it does not state anywhere that these fields should be required so it would be great if these could be optional to only store the creators.

In addition such information will be more and more encoded in omex-meta, so it should be possible to only store subsets of the metadata in SBML.

Best Matthias

Full example of typical ModelHistory.

        <dcterms:creator>                                                                                                                                                                                                          
            <rdf:Bag>                                                                                                                                                                                                                
              <rdf:li rdf:parseType="Resource">                                                                                                                                                                                      
                <vCard:N rdf:parseType="Resource">                                                                                                                                                                                   
                  <vCard:Family>König</vCard:Family>                                                                                                                                                                                 
                  <vCard:Given>Matthias</vCard:Given>                                                                                                                                                                                
                </vCard:N>                                                                                                                                                                                                           
                <vCard:EMAIL>koenigmx@hu-berlin.de</vCard:EMAIL>                                                                                                                                                                     
                <vCard:ORG rdf:parseType="Resource">                                                                                                                                                                                 
                  <vCard:Orgname>Humboldt-University Berlin, Institute for Theoretical Biology</vCard:Orgname>                                                                                                                       
                </vCard:ORG>                                                                                                                                                                                                         
              </rdf:li>                                                                                                                                                                                                              
            </rdf:Bag>                                                                                                                                                                                                               
          </dcterms:creator>                                                                                                                                                                                                         
          <dcterms:created rdf:parseType="Resource">                                                                                                                                                                                 
            <dcterms:W3CDTF>1900-01-01T00:00:00Z</dcterms:W3CDTF>                                                                                                                                                                    
          </dcterms:created>                                                                                                                                                                                                         
          <dcterms:modified rdf:parseType="Resource">                                                                                                                                                                                
            <dcterms:W3CDTF>1900-01-01T00:00:00Z</dcterms:W3CDTF>                                                                                                                                                                    
          </dcterms:modified>                                                                                                                                                                                                        
        </rdf:Description>   
fbergmann commented 2 years ago

I read the L2 specs in such a way, that at least the created field is required for the fixed sbml / annotation format. That formulation is different in the L3 specs. So i think it would be fine to at least relax the requirement, that a modification date is present. And I would be fine with relaxing the requirement for the creation date being present to before level 3 only.

matthiaskoenig commented 2 years ago

@fbergmann Relaxing these for SBML Level 3 would solve my issues. I am not using any SBML level 2.

matthiaskoenig commented 2 years ago

Thanks this is great.