Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Mapping vocabulary"

(Proposed new non-Person-specific Functions (Classes))
(ObjectSameAs (att))
Line 188: Line 188:
  
 
==Proposed new non-Person-specific Functions (Classes) ==
 
==Proposed new non-Person-specific Functions (Classes) ==
=== ObjectSameAs (''att'')===
+
=== ObjectSameAs (''equivalentAttribute'')===
On the current object return the value of the attribute ''att''.
+
Indirection. The value of this function is the value of the ''equivalentAttribute'' in some other vocabulary when evaluated on the current object.  
  
 
Example:
 
Example:
*
+
* TODO
  
 
== Mapping Attributes ==
 
== Mapping Attributes ==

Revision as of 11:11, 3 November 2011

{{#eclipseproject:technology.higgins|eclipse_custom_style.css}}
Higgins logo 76Wx100H.jpg

Vocabulary for describing attribute schema mapping rules. Part of the Persona Data Model 2.0. Used by Flat Persona vocabulary and others.

Contents

Files


Existing Person-accessor Functions (Classes)

This section lists a set of subclasses of spin:Templates. Note that these class names (unlike all others in Higgins) do not start with an initial capital letter. To learn more about the SPIN vocabulary and spin:Templates see http://spinrdf.org .

The so-called body of a spin:Template is supposed to contain an RDF representation of a set of SPARQL statements that, when interpreted, compute the value of the function (and potentially have other side effects). In the mapping vocabulary these bodies are empty since we don't presume the existence of a SPARQL interpreter. Thus implementations of these functions must be pre-compiled in some local language (Javascript, Java, etc.)

roleAge (role)

From current person lookup the literal value of vcard:bday attribute. Function value is age in years based on current dateTime.

Example:

  • fp:age = roleAge()

roleAttributePattern (role, attributePattern, valueAtt)

Find a suitable current Person using role if argument if provided. Search members of attributePattern for a member, M, such that (a) the current Person has all of the attributes of the patternAttributes of this M and (b) the values of the patternAttributes of M (except for rdf:type and rdfs:label) are the same values as the values of the same attributes of the current Person and (c) the current Person does not have any attributes listed in the hasNotAttributes of M. If such an M exists, return the value of valueAtt of M.

Example:

  • my_profile-prefer_deals_for_gender = roleAttributePattern (, Groupon-PreferDealsForGender, rdfs:label)

With these three instances of Groupon-PreferDealsForGender:

 :Men-exclusively
     a       :Groupon-PreferDealsForGender ;
     rdfs:label "men"^^xsd:string ;
     map:hasAttributes
             [ a       owl:Thing ;
               fp:stuffForMen "true"^^xsd:boolean
             ] ;
     map:hasNotAttribute fp:stuffForWomen .
 :Men-exclusively
     a       :Groupon-PreferDealsForGender ;
     rdfs:label "men"^^xsd:string ;
     map:hasAttributes
             [ a       owl:Thing ;
               fp:stuffForMen "true"^^xsd:boolean
             ] ;
     map:hasNotAttribute fp:stuffForWomen .
 :Deals_for_women_and_men
     a       :Groupon-PreferDealsForGender ;
     rdfs:label "both women and men"^^xsd:string ;
     map:hasAttributes
             [ a       owl:Thing ;
               fp:stuffForMen "true"^^xsd:boolean ;
               fp:stuffForWomen "true"^^xsd:boolean
             ] .

roleDay (role, mappedAtt)

From current person return the day portion of the xsd:date value of its mappedAtt attribute.

Example:

  • fp:dayOfBirth = roleDay (, vcard:bday)

roleDiscreteRange(role, mappedAtt, discreteRange, valueAtt)

'Argument 'discreteRange, is a subclass of p:DiscreteRange, wherein each member has been mapped (using one of several links of mapping links (e.g. sameAs)) to member(s) in a roughly equivalent subclass of p:DiscreteRange defined in the persona data model. mappedAtt is an attribute of the current person (of matching role) in the persona data model. Search all members of discreteRange for a member, M, whose mapping link points to the value of mappedAtt. Return the value of the valueAtt of M.

When the function is used in reverse (i.e. to set the value of mappedAtt), and when there is a one-to-many mapping link relationship between a member of DiscreteRange in the external vocabulary and N members of the corresponding DiscreteRange in the persona data model, the value pointed to the *Default mapping link (e.g. map:sameAsNDefault) should be used.

Example:

  • email_prefs-city_ids = roleDiscreteRange (p:Home, p:location, Groupon-City, rdfs:label)

NOTE: once the above is implemented we should eliminate roleDiscreteRangeId and roleDiscreteRangeString (since they are are equivalent to roleDiscreteRange (..., p:id) and roleDiscreteRange (..., rdfs:label) respectively).

roleDiscreteRangeId (role, mappedAtt, discreteRange)

Same as roleDiscreteRangeString() except that instead of returning the value of the rdfs:label attribute of the selected member of p:DiscreteRange it returns the value of p:id.

roleDiscreteRangeString (role, mappedAtt, discreteRange)

discreteRange, is a subclass of p:DiscreteRange, wherein each member has been mapped (using one of several links of mapping links (e.g. sameAs)) to member(s) in a roughly equivalent subclass of p:DiscreteRange defined in the persona data model. mappedAtt is an attribute of the current person in the persona data model. Search all members of discreteRange for a member, M, whose mapping link points to the value of mappedAtt. Return the rdfs:label of M.

When the function is used in reverse (i.e. to set the value of mappedAtt), and when there is a one-to-many mapping link relationship between a member of DiscreteRange in the external vocabulary and N members of the corresponding DiscreteRange in the persona data model, the value pointed to the *Default mapping link (e.g. map:sameAsNDefault) should be used.

Example:

  • fp:ageRange = roleDiscreteRangeString (, p:ageRange, p:AgeRanges)

roleEntity (role, mappedAtt)

From current person return the value(s) of its entity-valued mappedAtt attribute.

Example:

roleFullname (role)

Function value is string concatenation of the (string) values of the following attributes of the v:Name instance that is the value of the v:n attribute of the current person. The attributes to concatentate are: v:honorific-prefix, v:given-name, v:additional-name(s), v:family-name, v:honorific-suffix.

roleLiteral (role, mappedAtt)

Find best p:Person entity matching against role parameter (if any). Function value is the literal value(s) of that entity's mappedAtt attribute.

Example:

  • fp:dateOfBirth = roleLiteral (, vcard:bday)

roleLiteralInitial (role, mappedAtt)

From current person return the upper-cased first character of the simple, literal value of its mappedAtt attribute.

roleLiteralStringValue (role, mappedAtt, val)

From current person return true if value literal value(s) of its mappedAtt attribute matches the value of the val parameter.

roleLiteralStringValue2 (role, mappedAtt, val)

From current person return true if value literal value(s) of its mappedAtt attribute matches the value of the val and the val2 parameters.

roleMonth (role, mappedAtt)

From current person return the month portion of the xsd:date value of its mappedAtt attribute.

Example:

  • fp:monthOfBirth = roleMonth (, vcard:bday)

rolePathClass(role, path, className)

Start with current person. Function value is true if any of the values of its path attribute is the class (not an instance of) className.

rolePathClassEntity(role, path, className, mapppedAtt)

Start with current person. Find the the set, A, of (complex) values of its path attribute whose members are of class className. Function value is the set of all values of mappedAtt attribute of all members of A.

Example:

  • fp:mobilePhone = rolePathClassEntity (, vcard:tel, vcard:Cell, rdf:value)

rolePathClassLiteral(role, path, className, mapppedAtt)

Start with current person. Find the the set, A, of (complex) values of its path attribute where the values are instances of class className. Function value is literal value(s) of the mappedAtt attribute of all members of A.

Example:

  • fp:creditCardExpiration = rolePathClassLiteral (, pay:paymentMethod, pay:CreditCard, pay:ccExpiration)

rolePathEntity(role, path, mapppedAtt)

Start with current person. Find the the set, A, of (complex) values of its path attribute. Function value is the set of all values of mappedAtt attribute of all members of A.

Example:

  • fp:phone = rolePathEntity (, vcard:tel, rdf:value)

rolePathLiteral (role, path, mappedAtt)

Start with current person. Find the the set, A, of (complex) values of its path attribute. Function value is literal value(s) of the mappedAtt attribute of all members of A.

Example:

  • fp:careOf = rolePathLiteral (, vcard:adr, p:careOf)

rolePathLiteralInitial

(boolean)rolePathLiteralStringValue (role, path, mappedAtt, val)

Find best p:Person entity matching against role parameter (if any). Find the the set, A, of (complex) values of the path attribute. Function value is true if any literal value(s) of the mappedAtt attribute of members of A match the value of the string val parameter.

rolePathPartialPostal

(boolean)rolePathPathLiteral (role, path, path2, mappedAtt)

Start with current person. Find the the set, A, of (complex) values of its path attribute. For each member of A find the set, B, of (complex) values of its path2 attribute. Function value is literal value(s) of the mappedAtt attribute of all members of all sets B (B1, B2, ...).

rolePathPostalExtension

roleSameAs (role, equivalentAttribute)

Indirection. The value of this function is the value of the equivalentAttribute in some other vocabulary.

Example:

  • avatar = roleSameAs (p:Home, fp:avatar)

roleSameAsAnd (role, equivalentAttribute, equivalentAttribute2)

Indirection. The value of this function is non-null iff the evaluation of both predicate and predicate2 attributes parameter (both of which are in vocabularies other than this one) are both non-null

roleYear (role, mappedAtt)

Return the year portion of the xsd:date value of its mappedAtt attribute.

Example:

  • fp:yearOfBirth = roleYear(, vcard:bday)

Proposed new Person-accessor Functions (Classes)

NEW: PersonGetAttributeWhereValuesAreOfClass (path, className, [role])

Start with current person that meets the criteria influenced by the optional role argument. Return the the set, A, of (entity) values of its path attribute whose members are of class className.

Examples:

  • fp:placeInterest = PersonGetAttributeWhereValuesAreOfClass(p:like, p:Place, role)
  • fp:regularInterest = PersonGetAttributeWhereValuesAreOfClass(p:like, int:InterestTopic, role)

RENAMED: PersonGetAttributeWhereValuesHaveAttributeOfValue (path, valueAtt, val, [role])

Start with current person that meets the criteria influenced by the optional role argument. Return the set of values of its entity-valued path attribute where each entity value has an attribute valueAtt whose value set includes val.

Example:

  • fp:buyer = PersonGetAttributeWhereValuesHaveAttributeOfValue (higgins:correlation, p:role, p:Buyer)

RENAMED: PersonGetSingleLineAddress ([role])

Start with current person that meets the criteria influenced by the optional role argument. Return the value of its v:adr attribute, an instance of vcard:Address, as transformed into to a single string.

Example:

  • fp:singleLineAddress = PersonGetSingleLineAddress ()

Proposed new non-Person-specific Functions (Classes)

ObjectSameAs (equivalentAttribute)

Indirection. The value of this function is the value of the equivalentAttribute in some other vocabulary when evaluated on the current object.

Example:

  • TODO

Mapping Attributes

The following mapping (annotation) attributes are defined:

  • sameAs - Used to link this instance or subclass of p:DiscreteRange defined in an external vocabulary with an instance or subclass of p:DiscreteRange defined in the persona data model. Functional, InverseFunctional.
  • sameAsN - Used (along with map:sameAsNDefault) to link this instance or subclass of p:DiscreteRange with N other instances or subclasses of p:DiscreteRange that are not pointed to by map:sameAs.
  • sameAsNDefault - Used (along with map:sameAsN) to link this instance or subclass of p:DiscreteRange with N other instances or subclasses of p:DiscreteRange. InverseFunctional.

Here is an example of instance-to-instance mapping using sameAs, sameAsN and sameAsNDefault:

Mapping example 2.0.100.png

Links

Back to the top