You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Raymund Nickel <ra...@gmail.com> on 2014/10/22 13:38:20 UTC

Add custom properties to $metadata

Hi,

we are using the annotation processor extension. Is there a way to add
custom annotations to a property in the $metadate document?

For example:

<Property Name="Name" Type="Edm.String" sap:unit="Currency" sap:precision="
DisplayScale" />

Thx a lot,
Ray

Re: Add custom properties to $metadata

Posted by Peter Lawrence <pe...@inova8.com>.
My bad:-)

*Peter J. Lawrence*
*inova8*
*Providing answers for users' information questions*
*Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
563 2824 |*Skype:* PeterJLawrence
*Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
*LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
<http://www.linkedin.com/in/peterjohnlawrence>*

On Wed, Oct 22, 2014 at 8:45 AM, Raymund Nickel <ra...@gmail.com> wrote:

> Yes Michael, you are right. Sorry for the confusion.
>
> Ray
>
> 2014-10-22 14:40 GMT+02:00 Bolz, Michael <mi...@sap.com>:
>
> Hi Peter,
>>
>> I understood that Ray is using the “olingo-odata2-annotation-processor”
>> extension and want to add an “AnnotationAttribute” via a “Java Annotation”
>> (like “@EdmProperty”) to a POJO which then should be used by the
>> “AnnotationEdmProvider” to create the EDM (and based on that the “metadata”
>> document).
>>
>> But I’am sure that Ray can answer this question  ;o)
>>
>> Kind regards,
>> Michael
>>
>> On 22 Oct 2014, at 14:27, Peter Lawrence <pe...@inova8.com>
>> wrote:
>>
>> Perhaps I am misinterpreting the question, but I am surprised at this
>> answer because I am an extensive user of AnnotationAttributes using these
>> to map from Odata to out  underlying RDF model:
>>
>> List<AnnotationAttribute> propertyAnnotations = new
>> ArrayList<AnnotationAttribute>()
>>
>> propertyAnnotations.add(new AnnotationAttribute()
>> .setNamespace(RdfConstants.RDF_SCHEMA)
>> .setPrefix(RdfConstants.RDF)
>> .setName(RdfConstants.PROPERTY)
>> .setText(rdfProperty.propertyNode.getURI()))
>>
>>
>> which produces metadata as follows
>>
>> <Property Name="companyName" Type="Edm.String" Nullable="true"
>> rdf:Property="http://northwind.com#companyName
>> <http://northwind.com/#companyName>" xmlns:rdf="
>> http://www.w3.org/1999/02/22-rdf-syntax-ns"
>> rdfs:Datatype="http://www.w3.org/2001/XMLSchema#string" xmlns:rdfs="
>> http://www.w3.org/2000/01/rdf-schema"
>> rdfs:label="companyName" />
>>
>>
>> Regards
>>
>> Peter
>>
>>
>> *Peter J. Lawrence*
>> *inova8*
>> *Providing answers for users' information questions*
>> *Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
>> 563 2824 |*Skype:* PeterJLawrence
>> *Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
>> *LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
>> <http://www.linkedin.com/in/peterjohnlawrence>*
>>
>> On Wed, Oct 22, 2014 at 8:14 AM, Bolz, Michael <mi...@sap.com>
>> wrote:
>>
>>> Hi Ray,
>>>
>>> no there is currently no support for custom annotations for properties
>>> in the annotation processor extension.
>>> But as always contributions are welcome  ;o)
>>>
>>> Kind regards,
>>> Michael
>>>
>>> On 22 Oct 2014, at 13:38, Raymund Nickel <ra...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> we are using the annotation processor extension. Is there a way to add
>>> custom annotations to a property in the $metadate document?
>>>
>>> For example:
>>>
>>> <Property Name="Name" Type="Edm.String" sap:unit="Currency"
>>> sap:precision="DisplayScale" />
>>>
>>> Thx a lot,
>>> Ray
>>>
>>>
>>>
>>
>>
>

Re: Add custom properties to $metadata

Posted by Raymund Nickel <ra...@gmail.com>.
Yes Michael, you are right. Sorry for the confusion.

