REST API (indra_world.service.app)

class indra_world.service.app.AddProjectRecords(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Add project records and assemble them.

Parameters:
  • project_id (str) – ID of a project to add records.

  • records (list[dict]) – A list of records to add, each should have a ‘storage_key’.

Returns:

delta_json – A JSON representation of AssemblyDelta.

Return type:

json

class indra_world.service.app.CwmsProcessText(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Process text with CWMS and return INDRA Statements.

Parameters:

text (str) – Text to process

Returns:

statements – A list of extracted INDRA Statements.

Return type:

list[indra.statements.Statement.to_json()]

class indra_world.service.app.EidosProcessJsonld(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Process an EIDOS JSON-LD and return INDRA Statements.

Parameters:
  • jsonld (str) – The JSON-LD string to be processed.

  • grounding_ns (Optional[list]) – A list of name spaces for which INDRA should represent groundings, when given. If not specified or None, all grounding name spaces are propagated. If an empty list, no groundings are propagated. Example: [‘UN’, ‘WM’], Default: None

  • extract_filter (Optional[list]) – A list of relation types to extract. Valid values in the list are ‘influence’, ‘association’, ‘event’. If not given, all relation types are extracted. This argument can be used if, for instance, only Influence statements are of interest. Default: None

  • grounding_mode (Optional[str]) – Selects whether ‘flat’ or ‘compositional’ groundings should be extracted. Default: ‘flat’.

Returns:

statements – A list of extracted INDRA Statements.

Return type:

list[indra.statements.Statement.to_json()]

class indra_world.service.app.EidosProcessText(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Process text with EIDOS and return INDRA Statements.

Parameters:
  • text (str) – The text to be processed.

  • webservice (Optional[str]) – An Eidos reader web service URL to send the request to. If None, the reading is assumed to be done with the Eidos JAR rather than via a web service. Default: None

  • grounding_ns (Optional[list]) – A list of name spaces for which INDRA should represent groundings, when given. If not specified or None, all grounding name spaces are propagated. If an empty list, no groundings are propagated. Example: [‘UN’, ‘WM’], Default: None

  • extract_filter (Optional[list]) – A list of relation types to extract. Valid values in the list are ‘influence’, ‘association’, ‘event’. If not given, all relation types are extracted. This argument can be used if, for instance, only Influence statements are of interest. Default: None

  • grounding_mode (Optional[str]) – Selects whether ‘flat’ or ‘compositional’ groundings should be extracted. Default: ‘flat’.

Returns:

statements – A list of extracted INDRA Statements.

Return type:

list[indra.statements.Statement.to_json()]

class indra_world.service.app.GetAllRecords(api=None, *args, **kwargs)[source]
get()[source]

Get all DART records captured by the service.

Returns:

records – A list of records.

Return type:

list[dict]

methods: Optional[List[str]] = {'GET', 'OPTIONS'}

A list of methods this view can handle.

class indra_world.service.app.GetProjectCurations(api=None, *args, **kwargs)[source]
get()[source]

Get project curations.

Parameters:

project_id (str) – ID of a project.

Returns:

curations – A list of curations for the project.

Return type:

list[dict]

methods: Optional[List[str]] = {'GET', 'OPTIONS'}

A list of methods this view can handle.

class indra_world.service.app.GetProjectRecords(api=None, *args, **kwargs)[source]
get()[source]

Get records for a project.

Parameters:

project_id (str) – ID of a project.

Returns:

records – A list of records for the project.

Return type:

list[dict]

methods: Optional[List[str]] = {'GET'}

A list of methods this view can handle.

class indra_world.service.app.GetProjects(api=None, *args, **kwargs)[source]
get()[source]

Get a list of all projects.

Returns:

records – A list of projects.

Return type:

list[dict]

methods: Optional[List[str]] = {'GET', 'OPTIONS'}

A list of methods this view can handle.

class indra_world.service.app.Health(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'GET', 'OPTIONS'}

A list of methods this view can handle.

class indra_world.service.app.HumeProcessJsonld(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Process Hume JSON-LD and return INDRA Statements.

Parameters:

jsonld (str) – The JSON-LD string to be processed.

Returns:

statements – A list of extracted INDRA Statements.

Return type:

list[indra.statements.Statement.to_json()]

class indra_world.service.app.NewProject(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Create new project.

Parameters:
  • project_id (str) – ID of a new project.

  • project_name (str) – Name of a new project.

  • corpus_id (str) – ID of a corpus.

class indra_world.service.app.Notify(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Add and process DART record.

Parameters:
  • identity (str) – Name of the reader.

  • version (str) – Reader version.

  • document_id (str) – ID of a document to process.

  • storage_key (str) – Key to store the record with.

  • output_version (str) – The output version (typically ontology version).

  • labels (list of str) – A list of labels for the output.

  • tenants (list of str) – A list of tenants for the output.

class indra_world.service.app.SofiaProcessJson(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Process a Sofia JSON and return INDRA Statements.

Parameters:
  • json (str) – The JSON string to be processed.

  • extract_filter (Optional[list]) – A list of relation types to extract. Valid values in the list are ‘influence’, ‘association’, ‘event’. If not given, all relation types are extracted. This argument can be used if, for instance, only Influence statements are of interest. Default: None

  • grounding_mode (Optional[str]) – Selects whether ‘flat’ or ‘compositional’ groundings should be extracted. Default: ‘flat’.

Returns:

statements – A list of extracted INDRA Statements.

Return type:

list[indra.statements.Statement.to_json()]

class indra_world.service.app.SubmitCurations(api=None, *args, **kwargs)[source]
methods: Optional[List[str]] = {'OPTIONS', 'POST'}

A list of methods this view can handle.

post()[source]

Submit curations.

Parameters:
  • project_id (str) – ID of a project.

  • curations (list[dict]) – A list of curations to submit.

  • calculate_mappings (bool) – Whether to calculate and return a mappings data structure representing the changes made by the curations to the overall project corpus. This is False by default since for large projects this calculation can take a long time.

Returns:

mappings – For any statement matches hashes that have changed due to the curations submitted here, the new hash (after applying the curation) is given. Statements whose hash didn’t change, or if a curation for some reason couldn’t be applied, the given statement is not added to the return value.

Return type:

dict