Skip to content

support pathlib.Path for onto.save() #48

@JeffreyAnimal

Description

@JeffreyAnimal

Add support for Path objects for saving Ontology

It would be great if pathlib.Path objects would be supported by the save() function.

Currently a Exception is thrown:

 AttributeError: 'PosixPath' object has no attribute 'write'

Current Code

save_path = pathlib.Path(~/example_path) / "save_file.nt"
onto.save(file=str(save_path), format="ntriples")

Expected Code

save_path = pathlib.Path(~/example_path) / "save_file.nt"
onto.save(file=save_path, format="ntriples")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions