Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outputs being written bottom up in the output file while trying to create a .ttl file from an .xml input #23

Open
uttam1216 opened this issue Dec 17, 2020 · 1 comment

Comments

@uttam1216
Copy link

Hi,

RMLStreamer has made my work easy, thanks.
However, the output is being generated in bottom up fashion e.g.

http://example.org/character/0 http://dbpedia.org/ontology/hairColor "blonde" .
http://example.org/character/0 http://schema.org/lastName "Ketchum" .
http://example.org/character/0 http://schema.org/givenName "Ash" .
http://example.org/character/0 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://schema.org/Person .

http://example.org/character/1 http://dbpedia.org/ontology/hairColor "orange" .
http://example.org/character/1 http://schema.org/givenName "Misty" .
http://example.org/character/1 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://schema.org/Person .

Can you please suggest how to make this look top down, i.e. Person first and then his/her given Name then lastName then hairColor?

Current command that I am using to run is:
(base) ukumar@eis-london:~$ flink-1.12.0/bin/flink run /home/ukumar/RMLStreamer/target/RMLStreamer-2.0.1-SNAPSHOT.jar toFile --mapping-file /home/ukumar/Desktop/rules-3.rml.ttl --output-path /home/ukumar/Desktop/out_characters.ttl

@ghsnd
Copy link
Contributor

ghsnd commented Mar 3, 2021

Hi @uttam1216 ,

Apologies for the late answer.

The output is a serialisation of (a part of) an RDF graph, which means that the order of the statements is undetermined. Since the RMLStreamer's goal is to generate RDF, this won't change in the near future.

However, if you need such a feature, you might add this functionality by implementing the io.rml.framework.engine.PostProcessor trait. It will collect - if need be - all statements generated by one triples map and per input record. Then you can apply any logic - such as ordering - on these statements before emitting them to the actual output.
Hope this answers your question.

Best regards,
Gerald

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants