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

Add the ontoportal mapping model json converter #281

Merged
Merged
Prev Previous commit
Next Next commit
add the write_ontoportal_json function
  • Loading branch information
syphax-bouazzouni committed Jul 4, 2022
commit afe648f0fb446363ff4d765e15c733649dd5cf89
10 changes: 10 additions & 0 deletions sssom/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ def write_owl(
print(t.decode(), file=file)


def write_ontoportal_json(msdf: MappingSetDataFrame, output: TextIO, serialisation="json") -> None:
if serialisation == "json":
data = to_ontoportal_json(msdf)
json.dump(data, output, indent=2)
else:
raise ValueError(
f"Unknown json format: {serialisation}, currently only json supported"
)


# Converters
# Converters convert a mappingsetdataframe to an object of the supportes types (json, pandas dataframe)

Expand Down