kg-construct / rml-star Goto Github PK
View Code? Open in Web Editor NEWRML-star: RDF-star generation for RML
Home Page: https://w3id.org/rml/star/spec
License: Creative Commons Attribution 4.0 International
RML-star: RDF-star generation for RML
Home Page: https://w3id.org/rml/star/spec
License: Creative Commons Attribution 4.0 International
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?
From #10 :
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.
Testcases are here: https://github.com/kg-construct/rml-star-test-cases
Useful for validating the SHACL shapes and make sure we cover everything
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?
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")
[DataSouce1]
mappings : D:/morph_kgc_code/patients_mapping.ttl
@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>
]
].
including the updated version of the spec
@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
Here are minor issues to update in the dev.html, that I saw while updating the rml-cc spec:
issueBase: https://github.com/kg-construct/rml-star-spec/issues
: remove the "-spec"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!
New diagram to be consistent with the rest of the RML specs
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.
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
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)
@thomas-delva the spec so far looks good! But it might be good to have at least one more section explaining the case of nested embedded triples
From #10 :
here is no example where rml:quotedTriplesMap
is used as an objectMap
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
And same for rml:objectMap
I was a bit careless when writing the examples ๐ Will go through them and fix this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.