Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Org.eclipse.higgins.js.pds.client API usage example"

(getAttributes() flow)
(getAttributes() flow)
Line 36: Line 36:
 
== getAttributes() flow ==
 
== getAttributes() flow ==
  
* Derive the name of the "connection" context (result: http://azigo.com/ptrevithick/staples.com)  
+
* getConnectionContext()
* Compute rolesAtts[] (result: ((
+
** result: http://azigo.com/ptrevithick/nytimes.com)  
* We would now try to read attributes from the branch of person nodes rooted at its #me person
+
* findRoles()
* However, since this doesn't exist we try to read attributes (i.e. '''findAttributeValues'''()) from the root #me node (and on down)
+
** result: (
 +
*** (p:eCommerce, (nytimes.com#bFirstName, nil, nil))
 +
*** (p:Buyer, (nytimes.com#phone, nil, nil)))
 +
* sortByRole()
 +
** result: (
 +
*** (p:eCommerce, (nytimes.com#bFirstName, nil, nil))
 +
*** (p:Buyer, (nytimes.com#phone, nil, nil)))
 +
* Try to pull attributes from #me person in the nytimes.com
 +
** result: no result: the nytimes.com context doesn't yet exist
 +
* Try to pull attributes from #me person in root context (call findAttributeValues() --see below)
 +
** result: no attribute/values found
  
TODO: complete this
+
=== findAttributeValues() ===
 +
* findRoleMatches()
 +
** result: nil (no persons found that match role)

Revision as of 18:14, 19 September 2011

{{#eclipseproject:technology.higgins|eclipse_custom_style.css}}

Example call to .pds.client.getAttributes(domain, audience, attributes[], where[], future)

Initial State

Contexts

Pdsclient example 2.0.101.png

NYTimes template

The template context http://azigo.com/sys/templates/nytimes.com contains (among other things) the following mapping rules:

 :NYTimesPerson
     a       owl:Class ;
     rdfs:subClassOf <http://www.eclipse.org/higgins/ontologies/2010/6/higgins#Person> ;
     map:nameRule
             [ a       map:roleSameAs ;
               map:equivalentAttribute
                       fp:givenName ;
               map:predicate :bFirstName ;
               map:role <http://www.eclipse.org/higgins/ontologies/2010/6/persona#Buyer>
             ] ;
     map:telephoneRule
             [ a       map:roleSameAs ;
               map:equivalentAttribute
                       fp:phone ;
               map:predicate :phone ;
               map:role <http://www.eclipse.org/higgins/ontologies/2010/6/persona#Ecommerce>
             ] .

getAttributes() flow

  • getConnectionContext()
  • findRoles()
    • result: (
      • (p:eCommerce, (nytimes.com#bFirstName, nil, nil))
      • (p:Buyer, (nytimes.com#phone, nil, nil)))
  • sortByRole()
    • result: (
      • (p:eCommerce, (nytimes.com#bFirstName, nil, nil))
      • (p:Buyer, (nytimes.com#phone, nil, nil)))
  • Try to pull attributes from #me person in the nytimes.com
    • result: no result: the nytimes.com context doesn't yet exist
  • Try to pull attributes from #me person in root context (call findAttributeValues() --see below)
    • result: no attribute/values found

findAttributeValues()

  • findRoleMatches()
    • result: nil (no persons found that match role)

Back to the top