Diego Cabello

<<<Back toCoding

ENTS Schema

Date: 2025 Apr 14

Words: 469

Draft: 1 (Most recent)

ENTS Schema


Tags Format in YAML

Example:

Organic Chemistry:
  - Medicinal Chemistry
  - Polymer Chemistry:
      - Plastic Materials
      - Carbon Nanomaterials:
          - Carbon Nanotubes
          - Graphene
  - Petrochemistry
Inorganic Chemistry:
  - Coordination Chemistry
  - Organometallic Chemistry

Commands

A generic xents command will be used here as an example implementation.

Usage: xents <command> <operator> <arguments>

ENTS commands use inverse function mapping - one to many, not many to one. This is chosen so the first argument of one type can have many arguments (that are of a different type than the first and are all of a similar type) after it

process

Takes a YAML file and processes it to a datafile. Output varies on imlementation.

  • Usage: xents process file.yaml
  • Notes: no additional operators or arguments
  • Alias: parse

tagtofiles

Usage: xents tagtofiles <add|remove|show> <arguments>*

Description: Manages relationships between one tag and many files

Alias: ttf

  • add
    • Usage: xents tagtofiles add <tag> <files>*
    • Description: creates links from one tag to \ge 1 files
    • Alias: assign
  • remove
    • Usage: xents tagtofiles remove <tag> <files>*
    • Description: removes a link one from one tag to \ge 1 files
    • Alias: rm
  • show
    • Usage: xents tagtofiles show <tags>*
    • Description: shows all files linked to each tag inputted. can take more than one tag as input

filetotags

Usage: xents filetotags <add|remove> <arguments>*

Description: Manages relationships between one file and many tags

Alias: ftt

  • add
    • Usage: xents filetotags add <file> <tags>*
    • Description: creates links from one file to \ge 1 tags
    • Alias: assign
  • remove
    • Usage: xents filetotags remove <file> <tags>*
    • Description: removes links from one file to \ge 1 tags
    • Alias: rm
  • show
    • Usage: xents filetotags show <files>*
    • Description: shows all tags linked to each file inputted. can take more than one file as input

filter

Usage: xents filter [-flags] <tags>*

Description: Returns files associated with tags. The main command of MENTS, where the nesting comes into play. Differentiated from the tagtofiles command, where the nesting does not come into play.

  • Nested:
    • Usage: xents filter <tags>
    • Description: the default mode.
    • Example: xents filter "organic chemistry" will return everything that is tagged with something within organic chemistry. If a file is tagged only with “carbon nanotubes”, it will be returned because “carbon nanotubes” is a sub-tag in organic chemistry
  • Explicit -e
    • Usage: xents filter -e <tags>
    • Description: will only return a file if it is explicitly tagged with it
    • Example: xents filter -e "organic chemistry" will return a file marked with “organic chemistry,carbon nanotubes” but not one with just “carbon nanotubes”.
    • Note: Uses the same implementation as xents tagtofiles show <files>* and is included here with -e tags for mnemonic purposes
  • Traverse Down by Count -td
    • Usage: xents filter -td <count> <tags>
    • Description: Returns files only if explicitly tagged with a tag a certain number of levels removed from the query tag.
    • Example: xents filter -td 2 "organic chemistry" will return everything explicitly tagged with any tag between 0 and 2 layers down from “organic chemistry”. In this example, files tagged with “carbon nanomaterials” will be returned but files tagged with only “carbon nanotubes” will not.
    • Note: Can be combined with Traversal Down by Increment -tu <count> -td <count>. For example xents -tu 1 -td 2 will traverse one node up the tree then return everything recursively down two layers from that.
  • Traverse Up by Count -tu
    • Usage: xents filter -tu <count>
    • Description: Recursive by default.
    • Example: xents -tu 1 "organic chemistry" will traverse one node up the tag tree then return everything recursively down from that
    • Note: Can be combined with Traversal Up by Increment -td <count> -tu <count>
<<<Back toCoding

Made with Sculblog