Context / Client / get_ontology
get_ontology¶
- Context.Client.get_ontology(**kwargs)¶
Returns an ontology’s status and one of its versions.
See also: AWS API Documentation
Request Syntax
response = client.get_ontology( ontologyId='string', version='string', sourceFormat='TURTLE' )
- Parameters:
ontologyId (string) –
[REQUIRED]
The ontology to return, by its ID or ARN (see
OntologyIdentifier).version (string) – The version to return, in MAJOR.MINOR.PATCH form, for example
1.0.0. If you omit it, GetOntology returns the current default version.sourceFormat (string) – Return the version’s source document in
source, in this format, in place of the template. The response then has notemplate. The format must be the version’ssourceFormat. On aDRAFTontology, GetOntology returns the draft, with or withoutversion(its only version is 1.0.0). If the ontology is AWS managed, whose source is never returned, or the version has no source document, the request fails withValidationException. If you omit it, the response has the template and no source.
- Return type:
dict
- Returns:
Response Syntax
{ 'arn': 'string', 'version': 'string', 'template': 'string', 'createdAt': datetime(2015, 1, 1), 'publishedAt': datetime(2015, 1, 1), 'name': 'string', 'description': 'string', 'derivationVersion': 'string', 'id': 'string', 'status': 'DRAFT'|'PUBLISHED', 'updatedAt': datetime(2015, 1, 1), 'ontologyInductionId': 'string', 'source': 'string', 'sourceFormat': 'TURTLE', 'revisionId': 'string', 'validationIssues': [ { 'code': 'string', 'message': 'string', 'line': 123, 'subject': 'string' }, ] }
Response Structure
(dict) –
The resolved ontology version’s metadata and template, and the ontology’s status. With
sourceFormat, the response carries no template, andsourcecarries the version’s source document, or the draft on a DRAFT, with or withoutversion. A DRAFT also returnsrevisionId, and the draft’s warnings invalidationIssues.arn (string) –
The ARN of the ontology. It has no account for an AWS managed ontology, and includes the account for a customer-owned one. Use it to address the same ontology again.
version (string) –
The version of the ontology, in MAJOR.MINOR.PATCH form, for example
1.0.0.template (string) –
The serialized template JSON for this version (see OntologyTemplate).
createdAt (datetime) –
When this version was created. Absent when the stored version carries no creation time.
publishedAt (datetime) –
Publish time of the DEFAULT version. Absent for non-default versions, and while the ontology is DRAFT: a DRAFT ontology stays a draft until you publish it in the AWS Context console.
name (string) –
The ontology’s current display name. The same for every version. Absent for an AWS managed ontology, which has no name, and for a customer-owned ontology that was created without a name and hasn’t been named since.
description (string) –
The ontology’s description. The same for every version. Absent when the ontology has none.
derivationVersion (string) –
Identifies the derivation rules that produced this template. Node ID formulas don’t change after a version is published.
id (string) –
The ID of the ontology, assigned by AWS Context.
status (string) –
The ontology’s status. PUBLISHED for every ontology CreateOntology made. Check it before using the template: a DRAFT ontology stays a draft until you publish it in the AWS Context console, and until then its template is the empty template of version 1.0.0 and GetOntology returns the draft.
updatedAt (datetime) –
When the ontology itself last changed. Equal to the ontology’s creation time until the first update. The top-level
createdAt(from the version fields) is the returned version’s creation time, not the ontology’s.ontologyInductionId (string) –
The induction that made the ontology. Absent for an ontology CreateOntology made.
source (string) –
The source document of the returned version, or the draft of a
DRAFTontology, with or withoutversion. Set only when the request setsourceFormat. Absent otherwise.sourceFormat (string) –
The format of the version’s source document. On a
DRAFT,TURTLE, the format of the draft. Set whether or not the request asked forsource, and asourcein the response is in this format. On an AWS managed ontology, it names the format that its template was derived from, but its source is never returned (seesourceFormaton the request).revisionId (string) –
The revision of the draft. Set only for a DRAFT ontology.
validationIssues (list) –
Non-fatal warnings raised while deriving the returned version. On a DRAFT, the warnings from deriving the draft.
(dict) –
One reason an uploaded ontology was rejected, or a non-fatal warning about a construct that could not be fully represented in the derived template, also in the draft of an induced ontology.
code (string) –
A code that identifies the issue, such as
RDF_PARSE_ERRORorUNMAPPABLE_CLASS. New codes can be added, so handle a code that you don’t recognize.message (string) –
A human-readable description of the issue.
line (integer) –
1-based line in the uploaded source, when the failure is attributable to a specific triple.
subject (string) –
What the issue is about, when attributable. From an ontology operation, such as GetOntology: the offending subject/predicate IRI. In the draft of an induced ontology, the IRI of a term.
Exceptions
Context.Client.exceptions.ThrottlingExceptionContext.Client.exceptions.ValidationExceptionContext.Client.exceptions.InternalServerExceptionContext.Client.exceptions.ResourceNotFoundExceptionContext.Client.exceptions.AccessDeniedException