Skip to content

CLI Commands

Full auto-generated reference for every sssom subcommand.

sssom

Run the SSSOM CLI.

Usage:

sssom [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
-v, --verbose integer range (0 and above) N/A 0
-q, --quiet text N/A None
--version boolean Show the version and exit. False
--help boolean Show this message and exit. False

sssom annotate

Annotate metadata of a mapping set.

Usage:

sssom annotate [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--replace-multivalued boolean Multivalued slots should be replaced or not. False
--sssom_version text N/A None
--curie_map text N/A None
--mappings text N/A None
--mapping_set_id text N/A None
--mapping_set_version text N/A None
--mapping_set_source text N/A None
--mapping_set_title text N/A None
--mapping_set_description text N/A None
--mapping_set_confidence text N/A None
--creator_id text N/A None
--creator_label text N/A None
--license text N/A None
--subject_type text N/A None
--subject_source text N/A None
--subject_source_version text N/A None
--object_type text N/A None
--object_source text N/A None
--object_source_version text N/A None
--predicate_type text N/A None
--mapping_provider text N/A None
--cardinality_scope text N/A None
--mapping_tool text N/A None
--mapping_tool_id text N/A None
--mapping_tool_version text N/A None
--mapping_date text N/A None
--publication_date text N/A None
--subject_match_field text N/A None
--object_match_field text N/A None
--subject_preprocessing text N/A None
--object_preprocessing text N/A None
--similarity_measure text N/A None
--curation_rule text N/A None
--curation_rule_text text N/A None
--see_also text N/A None
--issue_tracker text N/A None
--other text N/A None
--comment text N/A None
--extension_definitions text N/A None
--help boolean Show this message and exit. False

sssom cliquesummary

Calculate summaries for each clique in a SSSOM file.

Usage:

sssom cliquesummary [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-m, --metadata path The path to a file containing the sssom metadata (including prefix_map) to be used. None
-s, --statsfile text N/A None
--help boolean Show this message and exit. False

sssom convert

Convert a file.

Usage:

sssom convert [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-O, --output-format choice (tsv | owl | ontoportal_json | fhir_json | json | rdf | turtle | ttl | xml | nt) Desired output format. None
--propagate / --no-propagate boolean Automatically propagate condensed slots upon parsing. True
--condense / --no-condense boolean Automatically condense slots upon writing. True
--help boolean Show this message and exit. False

sssom correlations

Calculate correlations.

Usage:

sssom correlations [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-t, --transpose boolean N/A False
-f, --fields text Fields. ('subject_category', 'object_category')
--help boolean Show this message and exit. False

sssom crosstab

Write sssom summary cross-tabulated by categories.

Usage:

sssom crosstab [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-t, --transpose boolean N/A False
-f, --fields text Fields. ('subject_category', 'object_category')
--help boolean Show this message and exit. False

sssom dedupe

Remove lower confidence duplicate lines from an SSSOM file.

Usage:

sssom dedupe [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom diff

Compare two SSSOM files.

The output is a new SSSOM file with the union of all mappings, and injected comments indicating uniqueness to set1 or set2.

Usage:

sssom diff [OPTIONS] INPUTS...

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom dosql

Each of the N inputs is assigned a table name df1, df2, ..., dfN

Alternatively, the filenames can be used as table names - these are first stemmed E.g. ~/dir/my.sssom.tsv becomes a table called 'my'

Examples:

$ sssom dosql -Q "SELECT * FROM df1 WHERE confidence>0.5 ORDER BY confidence" my.sssom.tsv

$ sssom dosql -Q "SELECT file1.*,file2.object_id AS ext_object_id, file2.object_label AS ext_object_label FROM file1 INNER JOIN file2 WHERE file1.object_id = file2.subject_id" FROM file1.sssom.tsv file2.sssom.tsv

Usage:

sssom dosql [OPTIONS] [INPUTS]...

Options:

Name Type Description Default
-Q, --query text SQL query. Use "df" as table name. None
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom filter

Filter a dataframe by dynamically generating queries based on user input.

e.g. sssom filter --subject_id x:% --subject_id y:% --object_id y:% --object_id z:% tests/data/basic.tsv

yields the query:

"SELECT * FROM df WHERE (subject_id LIKE 'x:%' OR subject_id LIKE 'y:%') AND (object_id LIKE 'y:%' OR object_id LIKE 'z:%') " and displays the output.

:param input: DataFrame to be queried over. :param output: Output location. :param kwargs: Filter options provided by user which generate queries (e.g.: --subject_id x:%).

Usage:

sssom filter [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--record_id text N/A None
--subject_id text N/A None
--subject_label text N/A None
--subject_category text N/A None
--predicate_id text N/A None
--predicate_label text N/A None
--predicate_modifier text N/A None
--object_id text N/A None
--object_label text N/A None
--object_category text N/A None
--mapping_justification text N/A None
--author_id text N/A None
--author_label text N/A None
--reviewer_id text N/A None
--reviewer_label text N/A None
--creator_id text N/A None
--creator_label text N/A None
--license text N/A None
--subject_type text N/A None
--subject_source text N/A None
--subject_source_version text N/A None
--object_type text N/A None
--object_source text N/A None
--object_source_version text N/A None
--predicate_type text N/A None
--mapping_provider text N/A None
--mapping_source text N/A None
--mapping_cardinality text N/A None
--cardinality_scope text N/A None
--mapping_tool text N/A None
--mapping_tool_id text N/A None
--mapping_tool_version text N/A None
--mapping_date text N/A None
--publication_date text N/A None
--review_date text N/A None
--confidence text N/A None
--reviewer_agreement text N/A None
--curation_rule text N/A None
--curation_rule_text text N/A None
--subject_match_field text N/A None
--object_match_field text N/A None
--match_string text N/A None
--subject_preprocessing text N/A None
--object_preprocessing text N/A None
--similarity_score text N/A None
--similarity_measure text N/A None
--see_also text N/A None
--issue_tracker_item text N/A None
--other text N/A None
--comment text N/A None
--help boolean Show this message and exit. False

sssom help

Echoes help for subcommands.

Usage:

sssom help [OPTIONS] SUBCOMMAND

Options:

Name Type Description Default
--help boolean Show this message and exit. False

sssom invert

Invert subject and object IDs such that all subjects have the prefix provided.

:param input: SSSOM TSV file. :param subject_prefix: Prefix of all subject_ids. :param merge_inverted: If True (default), add inverted dataframe to input else, just return inverted data. :param update_justification: If True (default), the justification is updated to "sempav:MappingInversion", else it is left as it is. :param inverse_map: YAML file providing the inverse mapping for predicates. :param output: SSSOM TSV file with columns sorted.

Usage:

sssom invert [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-P, --subject-prefix text Invert subject_id and object_id such that all subject_ids have the same prefix. None
--merge-inverted / --no-merge-inverted boolean If True (default), add inverted mappings to the input mapping set, else, just return inverted mappings as a separate mapping set. True
--update-justification / --no-update-justification boolean If True (default), the justification is updated to 'sempav:MappingInversion', else it is left as it is. True
--inverse-map text Path to file that contains the inverse predicate dictionary. None
--help boolean Show this message and exit. False

sssom merge

Merge multiple MappingSetDataFrames into one.

Usage:

sssom merge [OPTIONS] [INPUTS]...

Options:

Name Type Description Default
-R, --reconcile boolean If true, the deduplicate (i.e., remove redundant lower confidence mappings) and reconcile (if msdf contains a higher confidence negative mapping, then remove lower confidence positive one. If confidence is the same, prefer HumanCurated. If both HumanCurated, prefer negative mapping) False
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--propagate / --no-propagate boolean Automatically propagate condensed slots upon parsing. True
--condense / --no-condense boolean Automatically condense slots upon writing. True
--help boolean Show this message and exit. False

sssom parse

Parse a file in one of the supported formats (such as obographs) into an SSSOM TSV file.

Usage:

sssom parse [OPTIONS] INPUT

Options:

Name Type Description Default
-I, --input-format choice (csv | tsv | obographs-json | alignment-api-xml | json | rdf) The string denoting the input format. None
-m, --metadata path The path to a file containing the sssom metadata (including prefix_map) to be used. None
-C, --prefix-map-mode choice (metadata_only | sssom_default_only | merged) Defines whether the prefix map in the metadata should be extended or replaced with the SSSOM default prefix map. metadata_only
-p, --clean-prefixes / --no-clean-prefixes boolean If True (default), records with unknown prefixes are removed from the SSSOM file. True
--strict-clean-prefixes / --no-strict-clean-prefixes boolean If True (default), clean_prefixes(strict = True). True
-E, --embedded-mode / --non-embedded-mode boolean If False, the resultant SSSOM file will be saved in the 'filename'.tsv provided by -o/--output option AND the metadata gets saved in the 'filename'.yml. True
-F, --mapping-predicate-filter text A list of predicates or a file path containing the list of predicates to be considered. None
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--propagate / --no-propagate boolean Automatically propagate condensed slots upon parsing. True
--condense / --no-condense boolean Automatically condense slots upon writing. True
--help boolean Show this message and exit. False

sssom partition

Partition an SSSOM into one file for each strongly connected component.

Usage:

sssom partition [OPTIONS] [INPUTS]...

Options:

Name Type Description Default
-d, --output-directory path Output directory path. /home/runner/work/sssom-py/sssom-py
--help boolean Show this message and exit. False

sssom ptable

Convert an SSSOM file to a ptable for kboom/boomer <https://github.com/INCATools/boomer>_.

Usage:

sssom ptable [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-W, --inverse-factor text Inverse factor. None
--default-confidence float range (between 0 and 1) Default confidence to be assigned if absent. None
--help boolean Show this message and exit. False

sssom reconcile-prefixes

Reconcile prefix_map based on provided YAML file.

Usage:

sssom reconcile-prefixes [OPTIONS] INPUT

Options:

Name Type Description Default
-p, --reconcile-prefix-file text Provide YAML file with prefix reconciliation information. None
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom remove

Remove mappings from an input mapping.

Usage:

sssom remove [OPTIONS] INPUT

Options:

Name Type Description Default
--remove-map path Mapping file path that needs to be removed from input. None
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom rewire

Example:

$ sssom rewire -I xml -i tests/data/cob.owl -m tests/data/cob-to-external.tsv --precedence PR

Usage:

sssom rewire [OPTIONS] INPUT

Options:

Name Type Description Default
-m, --mapping-file text Path to SSSOM file. None
-I, --input-format text Ontology input format. turtle
-O, --output-format text Ontology output format. turtle
--precedence text List of prefixes in order of precedence. None
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom serve-rdf

Serve the SSSOM file as an RDF SPARQL endpoint.

Usage:

sssom serve-rdf [OPTIONS] INPUT

Options:

Name Type Description Default
--hydrate / --no-hydrate boolean Infer S-P-O simple triples from axioms. On by default. True
--host text N/A 127.0.0.1
--port integer N/A 8000
--help boolean Show this message and exit. False

sssom sort

Sort DataFrame columns canonically.

Usage:

sssom sort [OPTIONS] INPUT

Options:

Name Type Description Default
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-k, --by-columns boolean Sort columns of DataFrame canonically. True
-r, --by-rows boolean Sort rows by DataFrame column #1 (ascending). True
--help boolean Show this message and exit. False

sssom sparql

Run a SPARQL query.

Usage:

sssom sparql [OPTIONS]

Options:

Name Type Description Default
-c, --config filename N/A None
-e, --url text N/A None
-g, --graph text N/A None
--object-labels / --no-object-labels boolean if set, includes object labels None
-l, --limit integer N/A None
-P, --prefix N/A None
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
--help boolean Show this message and exit. False

sssom split

Split input file into multiple output broken down by prefixes.

Usage:

sssom split [OPTIONS] INPUT

Options:

Name Type Description Default
-d, --output-directory path Output directory path. /home/runner/work/sssom-py/sssom-py
--method choice (disjoint-indexes | dense-indexes) N/A None
--help boolean Show this message and exit. False

sssom validate

Produce an error report for an SSSOM file.

Usage:

sssom validate [OPTIONS] INPUT

Options:

Name Type Description Default
--validation-types, -V choice (JsonSchema | Shacl | Sparql | PrefixMapCompleteness | StrictCurieFormat) N/A [<SchemaValidationType.JsonSchema: 'JsonSchema'>, <SchemaValidationType.PrefixMapCompleteness: 'PrefixMapCompleteness'>, <SchemaValidationType.StrictCurieFormat: 'StrictCurieFormat'>]
--propagate / --no-propagate boolean Automatically propagate condensed slots upon parsing. True
--help boolean Show this message and exit. False