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 ]

Martin Zurmuehl updated ODATA-535:
----------------------------------

    Proposal: 
Add three terms to Core that express term specialization: 

      <Term Name="CanBeCastTo" Type="Edm.String" AppliesTo="Term Annotation Property NavigationProperty PropertyValue ComplexType Record">
        <Annotation Term="Core.Description">
          <String>
            Space-separated list of qualified term names. 
            Repeat this annotation in Annotation, Collection, Record or PropertyValue elements corresponding to the annotated element.
            Annotated element can be morphed into any of the listed terms using the same rules as the cast function in URLs:
              - for structured terms: identify identically-named properties,
              - for collection-valued terms: identify identically-named properties for each record.
            Types of listed terms may or may not be in an inheritance relation.
        </String>
        </Annotation>
      </Term>
    
      <Term Name="ItemCanBeCastTo" Type="Edm.String" AppliesTo="Term Annotation Property NavigationProperty PropertyValue">
        <Annotation Term="Core.Description">
          <String>
            Space-separated list of qualified term names. 
            Repeat this annotation in Annotation or PropertyValue elements corresponding to the annotated element.
            Items of the annotated collection-valued element can be morphed into any of the listed terms using the same rules as the cast function in URLs:
              - for structured terms: identify identically-named properties,
              - for collection-valued terms: identify identically-named properties for each record.
            Types of listed terms may or may not be in an inheritance relation.
          </String>
        </Annotation>
      </Term>
      
      <Term Name="RequiresTerm" Type="Edm.String" AppliesTo="Term">
        <Annotation Term="Core.Description">
          <String>
            Space-separated list of qualified term names.  
            Annotation target MUST also be annotated with each of the listed terms, using the same qualifier.
          </String>
        </Annotation>
      </Term>


Examples
========
    <Schema Namespace="X">
      <Term Name="Person" Type="X.PersonType" />
      <Term Name="Team" Type="Collection(X.PersonType)" />
      <Term Name="Movie" Type="X.MovieType" />
      <Term Name="Friend" Type="X.FriendType" /> <!-- X.FriendType is an EntityType -->
    </Schema>
    <Schema Namespace="Y">
      <Term Name="Developer" Type="Y.DeveloperType">
        <Annotation Term="Core.CanBeCastTo" String="X.Person" />
      </Term>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.Developer">
          <Annotation Term="Core.CanBeCastTo" String="X.Person" />
          <Record>
            <!-- property values defined on X.PersonType go here -->
            <!-- property values defined in addition to X.PersonType on Y.DeveloperType go here -->
          </Record>
        </Annotation>
      </Annotations>

      <Term Name="DevelopmentTeam" Type="Collection(Y.DeveloperType)">
        <Annotation Term="Core.CanBeCastTo" String="X.Team" />
      </Term>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.DevelopmentTeam">
          <Annotation Term="Core.CanBeCastTo" String="X.Team" />
          <Path>SomeNavProp/@Y.Developer</Path>
        </Annotation>
      </Annotations>

      <Term Name="ScrumTeam" Type="Y.ScrumTeamType">
        <Annotation Term="Core.RequiresTerm" String="Y.DevelopmentTeam" />
      </Term>
      <ComplexType Name="ScrumTeamType">
        <Property Name="ScrumMaster" Type="Y.DeveloperType">
          <Annotation Term="Core.CanBeCastTo" String="X.Person" />
        </Property>
      </ComplexType>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.DevelopmentTeam">
          <Annotation Term="Core.CanBeCastTo" String="X.Team" />
          <Path>SomeNavProp/@Y.Developer</Path>
        </Annotation>
        <Annotation Term="Y.ScrumTeam">
          <Record>
            <PropertyValue Property="ScrumMaster">
              <Annotation Term="Core.CanBeCastTo" String="X.Person" />
              <Record>
                <!-- property values defined by Y.DeveloperType go here -->
              </Record>
            </PropertyValue>
          </Record>
        </Annotation>
      </Annotations>

      <Term Name="Movies" Type="Collection(X.MovieType)">
        <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
      </Term>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.Movies">
          <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
          <Path>AllMyMovies</Path>
        </Annotation>
      </Annotations>

      <Term Name="ArchivedMovies" Type="Collection(Y.ArchivedMovieType)">
        <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
      </Term>
      <ComplexType Name="ArchivedMovieType" BaseType="X.MovieType">
        <Annotation Term="Core.CanBeCastTo" String="X.Movie" />
        <Property Name="ArchivedAt" Type="Edm.Date" />
      </ComplexType>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.ArchivedMovies">
          <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
          <Path>MoviesInStorage</Path>
        </Annotation>

   <Term Name="SomeThing" Type="Y.SomeThingType" />
   <ComplexType Name="SomeThingType">
	<Property Name="SomeProperty" Type="Edm.String" />
	<Property Name="Contacts" Type="Collection(X.PersonType)">
		<Annotation Term="Core.ItemsCanBeCastTo" String="X.Person" />
	</Property>
	<NavigationProperty Name="VIPs" Type="Collection(X.Friend)">
		<Annotation Term="Core.ItemsCanBeCastTo" String="X.Friend" />
	</NavigationProperty>
   </ComplexType>
   <Annotations Target="Some.EntityType">
	<Annotation Term=" Y.Something">
		<Record>
			<PropertyValue Property="SomeProperty" String="SomeThing" />
			<PropertyValue Property="Contacts">
				<Annotation Term="Core.ItemsCanBeCastTo" String="X.Person" />
				<Path>MyContacts</Path>
			</PropertyValue>
			<PropertyValue Property="VIPs">
				<Annotation Term="Core.ItemsCanBeCastTo" String="X.Person" />
				<Path>MyBestFriends</Path>
			</PropertyValue>
		</Record>
	</Annotation>
   </Annotations>

    </Schema>

  was:
