
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= Suma: utility for the STEP Unified Model-driven Architecture
== Purpose
SUMA, the "STEP Unified Model-Based Standards Architecture", is a authoring and publication system developed for the management of EXPRESS schemas and its documentation.
This utility is used by the https://github.com/metanorma/iso-10303[ISO 10303 collection] to build the following artifacts:
== Features
== Installation
== Usage: CLI
=== General
suma help
metanorma*.yml
)
suma reformat EXPRESS_FILE_PATH # Reformat EXPRESS files
suma validate SUBCOMMAND ...ARGS # Validate express documents
suma generate_schemas METANORMA_MANIFEST_FILE SCHEMA_MANIFEST_FILE # Generate schemas manifest file from Metanorma manifest YAML file
suma extract_terms SCHEMA_MANIFEST_FILE GLOSSARIST_OUTPUT_PATH # Extract terms from schema manifest file
suma help [COMMAND] # Describe available commands or one specific command=== Build command
The build
command processes a Metanorma site manifest and generates the specified output.
Parameters:
METANORMA_SITE_MANIFEST
:: This is the path to the Metanorma site manifest,
typically metanorma.yml
.
Options:
--[no-]compile
:: Compile or skip compilation of collection (default: true)
--schemas-all-path=PATH
, -s PATH
:: Generate file that contains all schemas in the collection
The generated schemas-*.yaml
file name is derived from the input file name
with the word metanorma
replaced with schemas
.
$ bundle exec suma build --no-compile metanorma-srl.yml
====
All documents need to have a schemas.yaml
in their document root that lists
out which schemas the document includes.
=== Reformat command
The reformat
command provides utilities for reformatting EXPRESS files.
Parameters:
EXPRESS_FILE_PATH
:: Path to an EXPRESS file or a folder containing EXPRESS
files
Options:
--[no-]recursive
, -r
:: Select EXPRESS files recursively based on the specified
folder path (default: false)
pwd
-r====
This command:
EXPRESS_FILE_PATH
=== Validate command
==== General
The validate
command groups various validation utilities for EXPRESS documents.
Subcommands:
links
- Validate EXPRESS linksascii
- Check for non-ASCII characters in EXPRESS files==== Links subcommand
The links
subcommand extracts and validates EXPRESS links without creating intermediate files.
Parameters:
SCHEMAS_FILE
:: Path to the schemas file (default: "schemas-srl.yml")
DOCUMENTS_PATH
:: Path to the documents directory (default: "documents")
OUTPUT_FILE
:: Path to write validation results (default: "validation_results.txt")
====
This command:
SCHEMAS_FILE
DOCUMENTS_PATH
OUTPUT_FILE
==== ASCII subcommand
The ascii
subcommand detects non-ASCII characters in EXPRESS files and reports on those exact lines, providing replacement suggestions.
Parameters:
EXPRESS_FILE_PATH
:: Path to an EXPRESS file or a folder containing EXPRESS
files
Options:
--[no-]recursive
, -r
:: Select EXPRESS files recursively based on the specified
folder path (default: false)
--[no-]yaml
, -y
:: Output results in YAML format for machine processing (default: false)
====
This command:
EXPRESS_FILE_PATH
Human-readable output format example:
/path/to/file.exp: Line 42, Column 15: ENTITY some_entity (name: STRING, description: "résumé"); ^^^^^ "é" - Hex: 0xe9, UTF-8 bytes: 0xc3 0xa9 Replacement: ISO 10303-11: "000000E9"
"s" - Hex: 0x73, UTF-8 bytes: 0x73
"u" - Hex: 0x75, UTF-8 bytes: 0x75
"m" - Hex: 0x6d, UTF-8 bytes: 0x6d
"é" - Hex: 0xe9, UTF-8 bytes: 0xc3 0xa9
Replacement: ISO 10303-11: "000000E9"
Found 1 non-ASCII sequence(s) in file.exp
Summary: Scanned 3 EXPRESS file(s) Found 1 non-ASCII sequence(s) in 1 file(s)
===== Japanese Character Example
For Japanese characters like 神戸 (Kobe), the command will provide ISO 10303-11 encoded string literal replacements:
"神" - Hex: 0x795e, UTF-8 bytes: 0xe7 0xa5 0x9e Replacement: ISO 10303-11: "0000795E"
===== Math Symbol Example
For mathematical symbols, the command will provide equivalent AsciiMath notation:
=== Generate schemas command
The suma generate_schemas
command generates an EXPRESS schema manifest file
containing all schemas of documents referenced in the Metanorma manifest file,
recursively.
Parameters:
METANORMA_MANIFEST_FILE
:: Path to the Metanorma manifest file
(e.g.: "metanorma-smrl-all.yml")
Options:
--exclude_path
, -e
:: Exclude schemas by pattern (e.g. *_lf.exp
)
$ bundle exec suma generate_schemas metanorma-smrl-all.yml schemas-smrl-all.yml
*_lf.exp
[source,sh]$ bundle exec suma generate_schemas metanorma-smrl-all.yml schemas-smrl-all.yml -e *_lf.exp
====
All documents need to have a schemas.yaml
in their document root that lists
out which schemas the document includes.
=== Extract terms command
The "extract terms" command is implemented for ISO 10303-2, and could also be used for other EXPRESS schema collections that require term extraction for glossary or dictionary applications.
The suma extract_terms
command extracts terms from EXPRESS schemas and
generates a Glossarist v2 dataset in the output directory. This command processes
various types of STEP schemas and creates standardized terminology datasets
suitable for glossary and dictionary applications.
Parameters:
SCHEMA_MANIFEST_FILE
:: Path to the schema manifest file that lists all schemas
to process (e.g., "schemas-smrl-all.yml")
GLOSSARIST_OUTPUT_PATH
:: Path to the output directory where the Glossarist v2
dataset will be generated
Options:
--language_code
, -l
:: Language code for the Glossarist dataset (default: "eng")
==== Supported schema types
The command supports extraction from the following EXPRESS schema types:
_arm
_mim
_bom
NOTE: The "Long Form" EXPRESS schemas (ending with _lf
) should be excluded
from the manifest file as they do not contain definitions of ENTITY
objects.
==== Extracted concepts
The command extracts ENTITY
objects from EXPRESS schemas, with the following
information:
. a unique identifier in form of {schema_name}.{entity_name}
(where entity_name
is a slug
derived from the ENTITY
name);
. a generated definition depending on the schema type and entity type;
. a "Note to entry" from its first coherent textual element described in Annotated EXPRESS;
. source information including: schema name and schema version;
. domain in the pattern of: {domain_type}: {schema_name}
, where domain_type
is one of
application module
, resource
, or business object model
.
==== Output format
The command generates a Glossarist v2 compliant dataset with:
concept/
directory containing concept definition files in YAMLlocalized_concept/
directory containing localized concept files in YAML$ bundle exec suma extract_terms schemas-smrl-all.yml glossarist_output
====
$ bundle exec suma extract_terms schemas-activity-modules.yml terms_output
====
== Usage: Ruby
=== General
Suma can be used programmatically in your Ruby applications. The following examples demonstrate common usage patterns.
=== Building collections
require 'suma'
Suma::Processor.run( metanorma_yaml_path: "metanorma-srl.yml", schemas_all_path: "schemas-srl.yml", compile: true, output_directory: "_site" )
=== Working with schema configurations
require 'suma'
schemas_file_path = "schemas-srl.yml" schemas_config = Suma::SchemaConfig::Config.from_yaml(IO.read(schemas_file_path))
schemas_config.set_initial_path(schemas_file_path)
== Copyright and license
Copyright Ribose. BSD 2-clause license.
FAQs
Unknown package
We found that suma demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.