owlapy.agen_kg.helper
Attributes
Functions
|
|
|
Runs a SPARQL query against the DBpedia SPARQL endpoint. |
Extracts the hierarchy of an entity from DBpedia using the SPARQL endpoint. |
|
|
Splits an iterable into fixed-size chunks and yields them sequentially. |
Module Contents
- owlapy.agen_kg.helper.RDFS_COMMENT_IRI = 'http://www.w3.org/2000/01/rdf-schema#comment'
- owlapy.agen_kg.helper.RDFS_LABEL_IRI = 'http://www.w3.org/2000/01/rdf-schema#label'
- owlapy.agen_kg.helper.american_to_british
- owlapy.agen_kg.helper.task_example_mapping
- owlapy.agen_kg.helper.run_query(query)[source]
Runs a SPARQL query against the DBpedia SPARQL endpoint.
- owlapy.agen_kg.helper.extract_hierarchy_from_dbpedia(cls)[source]
Extracts the hierarchy of an entity from DBpedia using the SPARQL endpoint.
- Parameters:
cls (str) – The DBpedia class remainder.
- Returns:
- A tuple containing two lists:
superclasses: List of superclasses of the entity.
subclasses: List of subclasses of the entity.
- Return type:
tuple
- owlapy.agen_kg.helper.T
- owlapy.agen_kg.helper.chunked_iterator(seq: Iterable[T], size: int = 20) Iterator[list[T]][source]
Splits an iterable into fixed-size chunks and yields them sequentially.
This function consumes the input iterable lazily and groups its elements into lists of a maximum given size. It is useful for batching data for processing, such as API calls or LLM requests.