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 "Mapping vocabulary"

Line 16: Line 16:
 
===roleAge (''role'') ===
 
===roleAge (''role'') ===
 
From current person lookup the literal value of v:bday attribute. Function value is age in years based on current dateTime.
 
From current person lookup the literal value of v:bday attribute. Function value is age in years based on current dateTime.
* subClassOf: spin:Templates
 
  
 
===roleDay (''role, mappedAtt'') ===
 
===roleDay (''role, mappedAtt'') ===
 
From current person return the day portion of the xsd:date value of its mappedAtt attribute.
 
From current person return the day portion of the xsd:date value of its mappedAtt attribute.
* subClassOf: spin:Templates
 
  
 
===roleDiscreteRangeId (''role, mappedAtt, discreteRange'') ===
 
===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.
 
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.
* subClassOf: spin:Templates
 
  
 
===roleDiscreteRangeString (''role, mappedAtt, discreteRange'') ===
 
===roleDiscreteRangeString (''role, mappedAtt, discreteRange'') ===
Line 30: Line 27:
  
 
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.
 
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.
* subClassOf: spin:Templates
 
  
 
===roleEntity (''role, mappedAtt'')===
 
===roleEntity (''role, mappedAtt'')===
 
From current person return (complex) value of its ''mappedAtt'' attribute.
 
From current person return (complex) value of its ''mappedAtt'' attribute.
* subClassOf: spin:Templates
 
  
 
===roleFullnane (''role'') ===
 
===roleFullnane (''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.
 
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.
* subClassOf: spin:Templates
 
  
 
===roleLiteral (''role, mappedAtt'')===
 
===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.
 
Find best p:Person entity matching against ''role'' parameter (if any). Function value is the literal value(s) of that entity's ''mappedAtt'' attribute.
* subClassOf: spin:Templates
 
  
 
===roleLiteralInitial (''role, mappedAtt'')===
 
===roleLiteralInitial (''role, mappedAtt'')===
 
From current person return the upper-cased first character of the simple, literal value of its ''mappedAtt'' attribute.
 
From current person return the upper-cased first character of the simple, literal value of its ''mappedAtt'' attribute.
* subClassOf: spin:Templates
 
 
===roleLiteralRange (''role, mappedAtt, range'')===
 
From current person return the literal value of its mappedAtt. The mappedAtt is an attibute whose values are instances of a class of pre-defined strings representing numeric, integer ranges (e.g. "13-18" or "0-9999"). The ''range'' is a class that defines the possible values as a set of pre-defined strings representing numeric, integer ranges (e.g. "13-15", "16-20"). The mapping function must return the closest value within this range. So if the persona data model (mappeAtt) had a value of "13-18" and the predicateRange had "13-15" and "16-20" then the function would return "13-15".
 
  
 
NOTE: at present we're not using this function. Lately we've found it easier to create a class for all possible values in the native vocab and then just use roleDiscreteRangeString() instead.  
 
NOTE: at present we're not using this function. Lately we've found it easier to create a class for all possible values in the native vocab and then just use roleDiscreteRangeString() instead.  
* subClassOf: spin:Templates
 
  
 
===roleLiteralStringValue (''role, mappedAtt, val'')===
 
===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.  
 
From current person return true if value literal value(s) of its mappedAtt attribute matches the value of the val parameter.  
* subClassOf: spin:Templates
 
  
 
===roleLiteralStringValue2 (''role, mappedAtt, val'')===
 
===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.  
 
From current person return true if value literal value(s) of its mappedAtt attribute matches the value of the val and the val2 parameters.  
* subClassOf: spin:Templates
 
  
 
===roleMonth (''role, mappedAtt'') ===
 
===roleMonth (''role, mappedAtt'') ===
 
From current person return the month portion of the xsd:date value of its mappedAtt attribute.
 
From current person return the month portion of the xsd:date value of its mappedAtt attribute.
* subClassOf: spin:Templates
 
* subClassOf: spin:Templates
 
  
 
===rolePathClass(''role, path, className, mapppedAtt'')===
 
===rolePathClass(''role, path, className, mapppedAtt'')===
 
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''.  
 
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''.  
* subClassOf: spin:Templates
 
  
 
===rolePathClassEntity(''role, path, className, mapppedAtt'')===
 
===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.
 
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.
* subClassOf: spin:Templates
 
  
 
===rolePathClassLiteral(''role, path, className, mapppedAtt'')===
 
===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.
 
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.
* subClassOf: spin:Templates
 
  
 
===rolePathEntity(''role, path, mapppedAtt'')===
 
===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.
 
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.
* subClassOf: spin:Templates
 
  
 
===rolePathLiteral (''role, path, mappedAtt'')===
 
===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.
 
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.
* subClassOf: spin:Templates
 
  
===rolePathLiteral2 (''role, path, mappedAtt'')===
+
===rolePathLiteralInitial ===
Like rolePathLiteral except that the mappAtt param may be an rdf:Property instead of an owl:DatatypeProperty AND the path param may be an rdf:Property instead of an owl:ObjectProperty
+
* subClassOf: spin:Templates
+
  
 
===(boolean)rolePathLiteralStringValue (''role, path, mappedAtt, val'')===
 
===(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.
 
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.
* subClassOf: spin:Templates
 
  
===(boolean)rolePathLiteralStringValue2 (''role, path, mappedAtt, val, val2'')===
+
===rolePathPartialPostal ===
From current person return true if value literal value(s) of its mappedAtt attribute matches the value of the val and the val2 parameters.
+
* subClassOf: spin:Templates
+
  
 
===(boolean)rolePathPathLiteral (''role, path, path2, mappedAtt'')===
 
===(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, ...).
 
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, ...).
* subClassOf: spin:Templates
 
  
===roleMonth (''role, mappedAtt'')===
+
===rolePathPostalExtension ===
Given a class, ''possibleValues'', that must be a subclass of map:PossibleStringValues the individual members of which possible values of a (native) attribute. Return the skos:prefLabel value of the member of ''possibleValues'' to which an attribute, ''mappedAtt'', in the persona data model's value is mapped via an owl:sameAs link.
+
* subClassOf: spin:Templates
+
 
+
===roleMultiString (''role, mappedAtt, possibleValues'')===
+
''possibleValues'', is a subclass of p:DiscreteRange, wherein each member has a map:mapTo link that points to to an individual member of a corresponding class in the persona data model. Let ''X'' be the the value of ''mappedAtt'' (in the persona data model) attribute of the current person. Search all members of ''possibleValues'' for a member, M, whose ''map:mapTo'' link points to X. Return the skos:prefLabel of M.
+
* subClassOf: spin:Templates
+
 
+
===rolePathClassLiteral(''role, path, class, mappedAtt'')===
+
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.
+
* subClassOf: spin:Templates
+
 
+
===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.
+
* subClassOf: spin:Templates
+
 
+
===rolePathLiteral2 (''role, path, mappedAtt'')===
+
Like rolePathLiteral except that the mappedAtt param may be an rdf:Property instead of an owl:DatatypeProperty AND the path param may be an rdf:Property instead of an owl:ObjectProperty
+
* subClassOf: spin:Templates
+
 
+
===rolePathLiteralInitial (''role, path, mappedAtt'')===
+
@@@TODO
+
 
+
===rolePathLiteralStringValue (''role, path, mappedAtt'')===
+
Start with current person. Find the the set, A, of (complex) values of its path attribute. Function value is true if any literal value(s) of the mappedAtt attribute of members of A match the value of the val parameter.
+
* subClassOf: spin:Templates
+
 
+
===rolePathPartialPostal (''role, path, mappedAtt'')===
+
@@@TODO
+
 
+
===rolePathPartialExtension (''role, path, mappedAtt'')===
+
@@@TODO
+
  
 
===roleSameAs (''role, equivalentAttribute'')===
 
===roleSameAs (''role, equivalentAttribute'')===
 
Indirection. The value of this function is the value of the ''equivalentAttribute'' in some other vocabulary.
 
Indirection. The value of this function is the value of the ''equivalentAttribute'' in some other vocabulary.
* subClassOf: spin:Templates
 
  
 
===roleSameAsAnd (''role, equivalentAttribute'', ''equivalentAttribute2'')===
 
===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
 
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
* subClassOf: spin:Templates
 
  
 
===roleYear (''role, mappedAtt'') ===
 
===roleYear (''role, mappedAtt'') ===
 
Return the year portion of the xsd:date value of its  mappedAtt attribute
 
Return the year portion of the xsd:date value of its  mappedAtt attribute
* subClassOf: spin:Templates
+
 
 +
 
  
 
==Proposed new Person-accessor Functions (Classes) ==
 
==Proposed new Person-accessor Functions (Classes) ==
 +
===roleDiscreteRange(''role, mappedAtt, discreteRange, extractAtt'')===
 +
'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 ''resultAtt'' 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.
 +
 
=== roleAttributePattern (''role, attributePattern'')===
 
=== roleAttributePattern (''role, attributePattern'')===
 
Argument ''attributePattern'', is a subclass of p:AttributePattern. 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 this M AND (b) the values of the attributes of M (except for rdf:type and rdfs:label) are the same values as the values of the same attributes of the current Person. If M exists, return the rdfs:label of M.
 
Argument ''attributePattern'', is a subclass of p:AttributePattern. 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 this M AND (b) the values of the attributes of M (except for rdf:type and rdfs:label) are the same values as the values of the same attributes of the current Person. If M exists, return the rdfs:label of M.

Revision as of 17:04, 29 October 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.

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 v:bday attribute. Function value is age in years based on current dateTime.

roleDay (role, mappedAtt)

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

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.

roleEntity (role, mappedAtt)

From current person return (complex) value of its mappedAtt attribute.

roleFullnane (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.

roleLiteralInitial (role, mappedAtt)

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

NOTE: at present we're not using this function. Lately we've found it easier to create a class for all possible values in the native vocab and then just use roleDiscreteRangeString() instead.

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.

rolePathClass(role, path, className, mapppedAtt)

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.

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.

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.

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.

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.

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


Proposed new Person-accessor Functions (Classes)

roleDiscreteRange(role, mappedAtt, discreteRange, extractAtt)

'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 resultAtt 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.

roleAttributePattern (role, attributePattern)

Argument attributePattern, is a subclass of p:AttributePattern. 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 this M AND (b) the values of the attributes of M (except for rdf:type and rdfs:label) are the same values as the values of the same attributes of the current Person. If M exists, return the rdfs:label of M.

Proposed new non-Person-specific Functions (Classes)

sameAs (mappedAtt)

On the current object return the value of the attribute mappedAtt.


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