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

Auto-detect RDF type from file extension in parse() #981

Closed
nicholascar opened this issue Mar 20, 2020 · 1 comment · Fixed by #1046
Closed

Auto-detect RDF type from file extension in parse() #981

nicholascar opened this issue Mar 20, 2020 · 1 comment · Fixed by #1046
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@nicholascar
Copy link
Member

nicholascar commented Mar 20, 2020

Graph().parse("some-file.ttl", format="turtle") is a common way to load RDF into an rdflib Graph. We have methods such as rdflib.util.guess_format() to guess format from the file extensions so what we need now is for guess_format() to be triggered automatically if format is not given so parse() can be used like this:

Graph().parse("some-file.ttl")
@nicholascar nicholascar changed the title Auto-detect RDF type from tile extension Auto-detect RDF type from file extension Mar 20, 2020
@nicholascar nicholascar added the enhancement New feature or request label Mar 20, 2020
@nicholascar nicholascar added this to the rdflib 6.0.0 milestone Mar 20, 2020
@nicholascar nicholascar changed the title Auto-detect RDF type from file extension Auto-detect RDF type from file extension in parse() Mar 20, 2020
@white-gecko white-gecko added the good first issue Good for newcomers label Apr 13, 2020
@Tanish-Gupta
Copy link

Hi,
Is this issue still open?

This was referenced May 27, 2020
raghav17083 added a commit to raghav17083/rdflib that referenced this issue May 27, 2020
debarghadas411 added a commit to debarghadas411/rdflib that referenced this issue May 29, 2020
modified graph.parse method to add support for extracting file format from filename.
Also added a testcase to check the modifications made
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants