Closed 00ade closed 6 months ago
A logical source has an associated query or table, not both. In your case you want to use a query so just remove the table (both for T1 and T2):
rml:logicalSource [
rr:sqlQuery """
SELECT *
FROM adelina.outputevents3
WHERE hadm_id is not null
"""
];
Regarding you latter question on the prefix, I assume you are using the materialize
method of Morph-KGC, hence you obtain an RDFlib graph. You have to check the RDFlib API to see how to change the prefix. Other option is to use materialize_oxigraph
and check what you get. Also, if you are OK with N-Triples format (that has no prefixes) you may execute Morph-KGC via command line.
Thank you very much for your help! I deleted the "tablename" and it works.
Yes, I'm using materialize method of Morph-KGC. I will read the RDFlib API. Thank you!
Hi! I have a table "outputevents" with 4 columns: row_id, subject_id, hadm_id, charttime.
The hadm_id column can be null. What I want to do is the following:
If hadm_id is null: I want to map the row_id, subject_id, and charttime columns in the triple.
If hadm_id is not null: I want to map the row_id, hadm_id, and charttime columns in the triple.
This means that if hadm_id is null, I want to consider the ID for the patient. But if the admission code is not null, this code is sufficient.
I've tried to achieve this by creating two logicalSources with two sqlQuery statements.
As for the T1 triples, everything is fine: -> Output triple when hadm_id is null:
The problem is for the T2 part. Indeed, in the triples is added also the subject_id, even if it is not specified in the mappings. -> Output triple when hadm_id is not null:
Could you explain be why the predicate hasPatient and its object is added also in the second part?
Additionally, is it possible to change the prefix name automatically created in the output? This expression is added to the result: " @prefix ns1: http://mimic-translation-project.org/ ", but I would like to change ns1.
Than you for your time.