On 12/23/15 11:49 PM, Eng.Bassam 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

We have a issue that we need fix here as the generated R2RML shouldn't
be confusing, which is the case right now.

The issue is being looked into.

Kingsley
>> rr:joinCondition [ r*r: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
>>
>> sorry again about long questions and thanks :)
>
>
>
> On Wed, Dec 23, 2015 at 10:33 PM, Kingsley Idehen
> <[email protected] <mailto:[email protected]>> 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 [ r*r: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 (r*r: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
>>     <[email protected] <mailto:[email protected]>> 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={DiagnosesID}";;
>>>         rr:class DB:Diagnoses; rr:graph <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={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={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={ID}";; rr:class
>>>         DB:Patient; rr:graph <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={Cause_Dead}";
>>>         ]; ] ;
>>>         rr:predicateObjectMap [ rr:predicateMap [ rr:constant
>>>         DB:patient_of_diagnoses ] ; rr:objectMap [
>>>         rr:parentTriplesMap <#TriplesMapDiagnoses>;
>>>          rr:joinCondition [ r*r: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
>>         [ r*r: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
>>>         [email protected]
>>>         <mailto:[email protected]>
>>>         https://lists.sourceforge.net/lists/listinfo/virtuoso-users
>>
>>
>>         -- 
>>         Regards,
>>
>>         Kingsley Idehen            
>>         Founder & CEO 
>>         OpenLink Software     
>>         Company Web: http://www.openlinksw.com
>>         Personal Weblog 1: 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
>>         Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
>>         LinkedIn Profile: http://www.linkedin.com/in/kidehen
>>         Personal WebID: 
>> http://kingsley.idehen.net/dataspace/person/kidehen#this
>>
>>
>>         
>> ------------------------------------------------------------------------------
>>
>>         _______________________________________________
>>         Virtuoso-users mailing list
>>         [email protected]
>>         <mailto:[email protected]>
>>         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
>     Personal Weblog 1: 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
>     Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
>     LinkedIn Profile: http://www.linkedin.com/in/kidehen
>     Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this
>
>
>
>
> -- 
> -----------------------------------
> > Eng.Bassam Najeeb.
> >Software Engineer.
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users


-- 
Regards,

Kingsley Idehen       
Founder & CEO 
OpenLink Software     
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
_______________________________________________
Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to