UiPath Documentation
uipath-cli
latest
false
UiPath CLI user guide

uip ont

Syntax and options for `uip ont`, which authors, checks, and validates UiPath ontologies in a local solution and reads deployed ones.

uip ont authors, checks, and reads UiPath ontologies. An ontology is an ontology resource in a local solution. It maps Data Fabric entities of the same solution to a schema, and its artifact files are kept as one zip next to the solution. Nothing exists on a tenant until the solution is packed, published, and deployed.

Install it with uip tools install ont, or invoke uip ont … and let auto-install run. Refer to Tools (plugins) for the install model. ont is the command prefix; the underlying package is @uipath/ontology-tool.

Most commands work on the solution on disk and need no login. Three commands call the Ontology service and need uip login: validate, and get and list with --folder-key or --folder-path.

Synopsis​

uip ont create <name> --local [--entity <name>]... [--display-name <text>] [--description <text>]
uip ont get <name> (--local | --folder-key <guid> | --folder-path <path>)
uip ont list (--local | --folder-key <guid> | --folder-path <path>) [-l <n>] [--offset <n>]
uip ont update <name> --local [--add-entity <name>]... [--remove-entity <name>]... [--display-name <text>] [--description <text>]
uip ont delete <name> --local -y
uip ont files add <name> <files...> --local [--type <type>]
uip ont files list <name> (--local | --package <zip>)
uip ont files remove <name> <files...> --local
uip ont validate [name] --local
uip ont artifacts check <file> [--type <type>] [--content <text>]
uip ont create <name> --local [--entity <name>]... [--display-name <text>] [--description <text>]
uip ont get <name> (--local | --folder-key <guid> | --folder-path <path>)
uip ont list (--local | --folder-key <guid> | --folder-path <path>) [-l <n>] [--offset <n>]
uip ont update <name> --local [--add-entity <name>]... [--remove-entity <name>]... [--display-name <text>] [--description <text>]
uip ont delete <name> --local -y
uip ont files add <name> <files...> --local [--type <type>]
uip ont files list <name> (--local | --package <zip>)
uip ont files remove <name> <files...> --local
uip ont validate [name] --local
uip ont artifacts check <file> [--type <type>] [--content <text>]

Commands​

CommandPurpose
createCreate an ontology resource in the local solution, with no artifacts yet.
getShow an ontology of the local solution, or a deployed one.
listList the ontologies of the local solution, or the ones deployed in a folder.
updateChange an ontology's entities, display name, or description.
deleteDelete an ontology and its attached zip.
files addCheck artifact files and attach them to an ontology.
files listList the artifacts of a local ontology, or of one in a packed solution.
files removeRemove artifact files from an ontology.
validateRun the convention and cross-file rules, then the Ontology service's check.
artifacts checkCheck one artifact file against the convention rules, offline.

--local and --solution-folder​

  • --local is required on every command that reads or changes the solution on disk. Without it, the command fails with Code: LocalFlagRequired.
  • get and list take one of --local, --folder-key, or --folder-path. Two of them together fail with LocalAndFolderConflict or FolderKeyAndPathConflict.
  • --solution-folder <path> names the folder that holds the solution's .uipx file. It defaults to the current directory. A folder without a .uipx file fails with NoParentSolution.

Artifact types​

An ontology holds five artifact types. The file extension decides the type.

TypeExtensionsCount
schema.ofnExactly one.
constraints.ttlOptional, any number.
mapping.yarrrml.yml, .yml, .yamlExactly one.
summary.jsonAt most one.
context.jsonAt most one.

A .json file is ambiguous. End its name with -summary or -context before the extension, for example sales-summary.json, or pass --type.

Artifact names use letters, digits, ., _, and -, start with a letter or a digit, and end in an extension. ontology.json is reserved for the zip's manifest.

uip ont create​

Create an ontology resource in the local solution. The ontology has no artifacts until files add attaches them.

Arguments​

NameRequiredPurpose
<name>yesOntology name, unique in the solution, ignoring case.

Options​

ShortLongValueDefaultDescription
—--localflag—Required. Act on the ontologies authored in the local solution.
—--entityname—Local entity the ontology maps. Repeatable. The entity must be an entity resource of the solution. Refer to Local entities.
—--display-nametextthe nameDisplay name.
—--descriptiontext—Description.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Example​

uip ont create Sales --local --entity SalesOrder --entity Customer
uip ont create Sales --local --entity SalesOrder --entity Customer

Data shape (--output json)​

{
  "Code": "OntologyCreated",
  "Data": {
    "Name": "Sales",
    "DisplayName": "Sales",
    "Key": "11111111-2222-3333-4444-555555555555",
    "Entities": ["SalesOrder", "Customer"],
    "Artifacts": []
  }
}
{
  "Code": "OntologyCreated",
  "Data": {
    "Name": "Sales",
    "DisplayName": "Sales",
    "Key": "11111111-2222-3333-4444-555555555555",
    "Entities": ["SalesOrder", "Customer"],
    "Artifacts": []
  }
}

uip ont get​

Show one ontology. With --local, the command reads the solution on disk. With --folder-key or --folder-path, it reads the deployed ontology from the Ontology service. The deployed read changes nothing.

Arguments​

NameRequiredPurpose
<name>yesOntology name. For a deployed ontology, the name it was deployed under.

Options​

ShortLongValueDefaultDescription
—--localflag—Read the ontology authored in the local solution.
—--folder-keyGUID—Key of the deployment folder. Reads the deployed ontology. Needs uip login.
—--folder-pathpath—Path of the deployment folder, for example Shared/Finance. Reads the deployed ontology. Needs uip login.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Examples​

# An ontology authored in the local solution
uip ont get Sales --local

# A deployed ontology, by folder key or by folder path
uip ont get Sales --folder-key aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
uip ont get Sales --folder-path "Shared/Finance"
# An ontology authored in the local solution
uip ont get Sales --local

# A deployed ontology, by folder key or by folder path
uip ont get Sales --folder-key aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
uip ont get Sales --folder-path "Shared/Finance"

Data shape (--output json)​

A local ontology returns the same Data as create, with one entry per attached artifact under Artifacts. A deployed ontology returns:

{
  "Code": "OntologyDetails",
  "Data": {
    "Id": "99999999-8888-7777-6666-555555555555",
    "Name": "Sales",
    "DisplayName": "Sales",
    "State": "DEPLOYED",
    "FolderKey": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
  }
}
{
  "Code": "OntologyDetails",
  "Data": {
    "Id": "99999999-8888-7777-6666-555555555555",
    "Name": "Sales",
    "DisplayName": "Sales",
    "State": "DEPLOYED",
    "FolderKey": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
  }
}

FolderKey is the key the service returned, also when the folder was named by --folder-path.

uip ont list​

List the ontologies of the local solution, or the ontologies deployed in a folder.

Options​

ShortLongValueDefaultDescription
—--localflag—List the ontologies authored in the local solution.
—--folder-keyGUID—Key of the deployment folder. Lists the deployed ontologies. Needs uip login.
—--folder-pathpath—Path of the deployment folder, for example Shared/Finance. Lists the deployed ontologies. Needs uip login.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.
-l--limitnumberallReturn at most this many rows.
—--offsetnumber0Skip this many rows before the first one returned.

Examples​

uip ont list --local
uip ont list --folder-path "Shared/Finance" --limit 20
uip ont list --local
uip ont list --folder-path "Shared/Finance" --limit 20

Data shape (--output json)​

Code is OntologyList. Data is an array of rows in the shape get returns: local rows for --local, deployed rows for a folder. An empty list returns Data: []. With --limit or --offset, the response also carries Pagination.

uip ont update​

Change the entities, the display name, or the description of a local ontology.

Arguments​

NameRequiredPurpose
<name>yesOntology name.

Options​

ShortLongValueDefaultDescription
—--localflag—Required. Act on the ontologies authored in the local solution.
—--add-entityname—Local entity to add. Repeatable.
—--remove-entityname—Entity to remove, by name. Repeatable.
—--display-nametext—New display name.
—--descriptiontext—New description.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Example​

