RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
-
Upload
ruleml -
Category
Technology
-
view
78 -
download
1
Transcript of RuleML2015: API4KP Metamodel: A Meta-API for Heterogeneous Knowledge Platforms
1/19
API4KP Metamodel
API4KP MetamodelA Meta-API for Heterogeneous Knowledge Platforms
T. Athan1 R. Bell2 E. Kendall3 A. Paschke4
D. Sottara5
1Athan Services (athant.com), West Lafayette, Indiana, USA
2Raytheon, Fort Wayne, Indiana, USA
3Thematix Partners LLC, New York, New York, USA
4AG Corporate Semantic Web, Freie Universitaet Berlin, Germany
5Department of Biomedical Informatics, Arizona State University, USA
RuleML Symposium, Berlin, August 2015
2/19
API4KP Metamodel
Outline
1 Scope of the Standard
2 Scenario: The Connected Patient System
3 Foundations: Monads and OBDA Mappings
3/19
API4KP Metamodel
Scope of the Standard
A Meta-API for Knowledge (Reasoning) Platforms (KPs)
A Meta-API is aplatform-independent model (PIM)for a family of APIs in specificlanguages, also called PSMs(platform-specific models).
API4KP provides aPIM for the externalAPIs of KPs.
Figure: A Monolithic KP Architecture.
5/19
API4KP Metamodel
Scope of the Standard
Languages in Scope
Knowledge Representation and Reasoning Languages
Resource Description Framework (RDF)RDF Schema (RDFS)Web Ontology Language (OWL)Common Logic (CL)Event-Condition-Action RuleML (ECA). . .
Data Representation Languages
Extensible Messaging and Presence Protocol (XMPP)JSON. . .
6/19
API4KP Metamodel
Scenario: The Connected Patient System
The Connected Patient System 0: Overview
Figure: A Distributed KP Architecture for Stream Processing, ClinicalDecision Support (CDS) and Case History Storage.
7/19
API4KP Metamodel
Scenario: The Connected Patient System
The Connected Patient System I: Streaming Data andQuery Results
Biomedical devices are available via pub-sub.Streamed data arrive in multiple formats e.g. XMPP, RDFVocabularies are defined in RDFS, OWL, Common Logic (CL).Healthcare providers submit SPARQL queries throughAPI4KP, receiving streamed incremental results, updated asnew data arrive.
Figure: A Heterogeneous Stream Processing KP Architecture.
8/19
API4KP Metamodel
Scenario: The Connected Patient System
The Connected Patient System II: CDS
A Clinical Decision Support System (CDS) is defined usingevent-condition-action (ECA) rules submited throughAPI4KP, reacting to
simple events (e.g. a vital parameter exceeding a threshold)complex events (e.g. a decreasing trend in the average dailyphysical activity)
intervening with alerts and reminders.A failure of response (through API4KP) to an alert leads toescalation to another recipient.
Figure: A Clinical Decision Support (CDS) KP Architecture.
9/19
API4KP Metamodel
Scenario: The Connected Patient System
The Connected Patient System III: Case History
The system maintains a stateful representation for patientsqualifying for clinical pathways.Clinicians check for compliance with planned orders.As medical guidelines evolve, the logic of the pathway mayneed revision: queries to the patient’s history should becontextualized to whatever logic was valid at the time orderswere placed.
Figure: A Case History KP Architecture.
10/19
API4KP Metamodel
Scenario: The Connected Patient System
The Connected Patient System: Complete
Figure: A Distributed KP Architecture.
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
A metamodel is a model about models.Entities in the universe of a KP fall principally into these classes:
Knowledge Sources - Models of the World
Knowledge Environments - Models of Relationships
Knowledge Operations - the Meta-API, Models of APIs
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources : source of machine-readableinformation with semantics.
Knowledge Environments
Knowledge Operations
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Mutable or Immutable (a.k.a Knowledge Resources)By level of abstraction (Knowledge Source Level)Basic or Structured
Knowledge Environments
Knowledge Operations
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Knowledge T Environments : mathematical structure ofmappings, where the domain and codomains of the mappings,called members of the knowledge environment, are instancesof class T.
Knowledge Operations
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Knowledge Environments
Knowledge Operations : functionality (possibly withside-effects. i.e. effects beyond the output value returned)having a knowledge source, environment or operation type inits signature.
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Knowledge Environments
Knowledge Operations
Knowledge Events : successful evaluation or execution of aknowledge operation by a particular application at a particulartime
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources, e.g. the database of the Case History KP.
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources,
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources, e.g.the OWL ontology in the Stream Processing KP.
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources,
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,e.g. the ECA rulebase in the CDS KP.
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources,
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources, e.g.the input and output streams of the Stream Processing KP.
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources,
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources, e.g.the effects generated by the CDS KP.
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources,
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources, e.g. afailed communication from the CDS KP.
Descriptions of state transitions for stateful KnowledgeSources,
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources, e.g. ECA simulations for protocol development.
12/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Structures Needed in API4KP
The various knowledge representations in the scenario require avariety of structures.
Descriptions of I/O programs for persistent KnowledgeSources,
Unordered collections for declarative Knowledge Sources,
Ordered collections for order-prioritized Knowledge Sources,
Concurrent sequences for streamed Knowledge Sources,
Descriptions of side-effects for active Knowledge Sources,
Failure-aware types for reliable Knowledge Sources,
Descriptions of state transitions for stateful KnowledgeSources,
In functional programming, monads have been created for each ofthese cases, providing a concept of equivalence that is isolatedfrom side-effects and non-determinism, which is critical forconceptual modeling.
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
Satisfies the ”Monad Laws”
has a ”unit” method to generate a simple instance of M[A]from some Ahas a ”join” method to flatten an instance of M[M[A]] to M[A]e.g. List[int].join( 〈 〈1,2〉, 〈3,4〉 〉 ) = 〈1,2,3,4〉
14/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
Well-Known Monads
Persistence: IO
Unordered without Multiplicity: Set
Ordered with Multiplicity: List
Concurrency: Future, Observable
Side-effects: Task
Failure: Maybe/Option/Try/Either
State Transitions: State
...
15/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
NestedM: a monad based on the free M monad
The simplest example of a structure for knowledge resources is setsof sets. There is a set monad, Set[A]: a set whose members are oftype A.
NestedSet[B] = Set[B + NestedSet[B]]
where B would be the type for Basic Knowledge Resource and +repsresents disjoint union, a.k.a. coproduct. But Set is just oneparticular kind of monad. For any monad M, we may defineanother monad NestedM:
NestedM[B] = M[B + NestedM[B]]
NestedM is related to the free monad of M through the equivalence
FreeM[B] ≡ B + NestedM[B]
16/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
API4KP Structured Knowledge Resources
The structure of API4KP Structured Knowledge Resources can beany NestedM monad that is compatible with the semantics of itscontent.Details are available in the API4KP repositoryhttps://github.com/API4KBs/api4kbs/blob/currying/Monad_Trees.pdf
17/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
General Data Formats Included in HeterogeneousLanguage Environments
Knowledge Resources in API4KP include resources in formatswithout inherent semantics, such as XML, JSON or SQL, wherethe semantics is provided by mapping into knowledgerepresentation and reasoning (KRR) language.
The monadic character of structured knowledge resourcesallows environment mappings to be applied within thestructure.
To apply semantics, it is sufficient that the focus of aheterogeneous language environment be a KRR language.
Further, mappings from KRR languages to data formats areuseful in persistence, e.g. in a database.
18/19
API4KP Metamodel
Summary
Summary
The Connected Patient System scenario encompasses anumber of architectural paradigms that should be addressedby API4KP.
A monadic nesting structure has been created forcompatibility with the diversity of semantic aspects illustratedin the scenario, including order, state, concurrency,side-effects, serialization and I/O.
An extended concept of heterogeneous environment isemployed in order to cover mapping between domain-specificdata formats and knowledge representation languages.
OutlookAn initial submission of API4KP to OMG is anticipated inNovember 2015.Development of the metamodel will continue, with thespecification of operations making explicit use of monads.
19/19
API4KP Metamodel
Summary
Thanks to
Roger Burkhart
James Odell
Ed Skoviak
Ralph Schafermeier
Bobbin Teegarden
Evan Wallace
The DOL Committee
...
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Mutable or Immutable (a.k.a Knowledge Resources)By level of abstraction (Knowledge Source Level)
Item - physical source, e.g. on hard disk or in memoryManifestation - concrete syntax, e.g. OWL axiom inManchester syntaxExpression - abstract syntax, e.g. OWL axiomAsset - equivalence class of Knowledge Expressions, with someequivalence relation e.g. logical equivalence
Basic or Structured
Knowledge Environments
Knowledge Operations
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Knowledge T Environments
Member type T: Language, Format, ...FocusedPreserving
Knowledge Operations
Knowledge Events
11/19
API4KP Metamodel
Scenario: The Connected Patient System
API4KP Metamodel: Classes
Entities in the universe of a KP fall principally into these classes:
Knowledge Sources
Knowledge Environments
Knowledge OperationsActions (unary)
Lifting, Lowering, Horizontal, Higher-Order, VoidIdempotentPreserving
Knowledge Events
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A] , e.g. thetype of lists with a generic parameter, List[A]
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
List is a monadList[int] is a monadic type〈1,2,3〉 is an instance of type List[int]
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
has a map method allowing a function to be applied to eachelement of the list while preserving composition
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
has a map method allowing a function to be applied to eachelement of the list while preserving compositionList[int].map( 〈1,2,3〉, s → 2*s) = 〈2, 4, 6〉List[int].map( 〈2,4,6〉, s → 〈s,2*s〉) = 〈 〈2,4〉, 〈4,8〉, 〈6,12〉 〉Exercise for the Reader: showList[int].map( List[int].map( x, f), g) =List[int].map( x, f o g )
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
Satisfies the ”Monad Laws”
has a ”unit” method to generate a simple instance of M[A]from some A
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
Satisfies the ”Monad Laws”
has a ”unit” method to generate a simple instance of M[A]from some A e.g. List[int].unit(3) = 〈3〉
13/19
API4KP Metamodel
Foundations: Monads and OBDA Mappings
What is a Monad (in Functional Programming?
Endofunctor on the category of types, A → M[A]
Satisfies the ”Monad Laws”
has a ”unit” method to generate a simple instance of M[A]from some Ahas a ”join” method to flatten an instance of M[M[A]] to M[A]