File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 44DEFAULT_EXAMPLE_QUERY = "select * { ?s ?p ?o } limit 10"
55
66
7- def sparql_file (graph_file : str , example_query : str = DEFAULT_EXAMPLE_QUERY ):
7+ def sparql_file (
8+ graph_file : str ,
9+ example_query : str = DEFAULT_EXAMPLE_QUERY ,
10+ graph_format : str | None = None ,
11+ ):
812 g = Graph ()
913
1014 with open (graph_file , "r" ) as graph_file_io :
11- g .parse (source = graph_file_io )
15+ g .parse (source = graph_file_io , format = None )
1216
1317 # Return the SPARQL endpoint based on the RDFLib Graph
1418 return SparqlEndpoint (
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ def cli(
1212 host : str = "0.0.0.0" ,
1313 port : str = "8000" ,
1414 example_query : str = DEFAULT_EXAMPLE_QUERY ,
15+ graph_format : str | None = None ,
1516):
16- """Start the sparql file server """
17+ """Start a SPARQL 1.1 endpoint based on the given RDF file. """
1718 endpoint = sparql_file (graph_file , example_query )
1819 uvicorn .run (endpoint , host = host , port = port )
1920
You can’t perform that action at this time.
0 commit comments