ASIMOV Program Patterns Specification (PPS)

Living Standard,

This version:
https://asimov-specs.github.io/program-patterns/
Issue Tracking:
GitHub
Editor:
(ASIMOV Systems)

Abstract

Establishes standardized programming patterns and best practices for developing robust and maintainable ASIMOV software components.

1. Introduction

The [ASIMOV] Platform is a polyglot development platform for trustworthy, neurosymbolic AI.

This specification establishes standardized programming patterns and best practices for developing robust and maintainable ASIMOV software components.

2. Examples

3. Patterns

Name Summary Input Arity Output Arity
Adapter RDF dataset proxy. SPARQL 1 RDF N
Cataloger Directory iterator. URL 1 RDF N
Compiler Prompt compiler. text 1 SPARQL 1
Emitter Value generator. - 0 RDF N
Fetcher URL protocol client. URL 1 RDF 1
Indexer RDF dataset indexer. RDF N - 0
Prompter LLM inference provider. text 1 text 1
Reader RDF dataset importer. any 1 RDF N
Reasoner RDF dataset entailer. RDF N RDF N
Resolver URI resolver. URI 1 URL N
Runner Language runtime engine. any 1 text 1
Writer RDF dataset exporter. RDF N any 1

3.1. Adapter

RDF dataset proxy. Consumes SPARQL input, produces RDF output.

Data flow for adapters

3.1.1. Arguments

Argument Arity Default Summary
QUERY-FILE 1 - (/dev/stdin) The SPARQL query file path.

3.1.2. Options

Option Flag Default Summary
--output=FORMAT -o jsonl The output format.

3.2. Cataloger

Directory iterator. Takes a URL input, produces RDF output.

Data flow for catalogers

3.2.1. Arguments

Argument Arity Default Summary
INPUT-URL 1 none The input URL.

3.2.2. Options

Option Flag Default Summary
--limit=COUNT -n none The maximum number of outputs.
--output=FORMAT -o jsonl The output format.

3.3. Compiler

Prompt compiler. Consumes natural-language text input, produces a corresponding SPARQL graph query as output.

Data flow for compilers

3.3.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.

3.3.2. Options

Option Flag Default Summary

3.4. Emitter

Value generator. Takes no input, produces an RDF output.

Data flow for emitters

3.4.1. Arguments

Emitters require no positional arguments.

3.4.2. Options

Option Flag Default Summary
--output=FORMAT -o jsonl The output format.

3.5. Fetcher

URL protocol fetcher. Consumes a URL input, produces RDF output.

Data flow for fetchers

3.5.1. Arguments

Argument Arity Default Summary
INPUT-URL 1 none The input URL.

3.5.2. Options

Option Flag Default Summary
--output=FORMAT -o jsonl The output format.

3.6. Indexer

RDF dataset indexer. Consumes RDF input, maintains a persistent index.

Data flow for indexers

3.6.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.
INDEX-FILE 1 none The index file path.

3.6.2. Options

Option Flag Default Summary
--input=FORMAT -i jsonl The input format.

3.7. Prompter

LLM inference provider. Consumes prompt input, produces response output.

Data flow for prompters

3.7.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.
OUTPUT-FILE 0..1 - (/dev/stdout) The output file path.

3.7.2. Options

Option Flag Default Summary
--input=FORMAT -i text The input format.
--model=MODEL -m auto The inference model.
--output=FORMAT -o text The output format.

3.8. Reader

RDF dataset importer. Consumes some input, produces RDF output.

Data flow for readers

3.8.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.
OUTPUT-FILE 0..1 - (/dev/stdout) The output file path.

3.8.2. Options

Option Flag Default Summary
--input=FORMAT -i auto The input format.
--output=FORMAT -o jsonl The output format.

3.9. Reasoner

RDF dataset entailer. Consumes RDF input, produces entailed RDF output.

Data flow for reasoners

3.9.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.
OUTPUT-FILE 0..1 - (/dev/stdout) The output file path.

3.9.2. Options

Option Flag Default Summary
--input=FORMAT -i jsonl The input format.
--output=FORMAT -o jsonl The output format.

3.10. Resolver

URI resolver. Takes a URI (that is, URN or URL) input, produces a resolved URL output.

Data flow for resolvers

3.10.1. Arguments

Argument Arity Default Summary
INPUT-URL 0..1 none The input URL.

3.10.2. Options

Option Flag Default Summary
--limit=COUNT -n none The maximum number of outputs.

3.11. Runner

Language runtime engine. Consumes text input conforming to a grammar, executes it, and produces the execution result as output.

Data flow for runners

3.11.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.

3.11.2. Options

Option Flag Default Summary
--define=VAR=VAL -D none A key/value definition.

3.12. Writer

RDF dataset exporter. Consumes RDF input, produces some output.

Data flow for writers

3.12.1. Arguments

Argument Arity Default Summary
INPUT-FILE 0..1 - (/dev/stdin) The input file path.
OUTPUT-FILE 0..1 - (/dev/stdout) The output file path.

3.12.2. Options

Option Flag Default Summary
--input=FORMAT -i jsonl The input format.
--output=FORMAT -o auto The output format.

4. RDF Mapping

5. Security Considerations

6. IANA Considerations

This specification does not require any IANA registrations.

7. Acknowledgments

The editors would like to thank the ASIMOV Platform community for their contributions and feedback during the development of this specification.

8. Changes

This section will document changes between versions of this specification.

Conformance

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Index

Terms defined by this specification

References

Normative References

[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119

Informative References

[ASIMOV]
Arto Bendiken; et al. ASIMOV Platform Documentation. URL: https://asimov.sh