Add three terms to Core that express term specialization: 

      <Term Name="CanBeCastTo" Type="Edm.String" AppliesTo="Term Annotation Property NavigationProperty PropertyValue ComplexType Record">
        <Annotation Term="Core.Description">
          <String>
            Space-separated list of qualified term names. 
            Repeat this annotation in Annotation, Collection, Record or PropertyValue elements corresponding to the annotated element.
            Annotated element can be morphed into any of the listed terms using the same rules as the cast function in URLs:
              - for structured terms: identify identically-named properties,
              - for collection-valued terms: identify identically-named properties for each record.
            Types of listed terms may or may not be in an inheritance relation.
        </String>
        </Annotation>
      </Term>
    
      <Term Name="ItemCanBeCastTo" Type="Edm.String" AppliesTo="Term Annotation Property NavigationProperty PropertyValue">
        <Annotation Term="Core.Description">
          <String>
            Space-separated list of qualified term names. 
            Repeat this annotation in Annotation or PropertyValue elements corresponding to the annotated element.
            Items of the annotated collection-valued element can be morphed into any of the listed terms using the same rules as the cast function in URLs:
              - for structured terms: identify identically-named properties,
              - for collection-valued terms: identify identically-named properties for each record.
            Types of listed terms may or may not be in an inheritance relation.
          </String>
        </Annotation>
      </Term>
      
      <Term Name="RequiresTerm" Type="Edm.String" AppliesTo="Term">
        <Annotation Term="Core.Description">
          <String>
            Space-separated list of qualified term names.  
            Annotation target MUST also be annotated with each of the listed terms, using the same qualifier.
          </String>
        </Annotation>
      </Term>


