ontocast.tool.representation_text¶
Shared text normalization and deterministic triple rendering helpers.
normalize_identifier(text)
¶
Normalize identifier-like text with camel/snake/kebab splitting.
Source code in ontocast/tool/representation_text.py
normalize_text(text)
¶
Normalize free text for embedding and matching.
Source code in ontocast/tool/representation_text.py
normalize_uri_local_name(uri)
¶
render_term_for_text(term)
¶
Render a graph term into deterministic text.
Source code in ontocast/tool/representation_text.py
role_from_declaration(*, is_declared_property, is_predicate)
¶
Map property declaration or predicate-position usage to role vocabulary.
Predicate-position usage alone under-reports badly: a TBox-only ontology
asserts its properties as subjects (ex:hasResult a owl:ObjectProperty ;
rdfs:domain … ; rdfs:range …) and never uses them as predicates, so a
catalog of pure schema modules classifies nearly every property as a
resource. Those atoms then get a resource-shaped neighborhood
representation — empty, for a term with no outgoing domain assertions —
and the neighborhood channel goes blind to the predicates that carry the
graph structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_declared_property
|
bool
|
Entity is declared an OWL/RDF property. |
required |
is_predicate
|
bool
|
Entity occurs in predicate position in the source graph. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
|
Source code in ontocast/tool/representation_text.py
stable_sorted_triples(triples)
¶
Return a deterministic ordering of triples.