write_shacl

write_shacl(converter: Converter, path: str | Path, *, include_synonyms: bool = False) None[source]

Write the converter’s bijective map as SHACL in turtle RDF to a file.

Parameters:
  • converter – The converter to export

  • path – The path to a file to write to

  • include_synonyms – If true, includes CURIE prefix synonyms. URI prefix synonyms are not output.

import curies
converter = curies.load_prefix_map({
    "CHEBI": "http://purl.obolibrary.org/obo/CHEBI_",
})
curies.write_shacl(converter, "example_shacl.ttl")
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[
  sh:declare
    [ sh:prefix "CHEBI" ; sh:namespace "http://purl.obolibrary.org/obo/CHEBI_"^^xsd:anyURI  ]
] .