uip ont update Sales --local --add-entity Invoice --remove-entity Customer \
    --display-name "Sales ontology"
uip ont update Sales --local --add-entity Invoice --remove-entity Customer \
    --display-name "Sales ontology"

Data shape (--output json)​

Code is OntologyUpdated. Data has the same shape as create, with the new values.

uip ont delete​

Delete a local ontology and its attached zip.

Arguments​

NameRequiredPurpose
<name>yesOntology name.

Options​

ShortLongValueDefaultDescription
—--localflag—Required. Act on the ontologies authored in the local solution.
-y--yesflag—Required. Confirm the deletion. The command never prompts. Without it, the command fails with Code: ConfirmationRequired and ErrorCode: confirmation_required.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Example​

uip ont delete Sales --local --yes
uip ont delete Sales --local --yes

Data shape (--output json)​

{
  "Code": "OntologyDeleted",
  "Data": {
    "Name": "Sales",
    "Key": "11111111-2222-3333-4444-555555555555"
  }
}
{
  "Code": "OntologyDeleted",
  "Data": {
    "Name": "Sales",
    "Key": "11111111-2222-3333-4444-555555555555"
  }
}

uip ont files add​

Check artifact files and attach them to a local ontology. The command checks every file with the per-file rules first. When one file fails, nothing is attached. A file added under a name the ontology already holds replaces that artifact.

Arguments​

NameRequiredPurpose
<name>yesOntology name.
<files...>yesOne or more artifact files to attach.

Options​

ShortLongValueDefaultDescription
—--localflag—Required. Act on the ontologies authored in the local solution.
—--typetypefrom the extensionArtifact type, for a file whose extension does not decide it. Refer to Artifact types.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Example​

uip ont files add Sales ./sales.ofn ./sales-mapping.yarrrml.yml \
    ./sales-summary.json ./sales-context.json --local
uip ont files add Sales ./sales.ofn ./sales-mapping.yarrrml.yml \
    ./sales-summary.json ./sales-context.json --local

Data shape (--output json)​

{
  "Code": "OntologyFilesAdded",
  "Data": {
    "Files": [
      { "FileName": "sales.ofn", "Type": "schema", "Status": "Added" },
      { "FileName": "sales-mapping.yarrrml.yml", "Type": "mapping", "Status": "Added" }
    ],
    "Violations": []
  }
}
{
  "Code": "OntologyFilesAdded",
  "Data": {
    "Files": [
      { "FileName": "sales.ofn", "Type": "schema", "Status": "Added" },
      { "FileName": "sales-mapping.yarrrml.yml", "Type": "mapping", "Status": "Added" }
    ],
    "Violations": []
  }
}

Status is Added or Replaced. Violations lists the WARNING violations, which do not stop the command. When a file has an ERROR violation, the command fails with Code: ArtifactCheckFailed and lists the violations under Data.violations.

uip ont files list​

List the artifacts of a local ontology, or of an ontology in a packed solution.

Arguments​

NameRequiredPurpose
<name>yesOntology name.

Options​

ShortLongValueDefaultDescription
—--localflag—Read the ontology in the local solution.
—--packagezip—Read the ontology in a packed solution, the .zip that uip solution pack writes. Cannot be combined with --local.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Examples​

uip ont files list Sales --local
uip ont files list Sales --package ./out/SalesSolution_1.0.0.zip
uip ont files list Sales --local
uip ont files list Sales --package ./out/SalesSolution_1.0.0.zip

Data shape (--output json)​

{
  "Code": "OntologyFilesList",
  "Data": {
    "Name": "Sales",
    "StoredName": "Sales.zip",
    "Artifacts": [
      {
        "FileName": "sales.ofn",
        "Type": "schema",
        "MediaType": "text/owl-functional",
        "SizeBytes": 1204,
        "Checksum": "<sha-256-checksum>"
      }
    ]
  }
}
{
  "Code": "OntologyFilesList",
  "Data": {
    "Name": "Sales",
    "StoredName": "Sales.zip",
    "Artifacts": [
      {
        "FileName": "sales.ofn",
        "Type": "schema",
        "MediaType": "text/owl-functional",
        "SizeBytes": 1204,
        "Checksum": "<sha-256-checksum>"
      }
    ]
  }
}

