ontocast.integrations.schemas¶
Argument schemas for the LangChain tool wrappers.
Each model becomes a tool's args_schema, which providers turn into a JSON
Schema for tool calling. Two constraints follow from that and shape everything
here: every field must be a JSON-primitive type (no RDFGraph, no
Ontology), and every field needs a description, because the description is
the only instruction the model gets about how to fill it.
Attributes¶
Classes¶
AlignEntitiesArgs
¶
Bases: BaseModel
Find equivalent entities across graphs.
Source code in ontocast/integrations/schemas.py
ApplyGraphUpdateArgs
¶
Bases: BaseModel
Apply an insert/delete patch to a graph.
Source code in ontocast/integrations/schemas.py
Attributes¶
base_ttl = Field(default=None, description='Turtle for the graph to patch. Omit to patch the ontology currently held by the triple store.')
class-attribute
instance-attribute
¶
delete_ttl = Field(default='', description='Turtle for triples to remove. Patterns must match existing triples exactly. May be empty if you are only inserting.')
class-attribute
instance-attribute
¶
insert_ttl = Field(default='', description='Turtle for triples to add. Include all prefixes you use. May be empty if you are only deleting.')
class-attribute
instance-attribute
¶
persist = Field(default=False, description='Write the result back to the triple store. When false (the default) the patch is applied and returned but nothing is stored.')
class-attribute
instance-attribute
¶
target = Field(default='ontology', description="Which graph to patch: 'ontology' or 'facts'.")
class-attribute
instance-attribute
¶
ChunkTextArgs
¶
Bases: BaseModel
Split text into size-bounded chunks.
Source code in ontocast/integrations/schemas.py
ConvertDocumentArgs
¶
Bases: BaseModel
Convert a document file to markdown.
Source code in ontocast/integrations/schemas.py
DeleteOntologyArgs
¶
Bases: BaseModel
Remove an ontology and everything derived from it.
Source code in ontocast/integrations/schemas.py
ExtractArgs
¶
Bases: BaseModel
Run the OntoCast extraction pipeline over a piece of text.
Source code in ontocast/integrations/schemas.py
Attributes¶
domain = Field(default=None, description='Optional base IRI domain for minted instance identifiers.')
class-attribute
instance-attribute
¶
instruction = Field(default='', description="Optional extra guidance for the extractor, e.g. 'focus on experimental conditions'. Appended to the built-in prompt.")
class-attribute
instance-attribute
¶
render_mode = Field(default=None, description="What to produce: 'ontology' for schema only, 'facts' for instances against the existing ontology, or 'ontology_and_facts' for both. Omit to use the server's configured RENDER_MODE.")
class-attribute
instance-attribute
¶
text = Field(description='The source text to extract from.')
class-attribute
instance-attribute
¶
GetOntologyArgs
¶
Bases: BaseModel
Fetch one ontology by IRI.
Source code in ontocast/integrations/schemas.py
IngestOntologyArgs
¶
Bases: BaseModel
Register a new ontology from Turtle.
Source code in ontocast/integrations/schemas.py
NoArgs
¶
RetrieveOntologyContextArgs
¶
Bases: BaseModel
Retrieve a relevant ontology subgraph as Turtle.
Source code in ontocast/integrations/schemas.py
Attributes¶
max_total_triples = Field(default=None, ge=1, description='Cap on triples in the returned subgraph.')
class-attribute
instance-attribute
¶
query = Field(description='Natural-language description of the area of the ontology you need. Returns the surrounding subgraph, not just matching terms.')
class-attribute
instance-attribute
¶
subgraph_depth = Field(default=None, ge=0, le=4, description='Neighbourhood expansion depth around each seed term.')
class-attribute
instance-attribute
¶
top_k = Field(default=None, ge=1, le=100, description='Number of seed terms to expand from.')
class-attribute
instance-attribute
¶
SearchOntologyTermsArgs
¶
Bases: BaseModel
Vector search over indexed ontology terms.
Source code in ontocast/integrations/schemas.py
Attributes¶
filter_iri = Field(default=None, description='Restrict results to a single ontology IRI.')
class-attribute
instance-attribute
¶
query = Field(description="Natural-language description of the concept to find, e.g. 'measurement unit for electrical resistance'. Not a SPARQL query.")
class-attribute
instance-attribute
¶
top_k = Field(default=None, ge=1, le=100, description='Maximum number of terms to return. Defaults to the store setting.')
class-attribute
instance-attribute
¶
SparqlQueryArgs
¶
Bases: BaseModel
Run a read-only SPARQL query.
Source code in ontocast/integrations/schemas.py
Attributes¶
query = Field(description='A complete SPARQL query string. Read-only forms only: SELECT/ASK for ontocast_sparql_select, CONSTRUCT/DESCRIBE for ontocast_sparql_construct. Update forms (INSERT/DELETE/DROP/CLEAR) are rejected.')
class-attribute
instance-attribute
¶
store = Field(default='ontologies', description="Which partition to query: 'ontologies' for schema and reference individuals, 'facts' for instances extracted from documents, or 'shapes' for the deployment's SHACL shapes.")
class-attribute
instance-attribute
¶
TaggedGraphArg
¶
Bases: BaseModel
One named graph in an entity-alignment request.