Closed tian3rd closed 1 year ago
@Zheyuan-Robert-Xu Thanks for raising this issue, I'm discussing it with @Sergio
For a temporary quick fix, I have updated the rdflib
to the latest version where I just ignore lines starting with '@base` which should generate the outcome of parsing or serializing without errors.
See the change log of version 0.1.3
for detail.
The full example data I use: https://github.com/anusii/pods/blob/main/datasets/turtle-data/SOLID-Health-Ontology-Example%20-%20(data).ttl
Read this file --> store triples in graph --> serialize graph to a new ttl
file, we get the file: https://github.com/anusii/rdflib/blob/main/example/ex_full_processed.ttl
Thanks, Phillip! And is it possible to separate the whole ttl file into patient id-specific files, like p12460.ttl file?
Thanks, Phillip! And is it possible to separate the whole ttl file into patient id-specific files, like p12460.ttl file?
It's possible, for example, you can check each triple in your graph, and extract those which meet your id criteria. And then export it to a different ttl
file.
It much depends on your workflow of organizing patient data in the first place.
The value of Literal is limited to a String. The value also needs to cover float, int. Literal(this.value, {this.datatype, this.lang})
The value of Literal is limited to a String. The value also needs to cover float, int. Literal(this.value, {this.datatype, this.lang})
Hi @Zheyuan-Robert-Xu, you can check the Literal datatype first, if it's a xsd:float type, then you can convert the value back to a double type in dart.
But when the record was written in the turtle file, it adds double quotation marks to the value.
sh-onto:systolicBloodPressure "123"^^xsd:int .
Exactly, so that when you parse it into your graph, you can check the object (Literal
in this case) datatype first, which should be URIRef(XSD.int), then you're guranteed that the Literal's value "123" can be converted to an integer.
@tian3rd According to the use of the package, I raised some issues: