Difference between revisions of "Running LDDTool and Verifying the Output"

From The SBN Wiki
Jump to navigation Jump to search
(Begin Update for 7.0.1)
(Update for 7.0.1 Release - Safety Save)
Line 6: Line 6:
 
== Running ''LDDTool'' ==
 
== Running ''LDDTool'' ==
  
The "operations" documentation provided with the LDDTool package is unmaintained and is at odds with actual tool behaviour in more than a few cases. The information below was compiled by running ''lddtool'' with various options and looking at the results produced using ''LDDTool'' version 0.1.8.9f, with the "IngestLDDTool.xml" file that came in the distribution package.
+
{| class="wikitable" style="background-color: yellow"
 
+
|
 +
''The minimal "Operation" documentation provided with the LDDTool package is apparently unmaintained, is at odds with actual tool behaviour in more than a few cases, and is flat-out wrong in at least one key point. The information output as help text for ''lddtool'' is not much better. The information below was compiled by running ''lddtool'' with various options and looking at the results produced using ''LDDTool'' version 7.0.1 of the release package (version 0.2.1.0 of the tool itself), with the "IngestLDD_Example_Classes.xml" file provided in the SBN example package.''
 +
|}
  
 
Single-letter switches may be combined and order is not significant, so "'''-l -p -c'''" is equivalent to "'''-clp'''".
 
Single-letter switches may be combined and order is not significant, so "'''-l -p -c'''" is equivalent to "'''-clp'''".
  
''Note'' that errors in command invocation will send error messages to the command line, but these will always be followed by a dump of usage information, so most people will have to be able to scroll back through screen output to see the actual error message.
+
''Note'' that the few errors in command invocation that are actually trapped will send error messages to the command line, but these will always be followed by a dump of usage information, so most people will have to be able to scroll back through screen output to see the actual error message.
  
 
Also, note that ''LDDTool'' will silently ignore invalid switches, so type carefully.
 
Also, note that ''LDDTool'' will silently ignore invalid switches, so type carefully.
Line 22: Line 24:
 
| style="width: 10%" align="center"| -l
 
| style="width: 10%" align="center"| -l
 
| style="width: 15% |'''Required'''  
 
| style="width: 15% |'''Required'''  
| This switch must ''always'' be specified if you want to actually process the input file. Omitting it produces an error unless the '''-h''' switch is present.
+
| This switch must ''always'' be specified if you want to actually process the input file. Failing to include results in an output list of errors complaining about things that can't be found and nothing else.
 
|-
 
|-
 
| style="width: 10%" align="center"| -p
 
| style="width: 10%" align="center"| -p
 
| style="width: 15% |'''Required'''  
 
| style="width: 15% |'''Required'''  
  
| This switch must ''always'' be specified if you want to actually process the input file. Omitting it produces an error unless the '''-h''' switch is present.
+
| This switch must ''always'' be specified if you want to actually process the input file. Omitting results in a a brief error message identifying the missing option followed by a listing of the help text.
 
|-
 
|-
 
| colspan="3" |    
 
| colspan="3" |    
Line 33: Line 35:
 
| style="width: 10%" align="center"| -c
 
| style="width: 10%" align="center"| -c
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This switch directs ''LDDTool'' to create XML <code>&lt;element&gt;</code> definitions for every ''DD_Class'' declaration in the ''Ingest_LDD'' input, ignoring any <code>&lt;element_flag&gt;</code> attributes you might have included in your ''DD_Class'' definitions.
+
| This switch directs ''LDDTool'' to create XML <code>&lt;element&gt;</code> definitions for every ''DD_Class'' declaration in the ''Ingest_LDD'' input, ignoring any <code>&lt;element_flag&gt;</code> attributes you might have included in your ''DD_Class'' definitions. ''This is probably not a good idea.  Don't do this unless you really mean it.''
 
|-
 
|-
 
| style="width: 10%" align="center"| -h, --help
 
| style="width: 10%" align="center"| -h, --help
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This displays the command summary information.  In this case all other switches and arguments are ignored.
+
| This displays the command summary information.  In this case all other switches and arguments are ignored.  The long form of the switch is safe to use in this case because the '''-h''' option overrides and cancels all other options.
 +
|-
 +
| style="width: 10%" align="center"| -J
 +
| style="width: 15% |'''Optional'''
 +
| This switch causes the creation of an additional output file that contains the dictionary information in JSON (Java Script Open Notation) format.  It is a dump of the entire Information Model as known to ''LDDTool'' after processing your input file - so it includes the entire ''pds:'' core namespace, the known discipline name spaces, and the dictionary just created.
 
|-
 
|-
| style="width: 10%" align="center"| -m, --merge
+
| style="width: 10%" align="center"| -m
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
 
| This switch causes ''LDDTool'' to create an additional output file with the same name as the output schema files and an extension of "<code>.pont</code>". This file is used to load the ontological data base at Engineering Node that holds all configured PDS4 data dictionaries.  You should never have to generate this file in normal operations, but if you can find a use for it, have at it.
 
| This switch causes ''LDDTool'' to create an additional output file with the same name as the output schema files and an extension of "<code>.pont</code>". This file is used to load the ontological data base at Engineering Node that holds all configured PDS4 data dictionaries.  You should never have to generate this file in normal operations, but if you can find a use for it, have at it.
Line 45: Line 51:
 
| style="width: 10%" align="center"| -M
 
| style="width: 10%" align="center"| -M
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This switch adds a <code>/mission/</code> level to the namespace identifier defined for you dictionary.  ''If you are working on a mission dictionary, you should use this switch to avoid having to edit the output schema files namespace.''
+
| This switch adds a <code>/mission/</code> level to the namespace identifier defined for you dictionary.  ''If you are working on a mission dictionary, you should use this switch to avoid having to edit the namespace in the output schema files.''
 
|-
 
|-
| style="width: 10%" align="center"| -J
+
| style="width: 10%" align="center"| -n
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This switch causes the creation of an additional output file that contains the dictionary information in JSON (Java Script Open Notation) format.
+
| This switch adds "nuance property maps" to the output schema and, if any, JSON files.  This is an experimental implementation still working towards proof-of-concept stage, so you should avoid it unless you are directly involved in the testing and development of this capability.
 
|-
 
|-
 
| style="width: 10%" align="center"| -s
 
| style="width: 10%" align="center"| -s
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This switch causes the the version number of the local dictionary to be set equal to the version number of the core namespace used to process the input file, and it also causes the output files to have names of the form ''PDS4_ns_vvvv'', where ''ns'' is the namespace abbreviation specified inside the input file, and ''vvvv'' is the collapsed, four-digit reference to the PDS core version.
+
| This switch causes the the version number of the local dictionary to be set equal to the version number of the core namespace used to process the input file, and it also causes the output files to have names of the form ''PDS4_ns_vvvv'', where ''ns'' is the namespace abbreviation specified inside the input file, and ''vvvv'' is the collapsed, four-digit reference to the PDS core version.  Apart from the version number, the output schemas are otherwise unaffected.
 
|-
 
|-
| style="width: 10%" align="center"| -n
+
| style="width: 10%" align="center"| -v, --version
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This switch adds "nuance property maps" to the output schema and, if any, JSON filesThis is an experimental capability still working towards proof-of-concept stage, so you should avoid it unless you are directly involved in the testing and development of this capability.
+
| This switch causes ''lddtool'' to output its internal version number, which is different from the version number on the delivery package.  As of this writing, the latest available download package has a version number of "7.0.1", but the '''-v''' option will report a version number of "0.2.1.0"The long options is also safe to use in this case - the '''-v''' option overrides all other options except the '''-h''' option.
 
|-
 
|-
 
| style="width: 10%" align="center"| -1
 
| style="width: 10%" align="center"| -1
 
| style="width: 15% |'''Optional'''  
 
| style="width: 15% |'''Optional'''  
| This switch (it's a number one) causes the output of of the PDS4 Information Model in the same format as the HTML web page on the main PDS site.  It includes attribute definitions from the local dictionary processed, but not class definitions - even if you include the '''-c''' option to create visible class elements, or set the ''element_flag'' in your class to ''true''.
+
| This switch (it's a number one) causes the output of of the PDS4 Information Model in the same format as the HTML web page on the main PDS site.  It includes attribute definitions from the local dictionary processed in Section 26, but not class definitions - even if you include the '''-c''' option to create visible class elements, or set the ''element_flag'' in your class to ''true''.  Neither do the associated links work.  On the whole, there's not much point, but the switch does not appear to have any side-effects on the output schemas themselves, so in that sense it is harmless.
 
|}
 
|}
  
=== Command Switches to Ignore ===
+
=== Command Switches to Ignore or be Wary of ===
  
Don't use these.
+
Don't use these.  If you read the help text output by ''lddtool'', you will see these switches listed, but they do ''not'' have the advertised effect(s), and frequently have unintended side effects because of a program error in handling long-form options.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 72: Line 78:
 
| This switch has no effect.
 
| This switch has no effect.
 
|-
 
|-
| style="width: 10%" align="center"| --Attribute
+
| style="width: 10%" align="center"| --attribute
| This switch has no effect.  It is defined as a synonym for the '''-a''' switch.
+
| This switch has no effect.  It is defined as a synonym for the '''-a''' switch, which has no effect, and it also, coincidentally, has no letters in it that would otherwise be recognized as switches.
 +
|-
 +
| style="width: 10%" align="center"| --class
 +
| This switch is supposed to be an alias for the '''-c''' switch.  While it does cause element definitions to be written for classes, it also changes the name of the output files as though the '''-s''' switch was included as well.
 +
|-
 +
| style="width: 10%" align="center"| -d
 +
| This undocumented switch causes ''lddtool'' to insert ''&lt;xs:annotation&gt;'' elements into the output XML Schema for every attribute included in each class.  These elements contain the human-readable definitions you included in the input file as you defined each attribute.  Normally, the output XSD schema file only contains these annotations for the classes.  Using this switch causes them to be added for attributes as well.  It does not, however, do this in a way that is consistently syntactically valid - so a non-trivial input file is likely to produce an .xsd output file that is riddled with content errors.
 +
|-
 +
| style="width: 10%" align="center"| -IM Spec
 +
| Assuming you are clever enough to figure out how to pass an option with an imbedded blank, this is advertised as a long form of the ''-1'' option.  It's not.  It does not trigger creation of the HTML file, but it does have the same effect as specifying the '''-M''' and '''-c''' options.
 
|-
 
|-
| style="width: 10%" align="center"| --Class
+
| style="width: 10%" align="center"| --JASON
| This switch is supposed to be an alias for the '''-c''' switch.  While it does cause element definitions to be written for classes, it also changes the name of the output files as though the '''-s''' switch was included as well .
+
| This was supposed to be an alternate way of including the '''-J''' switch.  It actually does also trigger the creation of the JSON output file, but this is not how you spell "JSON", and one must assume that it is only the happy circumstance that none of its letters correspond to currently existing other switches that prevents this string from having unexpected side effects similar to those listed for other long versions.
 
|-
 
|-
 
| style="width: 10%" align="center"| --LDD
 
| style="width: 10%" align="center"| --LDD
 
| This is supposed to be an alternate way of including the required '''-l''' switch.  It's not, and using it throws an error.
 
| This is supposed to be an alternate way of including the required '''-l''' switch.  It's not, and using it throws an error.
 
|-
 
|-
| style="width: 10%" align="center"| --PDS4
+
| style="width: 10%" align="center"| --merge
| This is supposed to be an alternate way of including the required '''-p''' switchIt's not, and using it throws an error.
+
| As of this writing, this option has the desired effect of being equivalent to the '''-m''' option with no additional side-effectsGiven the issues with other long options, though, this must be assumed to be a happy coincidence, and it would be better in the long run to avoid ''all'' long options, even the ones that seem to work, until the underlying problem is solved.
 
|-
 
|-
 
| style="width: 10%" align="center"| --Mission
 
| style="width: 10%" align="center"| --Mission
| This was supposed to be an alternate way of including the '''-M''' switch.  It does not product the desired change in namespace, but neither does it throw an error to warn you something is wrong.
+
| This was supposed to be an alternate way of including the '''-M''' switch.  It does produce the desired change in namespace, but also produces the addition effects of the '''-s''' and '''-n''' switches.
 
|-
 
|-
| style="width: 10%" align="center"| --JASON
+
| style="width: 10%" align="center"| --nuance
| This was supposed to be an alternate way of including the '''-J''' switch.  It actually does also trigger the creation of the JSON output file, but this is not how you spell "JSON", and one must assume that it is only the happy circumstance that none of its letters correspond to currently existing other switched that prevents this string from having unexpected side effects similar to those listed for other long versions.
+
| This was supposed to be an alternate way of including the '''-n''' switch, which you also probably shouldn't use, but in addition to adding the property maps to the output, it also causes the same behaviour as the '''-c''' switch, and defines elements for all your classes.
 +
|-
 +
| style="width: 10%" align="center"| --PDS4
 +
| This is supposed to be an alternate way of including the required '''-p''' switch.  It's not, and using it throws an error.
 
|-
 
|-
 
| style="width: 10%" align="center"| --sync
 
| style="width: 10%" align="center"| --sync
 
| This was supposed to be an alternate way of including the '''-s''' switch. In fact, it has the total effect of the '''-s''', '''-n''', and '''-c''' switches combined.
 
| This was supposed to be an alternate way of including the '''-s''' switch. In fact, it has the total effect of the '''-s''', '''-n''', and '''-c''' switches combined.
|-
 
| style="width: 10%" align="center"| --nuance
 
| This was supposed to be an alternate way of including the '''-n''' switch, which you also probably shouldn't use, but in addition to adding the property maps to the output, it also causes the same behaviour as the '''-c''' switch, and defines elements for all your classes.
 
|}
 
 
=== Undocumented Switches ===
 
 
These switches were discovered by accident during testing.  Their behaviour is inferred from output.  Use at your own peril...
 
 
{| class="wikitable"
 
| style="width: 10%" align="center"| -d
 
| This switch appears to cause ''LDDTool'' to include <code>&lt;annotation&gt;</code> elements in for every attribute included in each class.  These elements contain the human-readable definitions you included in the input file as you defined each attribute.  Normally, the output XSD schema file only contains these definitions for the classes.  Using this switch causes them to be added for attributes as well.
 
|-
 
| style="width: 10%" align="center"| -v
 
| This switch causes ''LDDTool'' to output its version number.  To get the version number output, '''-v''' must be the only switch used.  Specifically, using '''-h''' at the same time will suppress the output  of the version number.
 
 
|}
 
|}

Revision as of 14:34, 23 January 2017

These pages are being actively updated to the latest (version 7.0.1/0.2.1.0) of LDDTool. A note will be posted when the update is complete.

Running LDDTool

The minimal "Operation" documentation provided with the LDDTool package is apparently unmaintained, is at odds with actual tool behaviour in more than a few cases, and is flat-out wrong in at least one key point. The information output as help text for lddtool is not much better. The information below was compiled by running lddtool with various options and looking at the results produced using LDDTool version 7.0.1 of the release package (version 0.2.1.0 of the tool itself), with the "IngestLDD_Example_Classes.xml" file provided in the SBN example package.

Single-letter switches may be combined and order is not significant, so "-l -p -c" is equivalent to "-clp".

Note that the few errors in command invocation that are actually trapped will send error messages to the command line, but these will always be followed by a dump of usage information, so most people will have to be able to scroll back through screen output to see the actual error message.

Also, note that LDDTool will silently ignore invalid switches, so type carefully.

Command Switches to Use

This switches seems to operate as described below. Some have both a short form and a long form.

-l Required This switch must always be specified if you want to actually process the input file. Failing to include results in an output list of errors complaining about things that can't be found and nothing else.
-p Required This switch must always be specified if you want to actually process the input file. Omitting results in a a brief error message identifying the missing option followed by a listing of the help text.
 
-c Optional This switch directs LDDTool to create XML <element> definitions for every DD_Class declaration in the Ingest_LDD input, ignoring any <element_flag> attributes you might have included in your DD_Class definitions. This is probably not a good idea. Don't do this unless you really mean it.
-h, --help Optional This displays the command summary information. In this case all other switches and arguments are ignored. The long form of the switch is safe to use in this case because the -h option overrides and cancels all other options.
-J Optional This switch causes the creation of an additional output file that contains the dictionary information in JSON (Java Script Open Notation) format. It is a dump of the entire Information Model as known to LDDTool after processing your input file - so it includes the entire pds: core namespace, the known discipline name spaces, and the dictionary just created.
-m Optional This switch causes LDDTool to create an additional output file with the same name as the output schema files and an extension of ".pont". This file is used to load the ontological data base at Engineering Node that holds all configured PDS4 data dictionaries. You should never have to generate this file in normal operations, but if you can find a use for it, have at it.
-M Optional This switch adds a /mission/ level to the namespace identifier defined for you dictionary. If you are working on a mission dictionary, you should use this switch to avoid having to edit the namespace in the output schema files.
-n Optional This switch adds "nuance property maps" to the output schema and, if any, JSON files. This is an experimental implementation still working towards proof-of-concept stage, so you should avoid it unless you are directly involved in the testing and development of this capability.
-s Optional This switch causes the the version number of the local dictionary to be set equal to the version number of the core namespace used to process the input file, and it also causes the output files to have names of the form PDS4_ns_vvvv, where ns is the namespace abbreviation specified inside the input file, and vvvv is the collapsed, four-digit reference to the PDS core version. Apart from the version number, the output schemas are otherwise unaffected.
-v, --version Optional This switch causes lddtool to output its internal version number, which is different from the version number on the delivery package. As of this writing, the latest available download package has a version number of "7.0.1", but the -v option will report a version number of "0.2.1.0". The long options is also safe to use in this case - the -v option overrides all other options except the -h option.
-1 Optional This switch (it's a number one) causes the output of of the PDS4 Information Model in the same format as the HTML web page on the main PDS site. It includes attribute definitions from the local dictionary processed in Section 26, but not class definitions - even if you include the -c option to create visible class elements, or set the element_flag in your class to true. Neither do the associated links work. On the whole, there's not much point, but the switch does not appear to have any side-effects on the output schemas themselves, so in that sense it is harmless.

Command Switches to Ignore or be Wary of

Don't use these. If you read the help text output by lddtool, you will see these switches listed, but they do not have the advertised effect(s), and frequently have unintended side effects because of a program error in handling long-form options.

-a This switch has no effect.
--attribute This switch has no effect. It is defined as a synonym for the -a switch, which has no effect, and it also, coincidentally, has no letters in it that would otherwise be recognized as switches.
--class This switch is supposed to be an alias for the -c switch. While it does cause element definitions to be written for classes, it also changes the name of the output files as though the -s switch was included as well.
-d This undocumented switch causes lddtool to insert <xs:annotation> elements into the output XML Schema for every attribute included in each class. These elements contain the human-readable definitions you included in the input file as you defined each attribute. Normally, the output XSD schema file only contains these annotations for the classes. Using this switch causes them to be added for attributes as well. It does not, however, do this in a way that is consistently syntactically valid - so a non-trivial input file is likely to produce an .xsd output file that is riddled with content errors.
-IM Spec Assuming you are clever enough to figure out how to pass an option with an imbedded blank, this is advertised as a long form of the -1 option. It's not. It does not trigger creation of the HTML file, but it does have the same effect as specifying the -M and -c options.
--JASON This was supposed to be an alternate way of including the -J switch. It actually does also trigger the creation of the JSON output file, but this is not how you spell "JSON", and one must assume that it is only the happy circumstance that none of its letters correspond to currently existing other switches that prevents this string from having unexpected side effects similar to those listed for other long versions.
--LDD This is supposed to be an alternate way of including the required -l switch. It's not, and using it throws an error.
--merge As of this writing, this option has the desired effect of being equivalent to the -m option with no additional side-effects. Given the issues with other long options, though, this must be assumed to be a happy coincidence, and it would be better in the long run to avoid all long options, even the ones that seem to work, until the underlying problem is solved.
--Mission This was supposed to be an alternate way of including the -M switch. It does produce the desired change in namespace, but also produces the addition effects of the -s and -n switches.
--nuance This was supposed to be an alternate way of including the -n switch, which you also probably shouldn't use, but in addition to adding the property maps to the output, it also causes the same behaviour as the -c switch, and defines elements for all your classes.
--PDS4 This is supposed to be an alternate way of including the required -p switch. It's not, and using it throws an error.
--sync This was supposed to be an alternate way of including the -s switch. In fact, it has the total effect of the -s, -n, and -c switches combined.