Facts rendering operational guidelines (format-specific).
Build operational guidelines for the active graph format.
Source code in ontocast/prompt/facts_guidelines.py
| def format_facts_operational_guidelines(
*,
facts_namespace: str,
domain_ontologies_clause: str,
jsonld: bool,
) -> str:
"""Build operational guidelines for the active graph format."""
literal_rules = facts_literal_rules_jsonld if jsonld else facts_literal_rules_turtle
hygiene = facts_output_hygiene_jsonld if jsonld else facts_output_hygiene_turtle
guidelines = facts_instruction_shared.format(
domain_ontologies_clause=domain_ontologies_clause,
facts_namespace=facts_namespace,
literal_encoding_rules=literal_rules,
output_hygiene_rule=hygiene,
)
if jsonld:
guidelines += (
"\n12. In structured output, express facts as a JSON-LD object "
"(`@context` + `@graph`), not as a Turtle string. "
"Map the examples above to compact IRIs and JSON-LD literal objects.\n"
)
return guidelines
|