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}
> <http://localhost:8890/emr/diagnoses/DiagnosesID=%7BDiagnosesID%7D>";
> 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}
> <http://localhost:8890/emr/disease/DiseaseID=%7BDiseaseID%7D>" ]; ] ;
> 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}
> <http://localhost:8890/emr/patient/PatientID=%7BPatientID%7D>" ]; ] .
>
> --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}
> <http://localhost:8890/emr/patient/ID=%7BID%7D>"; 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}
> <http://localhost:8890/emr/disease/Cause_Dead=%7BCause_Dead%7D>" ]; ] ;
> 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
> Virtuoso-users@lists.sourceforge.net
> 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
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to