Tony20100/langchain_full huggingface dataset:
on_chain_start(serialized, inputs, *, run_id)
Start a trace for a chain run.
on_chat_model_start(serialized, messages, *, ...)
Start a trace for an LLM run.
on_llm_end(response, *, run_id, **kwargs)
End a trace for an LLM run.
on_llm_error(error, *, run_id, **kwargs)
Handle an error for an LLM run.
on_llm_new_token(token, *[, chunk, ...])
Run on new LLM token.
on_llm_start(serialized, prompts, *, run_id)
Start a trace for an LLM run.
on_retriever_end(documents, *, run_id, **kwargs)
Run when Retriever ends running.
on_retriever_error(error, *, run_id, **kwargs)
Run when Retriever errors.
on_retriever_start(serialized, query, *, run_id)
Run when Retriever starts running.
on_retry(retry_state, *, run_id, **kwargs)
Run on a retry event.
on_text(text, *, run_id[, parent_run_id])
Run on arbitrary text.
on_tool_end(output, *, run_id, **kwargs)
End a trace for a tool run.
on_tool_error(error, *, run_id, **kwargs)
Handle an error for a tool run.
on_tool_start(serialized, input_str, *, run_id)
Start a trace for a tool run.
__init__(**kwargs: Any) → None[source]¶
Initialize the tracer.
Parameters
_schema_format – Primarily changes how the inputs and outputs are
Initialize the tracer.
Parameters
_schema_format – Primarily changes how the inputs and outputs are
handled. For internal use only. This API will change.
- ‘original’ is the format used by all current tracers.
This format is slightly inconsistent with respect to inputs
and outputs.
’streaming_events’ is used for supporting streaming events,for internal usage. It will likely change in the future, or
be deprecated entirely in favor of a dedicated async tracer
for streaming events.
’original+chat’ is a format that is the same as ‘original’except it does NOT raise an attribute error on_chat_model_start
kwargs (Any) – Additional keyword arguments that will be passed to
the super class.
Return type
None
get_breadcrumbs(run: Run) → str¶
Parameters
run (Run) – 
Return type
str
get_parents(run: Run) → List[Run]¶
Parameters
run (Run) – 
Return type
List[Run]
on_agent_action(action: AgentAction, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent action.
Parameters
action (AgentAction) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_agent_finish(finish: AgentFinish, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent end.
Parameters
finish (AgentFinish) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
kwargs (Any) – 
Return type
Any
on_chain_end(outputs: Dict[str, Any], *, run_id: UUID, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → Run¶
End a trace for a chain run.
Parameters
outputs (Dict[str, Any]) – 
run_id (UUID) – 
inputs (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Run
on_chain_error(error: BaseException, *, inputs: Optional[Dict[str, Any]] = None, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for a chain run.
Parameters
error (BaseException) – 
inputs (Optional[Dict[str, Any]]) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, run_type: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) → Run¶
Start a trace for a chain run.
Parameters
serialized (Dict[str, Any]) – 
inputs (Dict[str, Any]) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
run_type (Optional[str]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
langchain_core.tracers.langchain.LangChainTracer¶
class langchain_core.tracers.langchain.LangChainTracer(example_id: Optional[Union[str, UUID]] = None, project_name: Optional[str] = None, client: Optional[Client] = None, tags: Optional[List[str]] = None, **kwargs: Any)[source]¶
Implementation of the SharedTracer that POSTS to the LangChain endpoint.
Initialize the LangChain tracer.
Attributes
ignore_agent
Whether to ignore agent callbacks.
ignore_chain
Whether to ignore chain callbacks.
ignore_chat_model
Whether to ignore chat model callbacks.
ignore_llm
Whether to ignore LLM callbacks.
ignore_retriever
Whether to ignore retriever callbacks.
ignore_retry
Whether to ignore retry callbacks.
raise_error
run_inline
Methods
__init__([example_id, project_name, client, ...])
Initialize the LangChain tracer.
get_run_url()
Get the LangSmith root run URL
on_agent_action(action, *, run_id[, ...])
Run on agent action.
on_agent_finish(finish, *, run_id[, ...])
Run on agent end.
on_chain_end(outputs, *, run_id[, inputs])
End a trace for a chain run.
on_chain_error(error, *[, inputs])
Handle an error for a chain run.
on_chain_start(serialized, inputs, *, run_id)
Start a trace for a chain run.
on_chat_model_start(serialized, messages, *, ...)
Start a trace for an LLM run.
on_llm_end(response, *, run_id, **kwargs)
End a trace for an LLM run.
on_llm_error(error, *, run_id, **kwargs)
on_llm_error(error, *, run_id, **kwargs)
Handle an error for an LLM run.
on_llm_new_token(token, *[, chunk, ...])
Run on new LLM token.
on_llm_start(serialized, prompts, *, run_id)
Start a trace for an LLM run.
on_retriever_end(documents, *, run_id, **kwargs)
Run when Retriever ends running.
on_retriever_error(error, *, run_id, **kwargs)
Run when Retriever errors.
on_retriever_start(serialized, query, *, run_id)
Run when Retriever starts running.
on_retry(retry_state, *, run_id, **kwargs)
Run on a retry event.
on_text(text, *, run_id[, parent_run_id])
Run on arbitrary text.
on_tool_end(output, *, run_id, **kwargs)
End a trace for a tool run.
on_tool_error(error, *, run_id, **kwargs)
Handle an error for a tool run.
on_tool_start(serialized, input_str, *, run_id)
Start a trace for a tool run.
wait_for_futures()
Wait for the given futures to complete.
Parameters
example_id (Optional[Union[UUID, str]]) – 
project_name (Optional[str]) – 
client (Optional[Client]) – 
tags (Optional[List[str]]) – 
kwargs (Any) –
tags (Optional[List[str]]) – 
kwargs (Any) – 
__init__(example_id: Optional[Union[str, UUID]] = None, project_name: Optional[str] = None, client: Optional[Client] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None[source]¶
Initialize the LangChain tracer.
Parameters
example_id (Optional[Union[str, UUID]]) – 
project_name (Optional[str]) – 
client (Optional[Client]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
get_run_url() → str[source]¶
Get the LangSmith root run URL
Return type
str
on_agent_action(action: AgentAction, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent action.
Parameters
action (AgentAction) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_agent_finish(finish: AgentFinish, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent end.
Parameters
finish (AgentFinish) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_chain_end(outputs: Dict[str, Any], *, run_id: UUID, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → Run¶
End a trace for a chain run.
Parameters
outputs (Dict[str, Any]) – 
run_id (UUID) – 
inputs (Optional[Dict[str, Any]]) –
run_id (UUID) – 
inputs (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Run
on_chain_error(error: BaseException, *, inputs: Optional[Dict[str, Any]] = None, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for a chain run.
Parameters
error (BaseException) – 
inputs (Optional[Dict[str, Any]]) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, run_type: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) → Run¶
Start a trace for a chain run.
Parameters
serialized (Dict[str, Any]) – 
inputs (Dict[str, Any]) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
run_type (Optional[str]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, name: Optional[str] = None, **kwargs: Any) → Run[source]¶
Start a trace for an LLM run.
Parameters
serialized (Dict[str, Any]) –
Parameters
serialized (Dict[str, Any]) – 
messages (List[List[BaseMessage]]) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
on_llm_end(response: LLMResult, *, run_id: UUID, **kwargs: Any) → Run¶
End a trace for an LLM run.
Parameters
response (LLMResult) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_llm_error(error: BaseException, *, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for an LLM run.
Parameters
error (BaseException) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_llm_new_token(token: str, *, chunk: Optional[Union[GenerationChunk, ChatGenerationChunk]] = None, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Run¶
Run on new LLM token. Only available when streaming is enabled.
Parameters
token (str) – 
chunk (Optional[Union[GenerationChunk, ChatGenerationChunk]]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Run
kwargs (Any) – 
Return type
Run
on_llm_start(serialized: Dict[str, Any], prompts: List[str], *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, name: Optional[str] = None, **kwargs: Any) → Run¶
Start a trace for an LLM run.
Parameters
serialized (Dict[str, Any]) – 
prompts (List[str]) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
on_retriever_end(documents: Sequence[Document], *, run_id: UUID, **kwargs: Any) → Run¶
Run when Retriever ends running.
Parameters
documents (Sequence[Document]) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_retriever_error(error: BaseException, *, run_id: UUID, **kwargs: Any) → Run¶
Run when Retriever errors.
Parameters
error (BaseException) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_retriever_start(serialized: Dict[str, Any], query: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, name: Optional[str] = None, **kwargs: Any) → Run¶
Run when Retriever starts running.
Parameters
serialized (Dict[str, Any]) –
Parameters
serialized (Dict[str, Any]) – 
query (str) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
metadata (Optional[Dict[str, Any]]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
on_retry(retry_state: RetryCallState, *, run_id: UUID, **kwargs: Any) → Run¶
Run on a retry event.
Parameters
retry_state (RetryCallState) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_text(text: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on arbitrary text.
Parameters
text (str) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_tool_end(output: Any, *, run_id: UUID, **kwargs: Any) → Run¶
End a trace for a tool run.
Parameters
output (Any) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_tool_error(error: BaseException, *, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for a tool run.
Parameters
error (BaseException) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_tool_start(serialized: Dict[str, Any], input_str: str, *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, name: Optional[str] = None, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → Run¶
Start a trace for a tool run.
Parameters
serialized (Dict[str, Any]) – 
input_str (str) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
name (Optional[str]) – 
inputs (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Run
wait_for_futures() → None[source]¶
Wait for the given futures to complete.
Return type
None
langchain_aws.graphs.neptune_graph.NeptuneGraph¶
class langchain_aws.graphs.neptune_graph.NeptuneGraph(host: str, port: int = 8182, use_https: bool = True, client: Optional[Any] = None, credentials_profile_name: Optional[str] = None, region_name: Optional[str] = None, sign: bool = True)[source]¶
Neptune wrapper for graph operations.
Parameters
host (str) – endpoint for the database instance
port (int) – port number for the database instance, default is 8182
use_https (bool) – whether to use secure connection, default is True
client (Any) – optional boto3 Neptune client
credentials_profile_name (Optional[str]) – optional AWS profile name
region_name (Optional[str]) – optional AWS region, e.g., us-west-2
service – optional service name, default is neptunedata
sign (bool) – optional, whether to sign the request payload, default is True
Example
graph = NeptuneGraph(host=’<my-cluster>’,
port=8182
)
Security note: Make sure that the database connection uses credentialsthat are narrowly-scoped to only include necessary permissions.
Failure to do so may result in data corruption or loss, since the calling
code may attempt commands that would result in deletion, mutation
of data if appropriately prompted or reading sensitive data if such
data is present in the database.
The best way to guard against such negative outcomes is to (as appropriate)
limit the permissions granted to the credentials used with this tool.
See https://python.langchain.com/docs/security for more information.
Create a new Neptune graph wrapper instance.
Attributes
get_schema
Returns the schema of the Neptune database
Methods
__init__(host[, port, use_https, client, ...])
__init__(host[, port, use_https, client, ...])
Create a new Neptune graph wrapper instance.
query(query[, params])
Query Neptune database.
__init__(host: str, port: int = 8182, use_https: bool = True, client: Optional[Any] = None, credentials_profile_name: Optional[str] = None, region_name: Optional[str] = None, sign: bool = True) → None[source]¶
Create a new Neptune graph wrapper instance.
Parameters
host (str) – 
port (int) – 
use_https (bool) – 
client (Optional[Any]) – 
credentials_profile_name (Optional[str]) – 
region_name (Optional[str]) – 
sign (bool) – 
Return type
None
query(query: str, params: dict = {}) → Dict[str, Any][source]¶
Query Neptune database.
Parameters
query (str) – 
params (dict) – 
Return type
Dict[str, Any]
Examples using NeptuneGraph¶
AWS
Amazon Neptune with Cypher
langchain_community.graphs.neptune_graph.BaseNeptuneGraph¶
class langchain_community.graphs.neptune_graph.BaseNeptuneGraph[source]¶
Abstract base class for Neptune
Attributes
get_schema
Return the schema of the Neptune database
Methods
__init__()
query(query[, params])
__init__()¶
abstract query(query: str, params: dict = {}) → dict[source]¶
Parameters
query (str) – 
params (dict) – 
Return type
dict
langchain_community.graphs.neptune_rdf_graph.NeptuneRdfGraph¶
class langchain_community.graphs.neptune_rdf_graph.NeptuneRdfGraph(host: str, port: int = 8182, use_https: bool = True, use_iam_auth: bool = False, client: Optional[Any] = None, credentials_profile_name: Optional[str] = None, region_name: Optional[str] = None, service: str = 'neptunedata', sign: bool = True)[source]¶
Neptune wrapper for RDF graph operations.
Parameters
host (str) – endpoint for the database instance
port (int) – port number for the database instance, default is 8182
use_iam_auth (bool) – boolean indicating IAM auth is enabled in Neptune cluster
use_https (bool) – whether to use secure connection, default is True
client (Any) – optional boto3 Neptune client
credentials_profile_name (Optional[str]) – optional AWS profile name
region_name (Optional[str]) – optional AWS region, e.g., us-west-2
service (str) – optional service name, default is neptunedata
sign (bool) – optional, whether to sign the request payload, default is True
Example
graph = NeptuneRdfGraph(host=’<SPARQL host’>,
port=<SPARQL port>
)
schema = graph.get_schema()
OR
graph = NeptuneRdfGraph(
host=’<SPARQL host’>,
port=<SPARQL port>
)
schema_elem = graph.get_schema_elements()
#… change schema_elements …
graph.load_schema(schema_elem)
Security note: Make sure that the database connection uses credentialsthat are narrowly-scoped to only include necessary permissions.
Failure to do so may result in data corruption or loss, since the calling
Failure to do so may result in data corruption or loss, since the calling
code may attempt commands that would result in deletion, mutation
of data if appropriately prompted or reading sensitive data if such
data is present in the database.
The best way to guard against such negative outcomes is to (as appropriate)
limit the permissions granted to the credentials used with this tool.
See https://python.langchain.com/docs/security for more information.
Attributes
get_schema
Returns the schema of the graph database.
get_schema_elements
Methods
__init__(host[, port, use_https, ...])
get_summary()
Obtain Neptune statistical summary of classes and predicates in the graph.
load_schema(schema_elements)
Generates and sets schema from schema_elements.
query(query)
Run Neptune query.
__init__(host: str, port: int = 8182, use_https: bool = True, use_iam_auth: bool = False, client: Optional[Any] = None, credentials_profile_name: Optional[str] = None, region_name: Optional[str] = None, service: str = 'neptunedata', sign: bool = True) → None[source]¶
Parameters
host (str) – 
port (int) – 
use_https (bool) – 
use_iam_auth (bool) – 
client (Optional[Any]) – 
credentials_profile_name (Optional[str]) – 
region_name (Optional[str]) – 
service (str) – 
sign (bool) – 
Return type
None
get_summary() → Dict[str, Any][source]¶
Obtain Neptune statistical summary of classes and predicates in the graph.
Return type
Dict[str, Any]
load_schema(schema_elements: Dict[str, Any]) → None[source]¶
Generates and sets schema from schema_elements. Helpful in
Generates and sets schema from schema_elements. Helpful in
cases where introspected schema needs pruning.
Parameters
schema_elements (Dict[str, Any]) – 
Return type
None
query(query: str) → Dict[str, Any][source]¶
Run Neptune query.
Parameters
query (str) – 
Return type
Dict[str, Any]
Examples using NeptuneRdfGraph¶
AWS
Amazon Neptune with SPARQL
langchain_community.graphs.graph_document.Relationship¶
class langchain_community.graphs.graph_document.Relationship[source]¶
Bases: Serializable
Represents a directed relationship between two nodes in a graph.
source¶
The source node of the relationship.
Type
Node
target¶
The target node of the relationship.
Type
Node
type¶
The type of the relationship.
Type
str
properties¶
Additional properties associated with the relationship.
Type
dict
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param properties: dict [Optional]¶
param source: Node [Required]¶
param target: Node [Required]¶
param type: str [Required]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
Parameters
_fields_set (Optional[SetStr]) – 
values (Any) – 
Return type
Model
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to include in new model
Return type
List[str]
classmethod is_lc_serializable() → bool¶
Is this class serializable?
Return type
bool
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) → unicode¶
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
Parameters
include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – 
exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – 
by_alias (bool) – 
skip_defaults (Optional[bool]) – 
exclude_unset (bool) – 
exclude_defaults (bool) – 
exclude_none (bool) – 
encoder (Optional[Callable[[Any], Any]]) – 
models_as_dict (bool) – 
dumps_kwargs (Any) – 
Return type
unicode
classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a list of strings that describes the path
to the object.
Return type
List[str]
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
Parameters
path (Union[str, Path]) –
Parameters
value (Any) – 
Return type
Model
property lc_attributes: Dict¶
List of attribute names that should be included in the serialized kwargs.
These attributes must be accepted by the constructor.
property lc_secrets: Dict[str, str]¶
A map of constructor argument names to secret ids.
For example,{“openai_api_key”: “OPENAI_API_KEY”}
Examples using Relationship¶
Azure Cosmos DB for Apache Gremlin
Microsoft
langchain_community.graphs.networkx_graph.KnowledgeTriple¶
class langchain_community.graphs.networkx_graph.KnowledgeTriple(subject: str, predicate: str, object_: str)[source]¶
Knowledge triple in the graph.
Create new instance of KnowledgeTriple(subject, predicate, object_)
Attributes
object_
Alias for field number 2
predicate
Alias for field number 1
subject
Alias for field number 0
Methods
__init__()
count(value, /)
Return number of occurrences of value.
from_string(triple_string)
Create a KnowledgeTriple from a string.
index(value[, start, stop])
Return first index of value.
Parameters
subject (str) – 
predicate (str) – 
object_ (str) – 
__init__()¶
count(value, /)¶
Return number of occurrences of value.
classmethod from_string(triple_string: str) → KnowledgeTriple[source]¶
Create a KnowledgeTriple from a string.
Parameters
triple_string (str) – 
Return type
KnowledgeTriple
index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.