Skip to content

Commit

Permalink
add SPARQL processor option
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Mar 18, 2023
1 parent 30b9f1a commit ea8c4ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rdflib_endpoint/sparql_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(
custom_eval: Optional[Callable[..., Any]] = None,
enable_update: bool = False,
cors_enabled: bool = True,
processor: Any = None,
path: str = "/",
public_url: str = "https://sparql.openpredict.semanticscience.org/sparql",
example_query: str = """PREFIX myfunctions: <https://w3id.org/um/sparql-functions/>
Expand Down Expand Up @@ -213,7 +214,7 @@ async def sparql_endpoint(request: Request, query: Optional[str] = Query(None))

try:
# query_results = self.graph.query(query, initNs=graph_ns)
query_results = self.graph.query(query)
query_results = self.graph.query(query, processor=processor) if processor else self.graph.query(query)
except Exception as e:
logging.error("Error executing the SPARQL query on the RDFLib Graph: " + str(e))
return JSONResponse(
Expand Down

1 comment on commit ea8c4ef

@cthoyt
Copy link
Contributor

@cthoyt cthoyt commented on ea8c4ef Mar 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vemonet did you miss my pull request that implemented this?
#6

Please sign in to comment.