Thank a lot Richard for your help. And don't worry for your French because I 
can say that my English is not better :-) Besides, I'm surprised that I have 
succeeded in making me understand.

Thank again. Best.

Julien.

-----Message d'origine-----
De : Richard Cyganiak [mailto:[email protected]] 
Envoyé : vendredi 25 mars 2011 22:43
À : <[email protected]>
Cc : [email protected]
Objet : Re: [d2rq-dev] Problem with D2RQ

On 25 Mar 2011, at 18:26, <[email protected]> 
<[email protected]> wrote:
> map:question_ecrite a d2rq:ClassMap;
>      d2rq:dataStorage map:database;
>      d2rq:uriPattern "question_ecrite/@@question_ecrite.id@@";   # id is the 
> primary key of question_ecrite table
>      d2rq:class oan:QuestionEcrite;
>      d2rq:classDefinitionLabel "question_ecrite";
>      .
> map:reponse a d2rq:ClassMap; ### But the table "reponse" doesn't exist in the 
> database, is still correct ?

Yes it's correct! A class map creates *instances of a class*. And this class 
map states that you want one instance of the oan:Reponse class for each 
distinct value of question_ecrite.id, so it all should work out!

>      d2rq:dataStorage map:database;
>       d2rq:uriPattern "reponse/@@question_ecrite.id@@";
>       d2rq:class oan:Reponse;
>       d2rq:classDefinitionLabel "reponse";
>       .
> map: question_ecrite_date_reponse has d2rq: PropertyBridge;
>       d2rq: belongsToClassMap map: reponse;
>       d2rq: property oan: dateReponse;
>       d2rq: column "question_ecrite.date_reponse";
>       .
> map: question_ecrite_reponse has d2rq: PropertyBridge;
>       d2rq: belongsToClassMap map: reponse;
>       d2rq: property oan: texteReponse;
>       d2rq: column "question_ecrite.reponse";
>       .
> map:reponseCorrespondante a d2rq:PropertyBridge;
>      d2rq:belongsToClassMap map:QuestionEcrite;
>      d2rq:property oan:responseCorrespondante;
>      d2rq:refersToClassMap map:Response;

Watch the spelling and capitalization of the map:Xyz values here, they must 
*exactly* match the values you used further up to define the class maps.

(The misspellings are mine, but my French is a bit rusty ;-)

Hope that helps,
Richard





>      .
> 
> Better ?
> 
> Best regards,
> 
> Julien.
> 
> -----Message d'origine-----
> De : Richard Cyganiak [mailto:[email protected]] Envoyé : vendredi 
> 25 mars 2011 19:13 À : <[email protected]> Cc : 
> [email protected]
> Objet : Re: [d2rq-dev] Problem with D2RQ
> 
> On 25 Mar 2011, at 17:20, <[email protected]> 
> <[email protected]> wrote:
>> In first thank for your quick answer.
> 
> No prob!
> 
>> So I understand if I do this :
>> 
>> map:question_ecrite a d2rq:ClassMap;
>>     d2rq:dataStorage map:database;
>>     d2rq:uriPattern "question_ecrite/@@question_ecrite.id@@";   # id is the 
>> primary key of question_ecrite table
>>     d2rq:class oan:QuestionEcrite;
>>     d2rq:classDefinitionLabel "question_ecrite";
>>     .
>> map:reponse a d2rq:ClassMap;
>>     d2rq:uriPattern "question_ecrite/@@question_ecrite.id@@";
> 
> Make that
> 
>    d2rq:uriPattern "reponse/@@question_ecrite.id@@";
> 
> You want URIs for the questions and responses, because they are different 
> instances, right?
> 
> You need the d2rq:dataStorage also for the map:response class map. Just use 
> the same value as for map:reponse.
> 
> And of course add the property bridge for oan:responseCorrespondante ...
> 
> Then it could work ...
> 
> Best,
> Richard
> 
> 
> 
>>     d2rq:class oan:Reponse;
>>     d2rq:classDefinitionLabel "reponse";
>>     .
>> map: question_ecrite_date_reponse has d2rq: PropertyBridge;
>>      d2rq: belongsToClassMap map: reponse;
>>      d2rq: property oan: dateReponse;
>>      d2rq: column "question_ecrite.date_reponse";
>>      .
>> map: question_ecrite_reponse has d2rq: PropertyBridge;
>>      d2rq: belongsToClassMap map: reponse;
>>      d2rq: property oan: texteReponse;
>>      d2rq: column "question_ecrite.reponse";
>>      .
>> 
>> Was I good ?
>> 
>> Thank again to help me.
>> 
>> Julien.
>> 
>> -----Message d'origine-----
>> De : Richard Cyganiak [mailto:[email protected]] Envoyé : vendredi
>> 25 mars 2011 16:21 À : <[email protected]> Cc : 
>> [email protected]
>> Objet : Re: [d2rq-dev] Problem with D2RQ
>> 
>> Hi Julien,
>> 
>> I'm not 100% sure if I understood, but I think this should be possible.
>> 
>> You want two class maps, one for each class. Both should have a a URI 
>> pattern (or bNodeIdColumns) that are based on the primary key of the 
>> question_ecrite table.
>> 
>> You attach the date_response and texte_response property bridges to the 
>> Response class map (with belongsToClassMap).
>> 
>> You also create a property bridge for connecting the two classes, something 
>> like:
>> 
>> map:reponseCorrespondante a d2rq:PropertyBridge;
>>   d2rq:belongsToClassMap map:QuestionEcrite;
>>   d2rq:property oan:responseCorrespondante;
>>   d2rq:refersToClassMap map:Response;
>>   .
>> 
>> Hope that helps,
>> Richard
>> 
>> 
>> On 25 Mar 2011, at 13:46, <[email protected]> 
>> <[email protected]> wrote:
>> 
>>> Hello everyone,
>>> 
>>> I currently encounter a problem with the mapping language D2RQ. So here's 
>>> my problem in detail.
>>> 
>>> I have a table "question_ecrite" and two fields in this table are 
>>> "date_reponse" which is of type date and "reponse" which is of type 
>>> "string".
>>> 
>>> Now my ontology (oan) consists of two classes "QuestionEcrite" and another 
>>> "Reponse ". On the class "Reponse" I have two properties "dateReponse" and 
>>> "texteReponse".
>>> 
>>> Now how is it possible to map with D2RQ my table "question_ecrite" and 
>>> especially my fields “date_reponse "and "reponse" with the properties of 
>>> class "Reponse". Or more precisely is it possible to make a series of 
>>> properties to arrive until the field that i want.
>>> 
>>> Here's what I did:
>>> 
>>> map: question_ecrite_date_reponse has d2rq: PropertyBridge;
>>>     d2rq: belongsToClassMap map: question_ecrite;
>>>     d2rq: property oan: dateReponse;
>>>     d2rq: column "question_ecrite.date_reponse";
>>>     .
>>> map: question_ecrite_reponse has d2rq: PropertyBridge;
>>>     d2rq: belongsToClassMap map: question_ecrite;
>>>     d2rq: property oan: texteReponse;
>>>     d2rq: column "question_ecrite.reponse";
>>>     .
>>> 
>>> In summary the field date_reponse "must match the path in the ontology:
>>> 
>>> (class)questionEcrite -----> (property)reponseCorrespondante ------> 
>>> (class)Reponse ----> (property)dateReponse
>>> 
>>> And the field "response" to the path:
>>> 
>>> (class)questionEcrite -----> (property)reponseCorrespondante -----> 
>>> (class)Reponse -----> (property)texteReponse
>>> 
>>> Hoping to have been clear. And thank you in advance.
>>> 
>>> Julien.
>>> --------------------------------------------------------------------
>>> -
>>> -
>>> -------- Enable your software for Intel(R) Active Management 
>>> Technology to meet the growing manageability and security demands of 
>>> your customers. Businesses are taking advantage of Intel(R) vPro 
>>> (TM) technology - will your software be a part of the solution? 
>>> Download the Intel(R) Manageability Checker today!
>>> http://p.sf.net/sfu/intel-dev2devmar________________________________
>>> _
>>> _
>>> _____________
>>> d2rq-map-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
>> 
> 


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to