Ray

2014-10-22 14:40 GMT+02:00 Bolz, Michael <mi...@sap.com>:

> Hi Peter,
>
> I understood that Ray is using the “olingo-odata2-annotation-processor”
> extension and want to add an “AnnotationAttribute” via a “Java Annotation”
> (like “@EdmProperty”) to a POJO which then should be used by the
> “AnnotationEdmProvider” to create the EDM (and based on that the “metadata”
> document).
>
> But I’am sure that Ray can answer this question  ;o)
>
> Kind regards,
> Michael
>
> On 22 Oct 2014, at 14:27, Peter Lawrence <pe...@inova8.com>
> wrote:
>
> Perhaps I am misinterpreting the question, but I am surprised at this
> answer because I am an extensive user of AnnotationAttributes using these
> to map from Odata to out  underlying RDF model:
>
> List<AnnotationAttribute> propertyAnnotations = new
> ArrayList<AnnotationAttribute>()
>
> propertyAnnotations.add(new AnnotationAttribute()
> .setNamespace(RdfConstants.RDF_SCHEMA)
> .setPrefix(RdfConstants.RDF)
> .setName(RdfConstants.PROPERTY)
> .setText(rdfProperty.propertyNode.getURI()))
>
>
> which produces metadata as follows
>
> <Property Name="companyName" Type="Edm.String" Nullable="true"
> rdf:Property="http://northwind.com#companyName
> <http://northwind.com/#companyName>" xmlns:rdf="
> http://www.w3.org/1999/02/22-rdf-syntax-ns"
> rdfs:Datatype="http://www.w3.org/2001/XMLSchema#string" xmlns:rdfs="
> http://www.w3.org/2000/01/rdf-schema"
> rdfs:label="companyName" />
>
>
> Regards
>
> Peter
>
>
> *Peter J. Lawrence*
> *inova8*
> *Providing answers for users' information questions*
> *Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
> 563 2824 |*Skype:* PeterJLawrence
> *Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
> *LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
> <http://www.linkedin.com/in/peterjohnlawrence>*
>
> On Wed, Oct 22, 2014 at 8:14 AM, Bolz, Michael <mi...@sap.com>
> wrote:
>
>> Hi Ray,
>>
>> no there is currently no support for custom annotations for properties in
>> the annotation processor extension.
>> But as always contributions are welcome  ;o)
>>
>> Kind regards,
>> Michael
>>
>> On 22 Oct 2014, at 13:38, Raymund Nickel <ra...@gmail.com> wrote:
>>
>> Hi,
>>
>> we are using the annotation processor extension. Is there a way to add
>> custom annotations to a property in the $metadate document?
>>
>> For example:
>>
>> <Property Name="Name" Type="Edm.String" sap:unit="Currency" sap:precision
>> ="DisplayScale" />
>>
>> Thx a lot,
>> Ray
>>
>>
>>
>
>

Re: Add custom properties to $metadata

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Peter, 

I understood that Ray is using the “olingo-odata2-annotation-processor” extension and want to add an “AnnotationAttribute” via a “Java Annotation” (like “@EdmProperty”) to a POJO which then should be used by the “AnnotationEdmProvider” to create the EDM (and based on that the “metadata” document).

But I’am sure that Ray can answer this question  ;o)

Kind regards,
Michael

On 22 Oct 2014, at 14:27, Peter Lawrence <pe...@inova8.com> wrote:

