Hi Bassam,

I have recreated this issue and reported to development to look into, in the 
mean time you can correct such mapping by hand …

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.      //              http://www.openlinksw.com/ 
<http://www.openlinksw.com/>
Weblog   -- http://www.openlinksw.com/blogs/ <http://www.openlinksw.com/blogs/>
LinkedIn -- http://www.linkedin.com/company/openlink-software/ 
<http://www.linkedin.com/company/openlink-software/>
Twitter  -- http://twitter.com/OpenLink <http://twitter.com/OpenLink>
Google+  -- http://plus.google.com/100570109519069333827/ 
<http://plus.google.com/100570109519069333827/>
Facebook -- http://www.facebook.com/OpenLinkSoftware 
<http://www.facebook.com/OpenLinkSoftware>
Universal Data Access, Integration, and Management Technology Providers

> On 24 Dec 2015, at 04:49, Eng.Bassam <bassa...@gmail.com 
> <mailto:bassa...@gmail.com>> wrote:
> 
> Mr. Kingsley
> another description about my confusing :) :
> 
> the parent table here in my example is Patient which has ID primary Key
> the child table is the Diagnoses which has foreign key is Patient ID
> 
> now the R2RML must make a join condition to link child table (Diagnoses) with 
> it's parent (Patient)
> the condition is in sql ( Diagnoses,PatientID = Patient.ID)
> 
> but in generated R2RML by virtuoso is make the child -->parent and make 
> parent-->child
>> rr:joinCondition [ rr:child "ID" ; rr:parent "PatientID" ] ; ]; ] 
>> i.e I think the generated r2rml must be opposite:
>> rr:child "PatientID" --- not ID
>> rr:parent "ID" ---- not PatientID
>> because the PatientID is a column in child table(diagnoses) and ID is a 
>> column in Parent table (Patient).
>> right??? 
>> this what I have understood from http://www.w3.org/TR/r2rml/#example-fk 
>> <http://www.w3.org/TR/r2rml/#example-fk>
>> 
>> sorry again about long questions and thanks :)
> 
> 
> 
> 
> On Wed, Dec 23, 2015 at 10:33 PM, Kingsley Idehen <kide...@openlinksw.com 
> <mailto:kide...@openlinksw.com>> wrote:
> On 12/23/15 2:59 PM, Eng.Bassam wrote:
>> yes Kingsley
>> to be my question more clear :)
>> 
>> Patient (ID, name, country....) -- ID is PK
>> Diagnose (DiagnosesID, DiseaseID, PatientID,....) DiagnosesID is PK , 
>> PatientID is FK to patient table
>> 
>> the r2rml is 
>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant 
>> DB:patient_of_diagnoses ] ; rr:objectMap [ rr:parentTriplesMap 
>> <#TriplesMapDiagnoses>;  rr:joinCondition [ rr:child "ID" ; rr:parent 
>> "PatientID" ] ; ]; ] 
>> 
>> I understand the patient is parent and the diagnose is child 
>> but In r2rml I have noted the opposite make ID column in patient table is 
>> child (rr:child "ID") and make the PatientID Fk in diagnose is parent 
>> (rr:parent "PatientID")
>> I don't know if I have misunderstood of this syntax
>> wish it's clear and thanks again :)
> The product of Patient..ID and Diagnose..ParentID will produce a projection 
> of the records that constitute the parent/child relation. That's what's 
> important i.e., rr:child "ID" and rr:parent "PatientID" clearly identified 
> for use in SQL join. 
> 
> If the projection from the query join is incorrect, then we have a problem. 
> 
> Kingsley 
>> 
>> On Wed, Dec 23, 2015 at 9:49 PM, Kingsley Idehen <kide...@openlinksw.com 
>> <mailto:kide...@openlinksw.com>> wrote:
>> On 12/23/15 9:51 AM, Eng.Bassam wrote:
>>> Hi
>>> I'm wonder about child parent in rr:joinCondition in R2RML generated by 
>>> virtuoso, suppose I have tow tables patient and Diagnose
>>> 
>>> Patient (ID, name, country....) -- ID is PK
>>> Diagnose (DiagnosesID, DiseaseID, PatientID,....) DiagnosesID is PK , 
>>> PatientID is FK to patient table
>>> 
>>> I have imported the tow tables by virtuoso wizard and it generate to me 
>>> R2RML
>>> 
>>> <#TriplesMapDiagnoses> a rr:TriplesMap; rr:logicalTable [ rr:tableSchema 
>>> "emr" ; rr:tableOwner "emr-ODBC" ; rr:tableName "Diagnoses" ]; 
>>> rr:subjectMap [ rr:termType rr:IRI  ; rr:template 
>>> "http://localhost:8890/emr/diagnoses/DiagnosesID= 
>>> <http://localhost:8890/emr/diagnoses/DiagnosesID=>{DiagnosesID}"; rr:class 
>>> DB:Diagnoses; rr:graph < 
>>> <http://localhost:8890/DB#>http://localhost:8890/DB# 
>>> <http://localhost:8890/DB#>> ];
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant DB:diagnosesid ] ; 
>>> rr:objectMap [ rr:column "DiagnosesID" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant 
>>> DB:diagnoses_has_disease ] ; rr:objectMap [ rr:termType rr:IRI ; 
>>> rr:template " 
>>> <http://localhost:8890/emr/disease/DiseaseID=%7BDiseaseID%7D>http://localhost:8890/emr/disease/DiseaseID=
>>>  <http://localhost:8890/emr/disease/DiseaseID=>{DiseaseID}" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant 
>>> DB:diagnoses_has_patient ] ; rr:objectMap [ rr:termType rr:IRI ; 
>>> rr:template " 
>>> <http://localhost:8890/emr/patient/PatientID=%7BPatientID%7D>http://localhost:8890/emr/patient/PatientID=
>>>  <http://localhost:8890/emr/patient/PatientID=>{PatientID}" ]; ] .
>>> 
>>> --patient
>>> <#TriplesMapPatient> a rr:TriplesMap; rr:logicalTable [ rr:tableSchema 
>>> "emr" ; rr:tableOwner "emr-ODBC" ; rr:tableName "Patient" ]; 
>>> rr:subjectMap [ rr:termType rr:IRI  ; rr:template 
>>> "http://localhost:8890/emr/patient/ID= 
>>> <http://localhost:8890/emr/patient/ID=>{ID}"; rr:class DB:Patient; rr:graph 
>>> < <http://localhost:8890/DB#>http://localhost:8890/DB# 
>>> <http://localhost:8890/DB#>> ];
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant DB:id ] ; 
>>> rr:objectMap [ rr:column "ID" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant DB:firstname ] ; 
>>> rr:objectMap [ rr:column "FirstName" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant DB:dead ] ; 
>>> rr:objectMap [ rr:column "Dead" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant DB:dead_date ] ; 
>>> rr:objectMap [ rr:column "Dead_Date" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant 
>>> DB:patient_has_disease ] ; rr:objectMap [ rr:termType rr:IRI ; rr:template 
>>> " 
>>> <http://localhost:8890/emr/disease/Cause_Dead=%7BCause_Dead%7D>http://localhost:8890/emr/disease/Cause_Dead=
>>>  <http://localhost:8890/emr/disease/Cause_Dead=>{Cause_Dead}" ]; ] ;
>>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant 
>>> DB:patient_of_diagnoses ] ; rr:objectMap [ rr:parentTriplesMap 
>>> <#TriplesMapDiagnoses>;  rr:joinCondition [ rr:child "ID" ; rr:parent 
>>> "PatientID" ] ; ]; ] .
>>> 
>>> the file R2RML attached also by this mail
>> 
>> 
>> Given:
>> 
>> Patient (ID, name, country....) -- ID is PK
>> Diagnose (DiagnosesID, DiseaseID, PatientID,....) DiagnosesID is PK , 
>> PatientID is FK to patient table
>> 
>> Diagnose is the child while Patient is the parent i.e., one Patient Table 
>> Record uniquely identified by ID (the PK) is associated with many records in 
>> Diagnose Table with PatientID as FK. 
>> 
>> Hence:
>> 
>> rr:predicateObjectMap [ rr:predicateMap [ rr:constant 
>> DB:patient_of_diagnoses ] ; rr:objectMap [ rr:parentTriplesMap 
>> <#TriplesMapDiagnoses>;  rr:joinCondition [ rr:child "ID" ; rr:parent 
>> "PatientID" ] ; ]; ] 
>> 
>> 
>> Kingsley 
>>> 
>>> 
>>> I want understand why the output R2RML in patient make the child is patient 
>>> and parent is dianoses.?????
>>> diagnoses table it is has FK so I thinks it is a child and Patient it 's a 
>>> parent, opposite to output !!!
>>> -----------------------------------
>>> > Eng.Bassam Najeeb.
>>> >Software Engineer.
>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> 
>>> 
>>> _______________________________________________
>>> Virtuoso-users mailing list
>>> Virtuoso-users@lists.sourceforge.net 
>>> <mailto:Virtuoso-users@lists.sourceforge.net>
>>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users 
>>> <https://lists.sourceforge.net/lists/listinfo/virtuoso-users>
>> 
>> 
>> -- 
>> Regards,
>> 
>> Kingsley Idehen            
>> Founder & CEO 
>> OpenLink Software     
>> Company Web: http://www.openlinksw.com <http://www.openlinksw.com/>
>> Personal Weblog 1: http://kidehen.blogspot.com <http://kidehen.blogspot.com/>
>> Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen 
>> <http://www.openlinksw.com/blog/%7Ekidehen>
>> Twitter Profile: https://twitter.com/kidehen <https://twitter.com/kidehen>
>> Google+ Profile: https://plus.google.com/+KingsleyIdehen/about 
>> <https://plus.google.com/+KingsleyIdehen/about>
>> LinkedIn Profile: http://www.linkedin.com/in/kidehen 
>> <http://www.linkedin.com/in/kidehen>
>> Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this 
>> <http://kingsley.idehen.net/dataspace/person/kidehen#this>
>> 
>> ------------------------------------------------------------------------------
>> 
>> _______________________________________________
>> Virtuoso-users mailing list
>> Virtuoso-users@lists.sourceforge.net 
>> <mailto:Virtuoso-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users 
>> <https://lists.sourceforge.net/lists/listinfo/virtuoso-users>
>> 
>> 
>> 
>> 
>> -- 
>> -----------------------------------
>> > Eng.Bassam Najeeb.
>> >Software Engineer.
>> 
> 
> 
> -- 
> Regards,
> 
> Kingsley Idehen             
> Founder & CEO 
> OpenLink Software     
> Company Web: http://www.openlinksw.com <http://www.openlinksw.com/>
> Personal Weblog 1: http://kidehen.blogspot.com <http://kidehen.blogspot.com/>
> Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen 
> <http://www.openlinksw.com/blog/~kidehen>
> Twitter Profile: https://twitter.com/kidehen <https://twitter.com/kidehen>
> Google+ Profile: https://plus.google.com/+KingsleyIdehen/about 
> <https://plus.google.com/+KingsleyIdehen/about>
> LinkedIn Profile: http://www.linkedin.com/in/kidehen 
> <http://www.linkedin.com/in/kidehen>
> Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this 
> <http://kingsley.idehen.net/dataspace/person/kidehen#this>
> 
> 
> 
> -- 
> -----------------------------------
> > Eng.Bassam Najeeb.
> >Software Engineer.
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net 
> <mailto:Virtuoso-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users 
> <https://lists.sourceforge.net/lists/listinfo/virtuoso-users>

------------------------------------------------------------------------------
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to