-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support more than one output format through argument chaining #54
Comments
Sounds good! It shouldn't be necessary to rerun the tool just to get the provenance data serialized in all of the desired formats. I'll add this to the feature list for releases after I'm not that familiar with click yet. Do you mean command chaining or multi value options / multiple options? And how would you redirect the output to three different files? |
@sdruskat I don't know if I understand your example correctly. I'll try to walk myself through it, correct me if i got it wrong. You want to be able to explicitly state multiple serialization formats and get If the problem boils down to converting the serialization format of an already existing provenance document into another serialization format (e.g. rdf to provn or json to xml, etc.) then you could use gitlab2prov -t {token} -f rdf > provout/doc.rdf
provconvert -infile provout/doc.rdf -outfile provout/doc.provn |
Multiple options is what I meant, see the example in the first comment. As for the redirection question, I haven't looked at the source code yet to understand how you write files. It was my assumption that you build an internal model, then dump that into files...
I guess this would include adding serialization functionality in gitlab2prov directly, including perhaps an argument (or fixed value) to take a pattern for naming files. E.g. def write(outformat):
with open(filename + '.' + outformat, 'w') as outfile:
outfile.write(data)
for outformat in formats:
write(outformat) I'd need to look at the code to suggest something more concrete. The idea is that the retrieval step is done only once, instead of having to do it |
I implemented gitlab2prov -p {url} -t {token} multi-format -f json xml rdf -o provout/example A config file for [GITLAB]
project_urls = project_a_url, project_b_url
token = token
[OUTPUT]
format = json, rdf, xml
outfile = provout/example
[MISC]
profile = False
verbose = False
double_agents = path/to/alias/mapping
pseudonymous = False The config option |
Nice one! That should fix this issue. Looking forward for this to be merged. |
I guess the docs in the README should still be updated in the branch to reflect changes? |
Yes, I'll update the README before merging. |
It'd be great if you were able to write > 1 format at the same time, e.g.
gitlab2prov -t {token} -f json -f rdf -f xml -p {url} -r 1 > provout/{outfilename}.{format}
. This would help when building a larger dataset with provenance data. This would be fairly easy to achieve using click or typer as well.The text was updated successfully, but these errors were encountered: