Hi Richard,

In first thank for your quick answer.

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@@";
      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