OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Updated: (ODATA-535) Define specialization for terms


     [ http://tools.oasis-open.org/issues/browse/ODATA-535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralf Handl updated ODATA-535:
-----------------------------

      Proposal: 
Remove term Core.IsSameAs

Add attribute BaseTerm to element Term to express term specialization.

When applying a term with a base term, the base term MUST also be applied with the same qualifier, and so on until a term without a base term is reached.  If the type of the specialized term is structured and directly or indirectly inherits from the type of its base term, property values that already have been specified in the annotation(s) for the base type(s) need not be specified again.

Allow terms to use qualified term names in their Type attribute in addition to qualified type names. Terms of a primitive or structured type can also be specified combined with Collection(...). This is semantically more expressive  and otherwise equivalent to specifying the type of the term. 

When applying a term that uses the name of a structured term in its Type attribute, record expressions may use the term 

Note: this proposal does not solve the second and fourth problem stated in the description. This can be solved by cooperatively annotating term applications, as sketched in the examples below with the terms custom.IsA and custom.ItemIsA.


Examples
========
<Schema Namespace="X">
  <Term Name="Person" Type="X.PersonType" />
  <Term Name="Team" Type="Collection(X.Person)" /> <!-- semantically more explicit than using the underlying type -->
  <Term Name="Movie" Type="X.MovieType" />
  <Term Name="Friend" Type="X.FriendType" /> <!-- X.FriendType is an EntityType -->
</Schema>

<Schema Namespace="Y">
  <Term Name="Developer" BaseTerm="X.Person" Type="Y.DeveloperType" />
  <ComplexType Name="DeveloperType" BaseType="X.PersonType">
    <!-- additional properties -->
  </ComplexType>

  <Annotations Target="Some.EntityType">
    <Annotation Term="X.Person">
      <Record>
        <!-- property values defined on X.PersonType go here -->
      </Record>
    </Annotation>
    <Annotation Term="Y.Developer">
      <Record>
        <!-- property values not already specified in the base term annotation go here -->
      </Record>
    </Annotation>
  </Annotations>

  <Term Name="DevelopmentTeam" Type="Collection(Y.Developer)">
    <Annotation Term="custom.IsA" String="X.Team" />
  </Term>

  <Annotations Target="Some.EntityType">
    <Annotation Term="Y.DevelopmentTeam">
      <Annotation Term="custom.IsA" String="X.Team" />
      <Annotation Term="custom.ItemIsA" String="Y.Developer X.Person" />
      <Path>SomeNavProp/@Y.Developer</Path>
    </Annotation>
  </Annotations>

  <Term Name="ScrumTeam" BaseTerm="Y.DevelopmentTeam" Type="Y.ScrumTeamType" />
  <ComplexType Name="ScrumTeamType">
    <Property Name="ScrumMaster" Type="Y.DeveloperType">
      <Annotation Term="custom.IsA" String="Y.Developer X.Person" />
    </Property>
  </ComplexType>
  <Annotations Target="Some.EntityType">
    <Annotation Term="Y.DevelopmentTeam">
      <Annotation Term="custom.IsA" String="X.Team" />
      <Path>SomeNavProp/@Y.Developer</Path>
    </Annotation>
    <Annotation Term="Y.ScrumTeam">
      <Record>
        <PropertyValue Property="ScrumMaster">
          <Annotation Term="custom.IsA" String="Y.Developer X.Person" />
          <Record>
            <!-- property values for Y.DeveloperType go here -->
          </Record>
        </PropertyValue>
      </Record>
    </Annotation>
  </Annotations>
</Schema>

  was:
Add attribute BaseTerm to element Term to express term specialization.

When applying a term with a base term, the base term MUST also be applied with the same qualifier, and so on until a term without a base term is reached.  If the type of the specialized term is structured and directly or indirectly inherits from the type of its base term, property values that already have been specified in the annotation(s) for the base type(s) need not be specified again.

Allow terms to use qualified term names in their Type attribute in addition to qualified type names. Terms of a primitive or structured type can also be specified combined with Collection(...). This is semantically more expressive  and otherwise equivalent to specifying the type of the term. 

When applying a term that uses the name of a structured term in its Type attribute, record expressions may use the term 

Note: this proposal does not solve the second and fourth problem stated in the description. This can be solved by cooperatively annotating term applications, as sketched in the examples below with the terms custom.IsA and custom.ItemIsA.


Examples
========
<Schema Namespace="X">
  <Term Name="Person" Type="X.PersonType" />
  <Term Name="Team" Type="Collection(X.Person)" /> <!-- semantically more explicit than using the underlying type -->
  <Term Name="Movie" Type="X.MovieType" />
  <Term Name="Friend" Type="X.FriendType" /> <!-- X.FriendType is an EntityType -->
</Schema>

<Schema Namespace="Y">
  <Term Name="Developer" BaseTerm="X.Person" Type="Y.DeveloperType" />
  <ComplexType Name="DeveloperType" BaseType="X.PersonType">
    <!-- additional properties -->
  </ComplexType>

  <Annotations Target="Some.EntityType">
    <Annotation Term="X.Person">
      <Record>
        <!-- property values defined on X.PersonType go here -->
      </Record>
    </Annotation>
    <Annotation Term="Y.Developer">
      <Record>
        <!-- property values not already specified in the base term annotation go here -->
      </Record>
    </Annotation>
  </Annotations>

  <Term Name="DevelopmentTeam" Type="Collection(Y.Developer)">
    <Annotation Term="custom.IsA" String="X.Team" />
  </Term>

  <Annotations Target="Some.EntityType">
    <Annotation Term="Y.DevelopmentTeam">
      <Annotation Term="custom.IsA" String="X.Team" />
      <Annotation Term="custom.ItemIsA" String="Y.Developer X.Person" />
      <Path>SomeNavProp/@Y.Developer</Path>
    </Annotation>
  </Annotations>

  <Term Name="ScrumTeam" BaseTerm="Y.DevelopmentTeam" Type="Y.ScrumTeamType" />
  <ComplexType Name="ScrumTeamType">
    <Property Name="ScrumMaster" Type="Y.DeveloperType">
      <Annotation Term="custom.IsA" String="Y.Developer X.Person" />
    </Property>
  </ComplexType>
  <Annotations Target="Some.EntityType">
    <Annotation Term="Y.DevelopmentTeam">
      <Annotation Term="custom.IsA" String="X.Team" />
      <Path>SomeNavProp/@Y.Developer</Path>
    </Annotation>
    <Annotation Term="Y.ScrumTeam">
      <Record>
        <PropertyValue Property="ScrumMaster">
          <Annotation Term="custom.IsA" String="Y.Developer X.Person" />
          <Record>
            <!-- property values for Y.DeveloperType go here -->
          </Record>
        </PropertyValue>
      </Record>
    </Annotation>
  </Annotations>
</Schema>

    Resolution: 
https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/vocabularies/Org.OData.Core.V1.xml?rev=490
https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/schemas/edm.xsd?rev=490

> Define specialization for terms
> -------------------------------
>
>                 Key: ODATA-535
>                 URL: http://tools.oasis-open.org/issues/browse/ODATA-535
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData CSDL, Vocabularies
>    Affects Versions: V4.0_CS01
>         Environment: [Proposed]
>            Reporter: Ralf Handl
>             Fix For: V4.0_CSD03
>
>
> When merging type terms and value terms we lost the possibility to define terms that are a specialization of other terms, e.g. "a developer is a person with programming skills".
> Given:
> - term Person using complex PersonType
> What we can currently do:
> - define a complex DeveloperType that inherits from PersonType
> - annotate something with term Person and use a record of type DeveloperType
> <Annotation Term="X.Person">
>   <Record Type="Y.DeveloperType">
>     <PropertyValue Property="Name" Path="Fullname" /> <!-- defined on PersonType -->
>     <PropertyValue Property="ProgrammingSkills" Path="ListOfSkills" /> <!-- defined on DeveloperType -->
>   </Record>
> </Annotation>
> So someone knowing the term Person will find this term with additional properties defined on the DeveloperType. 
> Drawback: no term "Developer"; semantic "is a developer" is expressed indirectly.
> Drawback: supports only one level. If an Architect is a special Developer, then the "is a developer" semantics is lost because the record's type is "Z.ArchitectType" and Y.DeveloperType is no longer mentioned in the annotation.
> What we'd like to do:
> - define a term Developer and indicate in the term definition that it specializes term Person
> - annotate something with term Developer in a way that someone knowing only Person and with no access to the definition of term Developer can recognize a Developer as a Person. This should also work with longer specialization chains
> Other examples:
> - a Team is a collection of Person instances
> - a DevelopmentTeam is a Team, and also a collection of Developer instances
> - a ScrumTeam is a DevelopmentTeam with a ScrumMaster, a ScrumMaster is a Developer which is a Person

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]