Giter Club home page Giter Club logo

rml-star's People

Contributors

anaigmo avatar andimou avatar arenas-guerrero-julian avatar dachafra avatar dylanvanassche avatar thomas-delva avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rml-star's Issues

spec Vs ontology

the Overview of RML-star terms reads more like an overview of the ontology, do we actually want this given we have a well-defined ontology where we can point to?

CSV mapping

Hi! I'm attempting to translate a CSV file containing patient information into RDF-STAR format. I'm working with RDF-star to add metadata to my records, where it is necessary. I'm using the morph-kgc and pyoxigraph libraries, both of which support RDF-star.

My goal is to generate certain triples asserted and quoted, while others solely asserted.

The problem is that the materialization of triples only occurs successfully if I use "AssertedTriplesMap" for innerTriples and "TriplesMap" for outerTriples. This generate only quoted triples. If I use "AssertedTriplesMap" for both inner and outer triples, the total number of generated triples is zero.
Furthermore, when attempting to have T1, T2, T3 asserted and quoted, and T4, T5, T6 only asserted (by removing OUT4, OUT5, OUT6), only T1, T2, T3 are generated.

Could you help me understand if it is feasible or if there are errors in my code?

  • This is the .py file:
import morph_kgc
import pyoxigraph

graph = morph_kgc.materialize_oxigraph('D:/morph_kgc_code/config.ini')
output = open('D:/mimic-iii-1.4-nq/PATIENTS.nq', 'wb')
pyoxigraph.serialize(graph, output, "application/n-quads")  
  • This is the .ini file:
[DataSouce1]
mappings : D:/morph_kgc_code/patients_mapping.ttl
  • This is the .ttl file (not working):
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rml: <http://semweb.mmlab.be/ns/rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix mimic: <http://mimic-translation-project.org/>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/#term_>. 

@base <http://mimic-translation-project.org/> .

<T1> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/Patient/{SUBJECT_ID}"
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:gender;
        rml:objectMap [
            rml:reference "GENDER"
        ];
    ].

<T2> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/Patient/{SUBJECT_ID}"
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:dob;
        rml:objectMap [
            rml:reference "DOB";
            rr:datatype xsd:dateTime
        ];
    ].

<T3> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/Patient/{SUBJECT_ID}"
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:dod;
        rml:objectMap [
            rml:reference "DOD";
            rr:datatype xsd:dateTime
        ];
    ].

<T4> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/Patient/{SUBJECT_ID}"
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:dodHosp;
        rml:objectMap [
            rml:reference "DOD_HOSP";
            rr:datatype xsd:dateTime
        ];
    ].

<T5> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/Patient/{SUBJECT_ID}"
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:dodSSN;
        rml:objectMap [
            rml:reference "DOD_SSN";
            rr:datatype xsd:dateTime
        ];
    ].

<T6> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];

    rml:subjectMap [
        rr:template "http://mimic-translation-project.org/Patient/{SUBJECT_ID}"
    ];

    rr:predicateObjectMap [
        rr:predicate mimic:expireFlag;
        rml:objectMap [
            rml:reference "EXPIRE_FLAG";
            rr:datatype xsd:boolean
        ];
    ].
    
    
<OUT1> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];
    rml:subjectMap [
        rml:quotedTriplesMap <T1>
    ];
    rr:predicateObjectMap [
        rr:predicate mimic:confidence ;
        rml:objectMap [
            rr:constant <http://purl.bioontology.org/ontology/SNOMEDCT/263495000>
        ]
    ].

<OUT2> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];
    rml:subjectMap [
        rml:quotedTriplesMap <T2>
    ];
    rr:predicateObjectMap [
        rr:predicate mimic:snomedPredicate ;
        rml:objectMap [
            rr:constant <http://purl.bioontology.org/ontology/SNOMEDCT/184099003>
        ]
    ].

        
<OUT3> a rml:AssertedTriplesMap;
    rml:logicalSource [
        rml:source "D:/mimic-iii-clinical-database-1.4/PATIENTS.csv/PATIENTS.csv";
        rml:referenceFormulation rml:CSV
    ];
    rml:subjectMap [
        rml:quotedTriplesMap <T3>
    ];
    rr:predicateObjectMap [
        rr:predicate mimic:snomedPredicate ;
        rml:objectMap [
            rr:constant <http://purl.bioontology.org/ontology/SNOMEDCT/399753006>
        ]
    ].

exhaustive description of all possible cases

@thomas-delva the spec is definitely good for a first iteration but we might need to show the details for each possible case as we did it for the logical target. in principle bring all the knowledge from the Excel to the spec.

This is not so pressing right now

definitions improvement

the definitions which are currently in the overleaf are very good and detailed, but we might need to replace them with a more coherent story. My suggestion would be to use them instead of the definition we currently have here because they are really good!

Update diagram

New diagram to be consistent with the rest of the RML specs

Fix (unused) datatypes in examples

From #10 :
Two examples use the rr:datatype xsd:float clause but the results don't reflect it; in other words, ^^xsd:float does not appear as part of the resulting triples.

Examples of the Syntax of RML-Star

Hello,

I have noticed some things in the examples that I would like to bring to your attention. First, two examples use the rr:datatype xsd:float clause but the results don't reflect it; in other words, ^^xsd:float does not appear as part of the resulting triples. This can confuse those who only use the examples as a guide. Second, there is no example where rml:quotedTriplesMap is used as an objectMap. Finally, I noticed that prefix for subjectMap and objectMap has been changed from rr to rml. My issue was that there is no indication (at least from my understanding) in the text about this change. When I saw subjectMaps and objectMaps with rml prefix in the examples, I did not know if that was a mistake.

Sincerely,
Enrique Iglesias

Link from spec to github

with the original RML spec I could not find the link from the spec to the github. It took a lot of questions for people pointing me from one to the other before I found out where to ask questions. This spec is better as it points to github.io which allows one to guess what the link is. But guesses are not as good as links. Also if someone came to this repo they would have to guess where the spec was located, making it more difficult to send feeback.
See kg-construct/rml-questions#23 (comment)

Update spec desc for extensions/addition of properties

Currently the spec describes how the extension adds or modifies some properties (rml:object, rml:subject etc). When the core is more stable and everything uses the same base IRI (rml), all those descriptions need to change

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.