convert_to_obograph

convert_to_obograph(input_path: str | Path, *, input_flag: typing_extensions.Literal[-i, -I] | None = None, json_path: None | str | Path = None, input_is_iri: bool = False, extra_args: List[str] | None = None, from_iri: str | None = None, merge: bool = True, check: bool = True, reason: bool = True) ParseResults[source]

Convert a local OWL file to a JSON file.

Parameters:
  • input_path – Either a local file path or IRI. If a local file path is used, pass "-i" to flag. If an IRI is used, pass "-I" to flag.

  • input_flag – The flag to denote if the file is local or remote. Tries to infer from input string if none is given

  • json_path – The optional path to store the intermediate OBO Graph JSON file generated by ROBOT. If not given, the OBO Graph JSON file will be put in a temporary directory and deleted after the function finishes.

  • input_is_iri – Should the input_path varible be considered as an IRI that gets stored in the returned parse results?

  • extra_args – Extra positional arguments to pass in the command line

  • from_iri – Use this parameter to say what IRI the graph came from

  • merge – Use ROBOT’s merge command to squash all graphs together

  • check – By default, the OBO writer strictly enforces document structure rules <http://owlcollab.github.io/oboformat/doc/obo-syntax.html#4>. If an ontology violates these, the convert to OBO operation will fail. These checks can be ignored by setting this to false.

  • reason – Turn on ontology reasoning

Returns:

An object with the parsed OBO Graph JSON and text output from the ROBOT conversion program

Raises:
  • ValueError – if a graph is missing an ID

  • TypeError – if input_as_iri is marked as true but a path object is given for the input_path