Examples
========
    <Schema Namespace="X">
      <Term Name="Person" Type="X.PersonType" />
      <Term Name="Team" Type="Collection(X.PersonType)" />
      <Term Name="Movie" Type="X.MovieType" />
      <Term Name="Friend" Type="X.FriendType" /> <!-- X.FriendType is an EntityType -->
    </Schema>
    <Schema Namespace="Y">
      <Term Name="Developer" Type="Y.DeveloperType">
        <Annotation Term="Core.CanBeCastTo" String="X.Person" />
      </Term>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.Developer">
          <Annotation Term="Core.CanBeCastTo" String="X.Person" />
          <Record>
            <!-- property values defined on X.PersonType go here -->
            <!-- property values defined in addition to X.PersonType on Y.DeveloperType go here -->
          </Record>
        </Annotation>
      </Annotations>

      <Term Name="DevelopmentTeam" Type="Collection(Y.DeveloperType)">
        <Annotation Term="Core.CanBeCastTo" String="X.Team" />
      </Term>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.DevelopmentTeam">
          <Annotation Term="Core.CanBeCastTo" String="X.Team" />
          <Path>SomeNavProp/@Y.Developer</Path>
        </Annotation>
      </Annotations>

      <Term Name="ScrumTeam" Type="Y.ScrumTeamType">
        <Annotation Term="Core.RequiresTerm" String="Y.DevelopmentTeam" />
      </Term>
      <ComplexType Name="ScrumTeamType">
        <Property Name="ScrumMaster" Type="Y.DeveloperType">
          <Annotation Term="Core.CanBeCastTo" String="X.Person" />
        </Property>
      </ComplexType>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.DevelopmentTeam">
          <Annotation Term="Core.CanBeCastTo" String="X.Team" />
          <Path>SomeNavProp/@Y.Developer</Path>
        </Annotation>
        <Annotation Term="Y.ScrumTeam">
          <Record>
            <PropertyValue Property="ScrumMaster">
              <Annotation Term="Core.CanBeCastTo" String="X.Person" />
              <Record>
                <!-- property values defined by Y.DeveloperType go here -->
              </Record>
            </PropertyValue>
          </Record>
        </Annotation>
      </Annotations>

      <Term Name="Movies" Type="Collection(X.MovieType)">
        <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
      </Term>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.Movies">
          <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
          <Path>AllMyMovies</Path>
        </Annotation>
      </Annotations>

      <Term Name="ArchivedMovies" Type="Collection(Y.ArchivedMovieType)">
        <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
      </Term>
      <ComplexType Name="ArchivedMovieType" BaseType="X.MovieType">
        <Annotation Term="Core.CanBeCastTo" String="X.Movie" />
        <Property Name="ArchivedAt" Type="Edm.Date" />
      </ComplexType>
      <Annotations Target="Some.EntityType">
        <Annotation Term="Y.ArchivedMovies">
          <Annotation Term="Core.ItemsCanBeCastTo" String="X.Movie" />
          <Path>MoviesInStorage</Path>
        </Annotation>

   <Term Name="SomeThing" Type="Y.SomeThingType" />
   <ComplexType Name="SomeThingType">
	<Property Name="SomeProperty" Type="Edm.String" />
	<Property Name="Contacts" Type="Collection(X.PersonType)">
		<Annotation Term="Core.ItemsCanBeCastTo" String="X.Person" />
	</Property>
	<NavigationProperty Name="VIPs" Type="Collection(X.Friend)">
		<Annotation Term="Core.ItemsCanBeCastTo" String="X.Friend" />
	</NavigationProperty>
    </ComplexType>
    <Annotations Target="Some.EntityType">
	<Annotation Term=" Y.Something">
		<Record>
			<PropertyValue Property="SomeProperty" String="SomeThing" />
			<PropertyValue Property="Contacts">
				<Annotation Term="Core.ItemsCanBeCastTo" String="X.Person" />
				<Path>MyContacts</Path>
			</PropertyValue>
			<PropertyValue Property="VIPs">
				<Annotation Term="Core.ItemsCanBeCastTo" String="X.Person" />
				<Path>MyBestFriends</Path>
			</PropertyValue>
		</Record>
	</Annotation>
      </Annotations>

    </Schema>


> 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
>    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. 
> (If we don't accept ODATA-513 that someone may only find the additional properties and none of the PersonType properties, here: only the ProgrammingSkills and no Name).
> 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]