uip ont files remove​

Remove artifact files from a local ontology's zip.

Arguments​

NameRequiredPurpose
<name>yesOntology name.
<files...>yesOne or more artifact file names to remove.

Options​

ShortLongValueDefaultDescription
—--localflag—Required. Act on the ontologies authored in the local solution.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Example​

uip ont files remove Sales sales-constraints.ttl --local
uip ont files remove Sales sales-constraints.ttl --local

Data shape (--output json)​

Code is OntologyFilesRemoved. Data.Removed lists the removed file names, and Data.Artifacts lists the artifacts that remain.

uip ont validate​

Validate the ontologies of the local solution. The command runs the per-file rules and the cross-file rules against the current local entities. For each ontology without an ERROR violation, it then sends the artifacts to the Ontology service for a syntax check. The service check stores nothing on the tenant.

The service check needs uip login. The local rules run first, so their results are in Data also when the service check cannot run.

Arguments​

NameRequiredPurpose
[name]noValidate only this ontology. Omitted, every ontology in the solution is validated.

Options​

ShortLongValueDefaultDescription
—--localflag—Required. Act on the ontologies authored in the local solution.
—--solution-folderpathcurrent directorySolution folder that holds the .uipx file.

Examples​

# Validate every ontology in the solution
uip ont validate --local

# Validate one ontology
uip ont validate Sales --local
# Validate every ontology in the solution
uip ont validate --local

# Validate one ontology
uip ont validate Sales --local

Data shape (--output json)​

{
  "Code": "OntologyValidated",
  "Data": [
    {
      "Name": "Sales",
      "Valid": true,
      "ServiceValidation": "Done",
      "Violations": []
    }
  ]
}
{
  "Code": "OntologyValidated",
  "Data": [
    {
      "Name": "Sales",
      "Valid": true,
      "ServiceValidation": "Done",
      "Violations": []
    }
  ]
}

ServiceValidation is Done when the service checked the ontology, and Skipped when a local ERROR violation stopped the check.

Failures​

CodeErrorCodeExitCause
ValidationFailedinvalid_argument1An ontology has an ERROR violation.
ServiceValidationUnavailableauthentication_required2No login. Run uip login, then validate again.
ServiceValidationUnavailablenot_supported1The connected environment does not offer the Ontology service.
ServiceValidationFailedvaries1The Ontology service could not validate an artifact.

On each of these failures, Data still lists one entry per ontology. The keys of a failure's Data are lower case: name, valid, serviceValidation, and violations.

uip ont artifacts check​

Check one artifact file against the per-file rules. The command runs offline: it makes no network call and needs no solution. The file name decides the artifact type the same way as in files add, so the file is checked as the type it is attached as.

The command checks UiPath conventions only. The Ontology service checks the syntax of the file during validate.

Arguments​

NameRequiredPurpose
<file>yesArtifact file to check.

Options​

ShortLongValueDefaultDescription
—--typeschema | constraints | mapping | summary | contextfrom the extensionArtifact type, for a .json file whose name ends in neither -summary nor -context. The type must be one the extension allows.
—--contenttext—Check this text instead of reading the file. <file> still names the artifact.

Examples​

uip ont artifacts check ./sales.ofn
uip ont artifacts check ./orders.json --type context
uip ont artifacts check ./sales.ofn
uip ont artifacts check ./orders.json --type context

Data shape (--output json)​

{
  "Code": "ArtifactChecked",
  "Data": {
    "Type": "schema",
    "MediaType": "text/owl-functional",
    "RuleSetId": "ofn",
    "PassedRules": 5,
    "FailedRules": 0,
    "Violations": []
  }
}
{
  "Code": "ArtifactChecked",
  "Data": {
    "Type": "schema",
    "MediaType": "text/owl-functional",
    "RuleSetId": "ofn",
    "PassedRules": 5,
    "FailedRules": 0,
    "Violations": []
  }
}

When an ERROR rule fires, the command exits 1 with Result: Failure, Code: ArtifactChecked, and ErrorCode: invalid_argument. Data carries the same fields with lower-case keys, and Data.violations lists every violation.

Violations and rules​

Each violation has these fields:

FieldMeaning
ruleRule ID, for example OFN-002.
severityERROR or WARNING. An ERROR fails validate, files add, and artifacts check. A WARNING does not.
messageWhat the rule found.
suggestionHow to fix it, when the rule has a suggestion.
fileThe artifact the violation is in, when it belongs to one file.
sourcelocal for a rule the CLI runs, service for a finding of the Ontology service.

Per-file rules​

files add, validate, and artifacts check run these rules on each file.

Schema (.ofn):

RuleSeverityChecks
OFN-001ERRORThe ontology IRI starts with https://ontology.uipath.com/.
OFN-002ERRORData properties are named ClassName.fieldName.
OFN-004WARNINGEvery class has an rdfs:label.
OFN-005WARNINGEvery object property has an rdfs:label.
OFN-009ERRORNo data property is named has{Prop}.

Constraints (.ttl):

RuleSeverityChecks
SHC-002ERROREvery sh:targetClass is on an sh:NodeShape.
SHC-003ERROREvery sh:NodeShape has an sh:targetClass.
SHC-004WARNINGEvery shape has an rdfs:label.
SHC-006WARNINGProperty blocks have sh:maxCount.
SHC-007WARNINGProperty blocks have sh:name.
SHC-008WARNINGAt least one property has sh:minCount 1.
SHC-009WARNINGDecimal properties have sh:minInclusive.
SHC-010WARNINGRelationship paths use sh:class.
SHC-011WARNINGThe file declares at least one SHACL shape.

Mapping (.yarrrml.yml, .yml, .yaml):

RuleSeverityChecks
MAP-002ERRORMappings read access: datafabric table sources.
MAP-004ERRORThe subject template is prefix:ClassName/$(field).
MAP-005ERROREach mapping asserts an a <Class> type.
MAP-006WARNINGRelationships are inline ~iri values.
MAP-012ERRORThe mapping holds no Data Fabric IDs (entityId, folderId). It names each entity by table: only.

Context and summary (.json):

RuleSeverityChecks
CTX-001ERRORThe context is JSON with a root @context.
CTX-002ERROR@base is declared.
CTX-003ERRORThe xsd prefix is declared.
CTX-005ERROREach term has @id and @type.
CTX-006WARNINGRelation terms use "@type": "@id".
CTX-007WARNING@id uses the ontology prefix.
SUM-001ERRORThe summary is JSON.
SUM-002WARNINGThe top level of the summary is an object.
SUM-003ERRORThe summary has no root @context. A file with one is a context file.

Cross-file rules​

validate runs these rules on the whole ontology, against the current local entities. files add also runs ZIP-001.

RuleSeverityChecks
ZIP-001ERRORThe zip fits the service limits: each artifact at most 10 MiB, the zip at most 50 MiB and 64 entries.
XF-001ERROROne schema, one mapping, any number of constraints, at most one summary, and at most one context.
XF-002ERROR, or WARNING for a display name or description that differsThe zip's manifest matches the artifacts and the resource.
XF-003ERRORIRIs use https://ontology.uipath.com/<name>.
XF-004ERRORThe shape: prefix is https://ontology.uipath.com/shapes#.
XF-005ERRORThe schema stays in the OWL 2 QL profile.
XF-006ERROREvery ont: term in the mapping is declared in the schema.
XF-007ERROREvery term has rdfs:label and rdfs:comment.
XF-008ERRORConstraints name declared schema terms.
XF-009ERROREvery class is a property domain and is instantiated in the mapping.
XF-010ERROR, or WARNING for a class without a shapeEvery property is mapped. When the ontology has a constraints file, every class has an sh:targetClass shape.
XF-012ERROR, or WARNING for an entity that no mapping readsEvery mapping reads a table: that is a local entity of the ontology.
XF-013ERROREvery $(column) is a field of its entity. Names are case-sensitive.
XF-014ERROREvery join is a declared object property.
XF-015ERROREvery object property between mapped classes has a join.
XF-017ERRORThe ontology's entities form no relationship cycle. A self-reference is not a cycle.
XF-019ERROREach sh:in on a property mapped from a choice-set field names only values of that local choice set.

Service rule​

RuleSeverityChecks
SVC-001ERROR or WARNING, as the service reports itThe Ontology service's syntax check of an artifact. file names the artifact.

Error codes​

A failure carries its reason in Code, and the CLI-wide classification in ErrorCode. ErrorCode is invalid_argument unless the table says otherwise.

CodeErrorCodeCause
LocalFlagRequiredinvalid_argument--local is missing. On get and list, none of --local, --folder-key, and --folder-path was passed.
LocalAndFolderConflictinvalid_argument--local was combined with --folder-key or --folder-path.
FolderKeyAndPathConflictinvalid_argument--folder-key and --folder-path were combined.
InvalidFolderKeyinvalid_argument--folder-key is not a GUID.
InvalidFolderPathinvalid_argument--folder-path is empty.
InvalidArgumentsinvalid_argumentfiles list got both --local and --package.
NoParentSolutionnot_foundThe solution folder holds no .uipx file.
OntologyNotFoundnot_foundNo ontology has that name, in the solution or in the folder.
OntologyNameTakeninvalid_argumentThe name is in use in the solution, ignoring case.
InvalidOntologyNameinvalid_argumentThe name is not a valid resource name.
EntityNotFoundnot_found--entity, --add-entity, or --remove-entity names an entity that is not a local entity resource.
ConfirmationRequiredconfirmation_requireddelete ran without --yes.
ArtifactNotFoundnot_foundA file to attach cannot be read, or a file to remove is not in the ontology.
InvalidArtifactFileNameinvalid_argumentThe file name breaks the naming rule, or is ontology.json.
ArtifactTypeUnresolvedinvalid_argumentThe extension does not decide the type, or --type does not fit the extension.
ArtifactTypeAlreadyPresentinvalid_argumentA second file of a type that takes one file. Add the file under the existing name to replace it, or remove the old file first.
ArtifactTypeNotSupportednot_supportedThe artifact type cannot be authored with the CLI.
ArtifactCheckFailedinvalid_argumentfiles add found ERROR violations. Nothing is attached.
ResourceFileMissingnot_foundThe ontology's zip is missing from the solution, or the packed solution carries none.
InvalidResourceArchiveinvalid_argumentThe attached zip cannot be read.
PackageNotFoundnot_found--package points at no readable packed solution.
OntologyNotInPackagenot_foundThe packed solution has no ontology of that name.

Where the connected environment does not offer the Ontology service, get and list with --folder-key or --folder-path fail with ErrorCode: not_supported and Retry: RetryWillNotFix. Code is OntologyDetails or OntologyList.

Author and deploy an ontology​

The ontology's entities are local Data Fabric entities of the same solution. The solution carries the ontology to the tenant:

uip solution init SalesSolution && cd SalesSolution
uip df entities create SalesOrder --local --file ./SalesOrder.json
uip df entities create Customer --local --file ./Customer.json
uip ont create Sales --local --entity SalesOrder --entity Customer
uip ont files add Sales ./sales.ofn ./sales-mapping.yarrrml.yml \
    ./sales-summary.json ./sales-context.json --local
uip ont validate --local
uip solution pack . ./out
uip ont files list Sales --package ./out/SalesSolution_1.0.0.zip
uip solution init SalesSolution && cd SalesSolution
uip df entities create SalesOrder --local --file ./SalesOrder.json
uip df entities create Customer --local --file ./Customer.json
uip ont create Sales --local --entity SalesOrder --entity Customer
uip ont files add Sales ./sales.ofn ./sales-mapping.yarrrml.yml \
    ./sales-summary.json ./sales-context.json --local
uip ont validate --local
uip solution pack . ./out
uip ont files list Sales --package ./out/SalesSolution_1.0.0.zip

uip solution publish and uip solution deploy run then publish and deploy the package. uip ont get <name> --folder-path <path> confirms the deployed ontology.

See also​

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated