Skip to content

Commit

Permalink
fix httpx logging to warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Feb 18, 2025
1 parent 44ccf6f commit 5323a52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/sparql-llm/src/sparql_llm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Utilities to improve LLMs capabilities when working with SPARQL and RDF."""

__version__ = "0.0.4"
__version__ = "0.0.5"

from .validate_sparql import validate_sparql_in_msg, validate_sparql_with_void
from .sparql_examples_loader import SparqlExamplesLoader
Expand Down
14 changes: 5 additions & 9 deletions packages/sparql-llm/src/sparql_llm/utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import json
import logging
import time
from typing import Any, Optional

import httpx
import rdflib
from curies_rs import Converter

logging.getLogger("httpx").setLevel(logging.WARNING)

# Prefixes utilities

GET_PREFIXES_QUERY = """PREFIX sh: <http://www.w3.org/ns/shacl#>
Expand All @@ -17,12 +20,6 @@
} ORDER BY ?prefix"""


# def get_endpoints_schema_and_prefixes(endpoints: list[str]) -> tuple["EndpointsSchemaDict", dict[str, str]]:
# """Return a tuple of VoID descriptions and prefixes for the given endpoints."""
# return (

# )


def get_prefixes_for_endpoints(endpoints: list[str]) -> dict[str, str]:
"""Return a dictionary of prefixes for the given endpoints."""
Expand Down Expand Up @@ -67,11 +64,10 @@ def get_prefix_converter(prefix_dict: dict[str, str]) -> Converter:
}
}"""

# A dictionary to store triples like structure: dict[subject][predicate] = list[object]
# Also used to store VoID description of an endpoint: dict[subject_cls][predicate] = list[object_cls/datatype]
SchemaDict = dict[str, dict[str, list[str]]]
# The VoidDict type, but we also store the endpoints URLs in an outer dict
"""A dictionary to store the classes schema of an endpoint: dict[subject_cls][predicate] = list[object_cls/datatype]"""
EndpointsSchemaDict = dict[str, SchemaDict]
"""A dictionary to store the classes schema of multiple endpoints: dict[endpoint_url][subject_cls][predicate] = list[object_cls/datatype]"""


def get_schema_for_endpoint(endpoint_url: str, void_file: Optional[str] = None) -> SchemaDict:
Expand Down

0 comments on commit 5323a52

Please sign in to comment.