Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Form Filling
Contents
Introduction
This document describes how the Persona Data Model 2.0 can be used to support a Javascript form filling application (app-card) making API calls into the PDS Client of an active client. We will illustrate by walking through the following scenario rom a cold start (i.e. a clean install of a browser-integrated active client):
- Alice points her browser at staples.com and proceeds to try to buy a stapler. She eventually arrives at a checkout page
- Alice fills in the form and submits it
- Active client builds profile context data structures from what it has observed
- Active client builds persona data structures from profile context structures
- Alice points her browser at bestbuy.com and proceeds to buy a new CD
- Active client attempts to assist Alice in filling the form from persona data
- Alice edits/corrects form elements and submits it
- Active client builds persona structures from what it has observed
Data structures at start
Only one context exists at this point, the root context shown here:
ERRATA: context entityid should be _ContextSingleton
In n3 notation:
:_ContextSingleton rdf:type persona:RootContext . :RootMe rdf:type persona:Persona .
Step 1
Alice eventually ends up at this form:
The form filling Javascript will make a getExAttributes() call into the PDS Client API (of the active client) passing (among other parameters) the above form's submit URL. This causes the PDS Client to instantiate a new ProfileContext whose name is derived from the form submit URL (and Alice's id) and whose schema (ontology) is "staples.com.owl" (which in turn is based on PDM (persona.owl)). This staples.com.owl ontology includes the mapping rules to map staples-specific HTML form elements into the PDM.
Alice's staples ProfileContext is (other than the ontology definitions) empty.
Data Structures
The root context is unchanged. We now have a second context, alice-staples, a ProfileContext that has no instance data in it:
ERRATA: both contexts above should have relative entityids of _ContextSingleton
Step 2
Step 2: Alice fills in the form and submits it
Step 3
Step 3: Active client builds profile context data structures from what it has observed
The Form Filler calls setAttributes() and records the values Alice entered. These data are mapped into the PDM by mapping rules defined by the staples.com ontology. The result is a populated ProfileContext.
Data Structures
Here are the resulting data objects. For clarity we omitted the entire "shipping" data objects and show only the "billing" objects. We also omitted the class objects shown in the diagram above.
The top two objects live in the root context, all below live in the alice-staples Profile Context.
root context
Contents of this context:
:RootMe rdf:type persona:Persona ; persona:profileSubCorrelation alice-staples:Office-supplies-StaplesCheckoutFlow_1 , persona-one:Persona_1 . :_ContextSingleton rdf:type persona:RootContext .
alice-staples context
Contents of this context:
:Address_1 rdf:type vcard:Address ; rdfs:label "Address_1"^^xsd:string ; vcard:extended-address "Suite 1000"^^xsd:string ; vcard:locality "Peoria"^^xsd:string ; vcard:postal-code "61604"^^xsd:string ; vcard:region "IL"^^xsd:string ; vcard:street-address "123 S Main Street"^^xsd:string . :Name_1 rdf:type vcard:Name ; rdfs:label "Name_1"^^xsd:string ; vcard:family-name "Jones"^^xsd:string ; vcard:given-name "Alice"^^xsd:string . :Office-supplies-StaplesCheckoutFlow_1 rdf:type staples:Office-supplies-StaplesCheckoutFlow ; persona:subCorrelation :Persona_1 . :Persona_1 rdf:type persona:Persona ; persona:role persona:Buyer ; vcard:adr :Address_1 ; vcard:n :Name_1 ; vcard:tel :Voice_1 . :Voice_1 rdf:type vcard:Voice ; rdf:value "tel:+358-555-1234567" . :_ContextSingleton rdf:type persona:ProfileContext .
Step 4
Step 4: Active client builds persona data structures from profile context structures
Here is the result. Note the new Persona-one:Persona_1 and descendants: