obophenotype / ncbitaxon

Build for NCBITaxon
BSD 3-Clause "New" or "Revised" License
24 stars 7 forks source link

Improve turtle style #93

Closed cthoyt closed 17 hours ago

cthoyt commented 8 months ago

Nico asked me to double check the content in https://github.com/obophenotype/ncbitaxon/pull/88#discussion_r1361906045 and I realized that the turtle was very difficult to read. This PR updates the way the turtle is output (but not its content).

It mostly rearranges indentation and where semicolons ; are put. A notable change is I use nested objects for dbxrefs, which reduces some more visual clutter such as in

NCBITaxon:121616 a owl:Class ;
    rdfs:label "Micromonospora matsumotoense"^^xsd:string ;
    rdfs:subClassOf NCBITaxon:1873 ;
    ncbitaxon:has_rank NCBITaxon:species ;
    oboInOwl:hasDbXref "PMID:8897428"^^xsd:string ,
        "PMID:8897428"^^xsd:string ,
        "PMID:10499285"^^xsd:string ,
        "GC_ID:11"^^xsd:string ;
    oboInOwl:hasOBONamespace "ncbi_taxonomy"^^xsd:string .

I checked with python3 src/ncbitaxon.py build/taxdmp.zip ncbitaxon.ttl and robot convert -i ncbitaxon.ttl -o ncbitaxon.owl that this still makes valid and correct turtle that can be converted to OWL

jamesaoverton commented 8 months ago

The new output looks nicer, but it's an exaggeration to say the old output is "very difficult to read".

It's good that this PR doesn't break the syntax (your robot convert check). It's also important to check that it doesn't change the content.

anitacaron commented 7 months ago

@cthoyt Can you fix the conflict, please?