> Perhaps I am misinterpreting the question, but I am surprised at this answer because I am an extensive user of AnnotationAttributes using these to map from Odata to out  underlying RDF model:
> 
> List<AnnotationAttribute> propertyAnnotations = new ArrayList<AnnotationAttribute>()
> 
> propertyAnnotations.add(new AnnotationAttribute()
> 		.setNamespace(RdfConstants.RDF_SCHEMA)
> 		.setPrefix(RdfConstants.RDF)
> 		.setName(RdfConstants.PROPERTY)
> 		.setText(rdfProperty.propertyNode.getURI()))
> 
> which produces metadata as follows
> 
> <Property Name="companyName" Type="Edm.String" Nullable="true"
> 		rdf:Property="http://northwind.com#companyName" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns"
> 		rdfs:Datatype="http://www.w3.org/2001/XMLSchema#string" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema"
> 		rdfs:label="companyName" />
> 
> Regards
> 
> Peter
> 
> 
> Peter J. Lawrence
> inova8
> Providing answers for users' information questions
> Mobile: +1 330 631 3772 | Phone: +1 330 342 0582 | UK Cell:+44 795 563 2824 |Skype: PeterJLawrence
> Email: peter.lawrence@inova8.com | Web: www.inova8.com
> LinkedIn: http://www.linkedin.com/in/peterjohnlawrence
> 
> On Wed, Oct 22, 2014 at 8:14 AM, Bolz, Michael <mi...@sap.com> wrote:
> Hi Ray,
> 
> no there is currently no support for custom annotations for properties in the annotation processor extension.
> But as always contributions are welcome  ;o)
> 
> Kind regards,
> Michael
> 
> On 22 Oct 2014, at 13:38, Raymund Nickel <ra...@gmail.com> wrote:
> 
>> Hi,
>> 
>> we are using the annotation processor extension. Is there a way to add custom annotations to a property in the $metadate document?
>> 
>> For example:
>> 
>> <Property Name="Name" Type="Edm.String" sap:unit="Currency" sap:precision="DisplayScale" />
>> 
>> Thx a lot,
>> Ray
> 
> 


Re: Add custom properties to $metadata

Posted by Peter Lawrence <pe...@inova8.com>.
Perhaps I am misinterpreting the question, but I am surprised at this
answer because I am an extensive user of AnnotationAttributes using these
to map from Odata to out  underlying RDF model:

List<AnnotationAttribute> propertyAnnotations = new
ArrayList<AnnotationAttribute>()

propertyAnnotations.add(new AnnotationAttribute()
.setNamespace(RdfConstants.RDF_SCHEMA)
.setPrefix(RdfConstants.RDF)
.setName(RdfConstants.PROPERTY)
.setText(rdfProperty.propertyNode.getURI()))


which produces metadata as follows

<Property Name="companyName" Type="Edm.String" Nullable="true"
rdf:Property="http://northwind.com#companyName" xmlns:rdf="
http://www.w3.org/1999/02/22-rdf-syntax-ns"
rdfs:Datatype="http://www.w3.org/2001/XMLSchema#string" xmlns:rdfs="
http://www.w3.org/2000/01/rdf-schema"
rdfs:label="companyName" />


Regards

Peter


*Peter J. Lawrence*
*inova8*
*Providing answers for users' information questions*
*Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
563 2824 |*Skype:* PeterJLawrence
*Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
*LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
<http://www.linkedin.com/in/peterjohnlawrence>*

On Wed, Oct 22, 2014 at 8:14 AM, Bolz, Michael <mi...@sap.com> wrote:

> Hi Ray,
>
> no there is currently no support for custom annotations for properties in
> the annotation processor extension.
> But as always contributions are welcome  ;o)
>
> Kind regards,
> Michael
>
> On 22 Oct 2014, at 13:38, Raymund Nickel <ra...@gmail.com> wrote:
>
> Hi,
>
> we are using the annotation processor extension. Is there a way to add
> custom annotations to a property in the $metadate document?
>
> For example:
>
> <Property Name="Name" Type="Edm.String" sap:unit="Currency" sap:precision
> ="DisplayScale" />
>
> Thx a lot,
> Ray
>
>
>

Re: Add custom properties to $metadata

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Ray,

no there is currently no support for custom annotations for properties in the annotation processor extension.
But as always contributions are welcome  ;o)

Kind regards,
Michael

On 22 Oct 2014, at 13:38, Raymund Nickel <ra...@gmail.com> wrote:

> Hi,
> 
> we are using the annotation processor extension. Is there a way to add custom annotations to a property in the $metadate document?
> 
> For example:
> 
> <Property Name="Name" Type="Edm.String" sap:unit="Currency" sap:precision="DisplayScale" />
> 
> Thx a lot,
> Ray