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 Sentinel.UNSET
--version boolean Show the version and exit. Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

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 Sentinel.UNSET
--curie_map text N/A Sentinel.UNSET
--mappings text N/A Sentinel.UNSET
--mapping_set_id text N/A Sentinel.UNSET
--mapping_set_version text N/A Sentinel.UNSET
--mapping_set_source text N/A Sentinel.UNSET
--mapping_set_title text N/A Sentinel.UNSET
--mapping_set_description text N/A Sentinel.UNSET
--mapping_set_confidence text N/A Sentinel.UNSET
--creator_id text N/A Sentinel.UNSET
--creator_label text N/A Sentinel.UNSET
--license text N/A Sentinel.UNSET
--subject_type text N/A Sentinel.UNSET
--subject_source text N/A Sentinel.UNSET
--subject_source_version text N/A Sentinel.UNSET
--object_type text N/A Sentinel.UNSET
--object_source text N/A Sentinel.UNSET
--object_source_version text N/A Sentinel.UNSET
--predicate_type text N/A Sentinel.UNSET
--mapping_provider text N/A Sentinel.UNSET
--cardinality_scope text N/A Sentinel.UNSET
--mapping_tool text N/A Sentinel.UNSET
--mapping_tool_id text N/A Sentinel.UNSET
--mapping_tool_version text N/A Sentinel.UNSET
--mapping_date text N/A Sentinel.UNSET
--publication_date text N/A Sentinel.UNSET
--subject_match_field text N/A Sentinel.UNSET
--object_match_field text N/A Sentinel.UNSET
--subject_preprocessing text N/A Sentinel.UNSET
--object_preprocessing text N/A Sentinel.UNSET
--similarity_measure text N/A Sentinel.UNSET
--curation_rule text N/A Sentinel.UNSET
--curation_rule_text text N/A Sentinel.UNSET
--see_also text N/A Sentinel.UNSET
--issue_tracker text N/A Sentinel.UNSET
--other text N/A Sentinel.UNSET
--comment text N/A Sentinel.UNSET
--extension_definitions text N/A Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
-s, --statsfile text N/A Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

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 | ttl | xml | turtle | nt) Desired output format. Sentinel.UNSET
--propagate / --no-propagate boolean Automatically propagate condensed slots upon parsing. True
--condense / --no-condense boolean Automatically condense slots upon writing. True
-h, --help boolean Show this message and exit. Sentinel.UNSET

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')
-h, --help boolean Show this message and exit. Sentinel.UNSET

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')
-h, --help boolean Show this message and exit. Sentinel.UNSET

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'>
-h, --help boolean Show this message and exit. Sentinel.UNSET

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'>
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-h, --help boolean Show this message and exit. Sentinel.UNSET

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 Sentinel.UNSET
--subject_id text N/A Sentinel.UNSET
--subject_label text N/A Sentinel.UNSET
--subject_category text N/A Sentinel.UNSET
--predicate_id text N/A Sentinel.UNSET
--predicate_label text N/A Sentinel.UNSET
--predicate_modifier text N/A Sentinel.UNSET
--object_id text N/A Sentinel.UNSET
--object_label text N/A Sentinel.UNSET
--object_category text N/A Sentinel.UNSET
--mapping_justification text N/A Sentinel.UNSET
--author_id text N/A Sentinel.UNSET
--author_label text N/A Sentinel.UNSET
--reviewer_id text N/A Sentinel.UNSET
--reviewer_label text N/A Sentinel.UNSET
--creator_id text N/A Sentinel.UNSET
--creator_label text N/A Sentinel.UNSET
--license text N/A Sentinel.UNSET
--subject_type text N/A Sentinel.UNSET
--subject_source text N/A Sentinel.UNSET
--subject_source_version text N/A Sentinel.UNSET
--object_type text N/A Sentinel.UNSET
--object_source text N/A Sentinel.UNSET
--object_source_version text N/A Sentinel.UNSET
--predicate_type text N/A Sentinel.UNSET
--mapping_provider text N/A Sentinel.UNSET
--mapping_source text N/A Sentinel.UNSET
--mapping_cardinality text N/A Sentinel.UNSET
--cardinality_scope text N/A Sentinel.UNSET
--mapping_tool text N/A Sentinel.UNSET
--mapping_tool_id text N/A Sentinel.UNSET
--mapping_tool_version text N/A Sentinel.UNSET
--mapping_date text N/A Sentinel.UNSET
--publication_date text N/A Sentinel.UNSET
--review_date text N/A Sentinel.UNSET
--confidence text N/A Sentinel.UNSET
--reviewer_agreement text N/A Sentinel.UNSET
--curation_rule text N/A Sentinel.UNSET
--curation_rule_text text N/A Sentinel.UNSET
--subject_match_field text N/A Sentinel.UNSET
--object_match_field text N/A Sentinel.UNSET
--match_string text N/A Sentinel.UNSET
--subject_preprocessing text N/A Sentinel.UNSET
--object_preprocessing text N/A Sentinel.UNSET
--similarity_score text N/A Sentinel.UNSET
--similarity_measure text N/A Sentinel.UNSET
--see_also text N/A Sentinel.UNSET
--issue_tracker_item text N/A Sentinel.UNSET
--other text N/A Sentinel.UNSET
--comment text N/A Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

sssom help

Echoes help for subcommands.

Usage:

sssom help [OPTIONS] SUBCOMMAND

Options:

Name Type Description Default
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
--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. Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

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
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
-m, --metadata path The path to a file containing the sssom metadata (including prefix_map) to be used. Sentinel.UNSET
-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), prefixes the mapping set does not use are removed from its curie_map. True
--strict-clean-prefixes / --no-strict-clean-prefixes boolean If True (default), --clean-prefixes fails on a used prefix that the prefix map does not declare. If False, it declares the prefix with a placeholder IRI. 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. Sentinel.UNSET
-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
-h, --help boolean Show this message and exit. Sentinel.UNSET

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
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
--default-confidence float range (between 0 and 1) Default confidence to be assigned if absent. Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-h, --help boolean Show this message and exit. Sentinel.UNSET

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. Sentinel.UNSET
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-h, --help boolean Show this message and exit. Sentinel.UNSET

sssom rewire

Rewire an RDF graph, such as an OWL ontology, by replacing every mapped entity with its mapping partner. A graph expressed in one vocabulary is then expressed in another.

The command applies each mapping from subject to object: it replaces the mapping's subject with the mapping's object wherever the subject occurs in the graph. It uses only mappings with a chosen predicate. By default these are owl:equivalentClass and owl:equivalentProperty, and the --predicates option chooses others in their place. Only the equivalences keep the graph's meaning. A skos:broadMatch mapping, for example, puts the broader entity in every triple about the narrower one, including the triples that describe it. Negated mappings, and mappings to sssom:NoTermFound, are skipped. When no mapping is left to rewire by, the command warns, or fails with --strict.

When an entity has several candidate replacements, the command chooses the one under the predicate listed first in --predicates, so their order is the order of preference. The two default predicates are equally preferred. When candidates are equally preferred, --precedence chooses between them by the prefix of the replacement. Without --precedence, the command fails because the choice is ambiguous.

Examples:

$ sssom rewire -I xml -m tests/data/cob-to-external.tsv --precedence PR tests/data/cob.owl $ sssom rewire -m tests/data/rewire-predicates.tsv --predicates skos:exactMatch tests/data/rewire-predicates.ttl

Usage:

sssom rewire [OPTIONS] INPUT

Options:

Name Type Description Default
-m, --mapping-file text Path to SSSOM file. Sentinel.UNSET
-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. Sentinel.UNSET
--predicates text Mapping predicates to rewire by, as CURIEs or IRIs, in order of preference, in place of the default ones. Repeat the option, or separate the values with commas. Sentinel.UNSET
--strict boolean Fail, instead of only warning, when no mapping is left to rewire by. Sentinel.UNSET
-o, --output filename Path of SSSOM output file. <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
-h, --help boolean Show this message and exit. Sentinel.UNSET

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
-h, --help boolean Show this message and exit. Sentinel.UNSET

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
-h, --help boolean Show this message and exit. Sentinel.UNSET

sssom sparql

Run a SPARQL query.

Usage:

sssom sparql [OPTIONS]

Options:

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

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 Sentinel.UNSET
-h, --help boolean Show this message and exit. Sentinel.UNSET

sssom validate

Produce an error report for an SSSOM file.

Usage:

sssom validate [OPTIONS] INPUT

Options:

Name Type Description Default
--validation-types, -V choice (SchemaValidationType.JsonSchema | SchemaValidationType.Shacl | SchemaValidationType.Sparql | SchemaValidationType.PrefixMapCompleteness | SchemaValidationType.StrictCurieFormat) N/A [<SchemaValidationType.JsonSchema: 'JsonSchema'>, <SchemaValidationType.PrefixMapCompleteness: 'PrefixMapCompleteness'>, <SchemaValidationType.StrictCurieFormat: 'StrictCurieFormat'>]
--report-format, -r choice (pretty | raw) How to show the problems. 'pretty' lists each problem once in the error message; 'raw' logs every result as LinkML reports it. pretty
--propagate / --no-propagate boolean Automatically propagate condensed slots upon parsing. True
-h, --help boolean Show this message and exit. Sentinel.UNSET