atextor / owl-cli

Command line tool for ontology engineering
Apache License 2.0
14 stars 2 forks source link

`--useCommaByDefault` not respected on source build of owl-cli #23

Open VladimirAlexiev opened 1 month ago

VladimirAlexiev commented 1 month ago

I run with --useCommaByDefault.

With owl-cli-1.2.5.jar it respected it:

sm:Ontology a owl:Ontology ;
  dcterms:conformsTo "file://CIM100_CGMES31v01_501-20v02_NC23v62_MM10v01.eap", "file://iec61970cim17v40_iec61968cim13v13a_iec62325cim03v17a.eap", "urn:iso:std:iec:61970-301:ed-7:amd1", "urn:iso:std:iec:61970-401:draft:ed-1", "urn:iso:std:iec:61970-501:draft:ed-2", "urn:iso:std:iec:61970-600-2:ed-1" 

With a source build (made as per https://github.com/atextor/owl-cli/issues/22) it doesn't respect it:

sm:Ontology a owl:Ontology ;
  dcterms:conformsTo "file://CIM100_CGMES31v01_501-20v02_NC23v62_MM10v01.eap" ;
  dcterms:conformsTo "file://iec61970cim17v40_iec61968cim13v13a_iec62325cim03v17a.eap" ;
  dcterms:conformsTo "urn:iso:std:iec:61970-301:ed-7:amd1" ;
  dcterms:conformsTo "urn:iso:std:iec:61970-401:draft:ed-1" ;
  dcterms:conformsTo "urn:iso:std:iec:61970-501:draft:ed-2" ;
  dcterms:conformsTo "urn:iso:std:iec:61970-600-2:ed-1" ;

https://github.com/atextor/owl-cli/blob/main/dependencies.gradle#L35 has this (not changed since 6 months ago):

        turtle_formatter    : 'de.atextor:turtle-formatter:1.2.11',

so I assume it doesn't use the new release turtle-formatter 1.2.12.

It prints this version info:

owl.bat --version
owl-cli version: snapshot build date: 2024-09-17 19:15:41

So I can't figure out what caused this change in behavior.

Do I need to specify --useCommaByDefault=true ??

atextor commented 1 month ago

No, --useCommaByDefault is the correct syntax. You are correct in that the turtle-formatter has not been updated yet. However, with a source build from the latest state of the main branch, I can not reproduce the issue, the commas are formatted as expected:

# clone the repository, then run:
./gradlew
cd cli/build/libs
java -jar owl-cli-snapshot.jar write ~/test.ttl --useCommaByDefault

which produces

# [...prefixes here]
sm:Ontology a owl:Ontology ;
  dcterms:conformsTo "file://CIM100_CGMES31v01_501-20v02_NC23v62_MM10v01.eap", "file://iec61970cim17v40_iec61968cim13v13a_iec62325cim03v17a.eap", "urn:iso:std:iec:61970-301:ed-7:amd1", "urn:iso:std:iec:61970-401:draft:ed-1", "urn:iso:std:iec:61970-501:draft:ed-2", "urn:iso:std:iec:61970-600-2:ed-1" .