On 25/11/2024 22:06, Hugo Bártolo wrote:
Andy

You are top:)

very helpfull 🙂

i understand everything when you reply:)
many thanks! 🙂


i have done what you said (http://localhost:3030/Trabalho/sparql)

and now the return error is:

SELECT * WHERE {
   ?sub ?pred ?obj .
} LIMIT 10


Error: SPARQL error: QueryBadFormed: A bad request has been sent to the 
endpoint: probably the SPARQL query is badly formed.

Response:
b'Parse error: Lexical error at line 1, column 11. Encountered: \'32\' (32), after prefix 
"rdf"\n'

That looks like a parse error in the query string becing sent.
Look in the Fuseki logs and see what query string it actually received.
There is space after the prefix name and before the : character.

Right:
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

Wrong:
PREFIX rdf :     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>



thanks for everuthig
________________________________
De: Andy Seaborne <a...@apache.org>
Enviado: 25 de novembro de 2024 21:26
Para: users@jena.apache.org <users@jena.apache.org>
Assunto: Re: Error: Unexpected response format: text/html (requested: json)



On 25/11/2024 18:50, Hugo Bártolo wrote:
Hi

   i am having some problems using a jupyter notebook to query a fuseki 
localhost, can you help me?

If the dataset is called "Trabalho", the SPARQL endpoint would look like:

%endpoint http://localhost:3030/Trabalho/sparql

or

%endpoint http://localhost:3030/Trabalho/sparql


(I should have pointed this out in the first reply)

/#/ are the UI and server administration operations.

http://localhost:3030/#/dataset/Trabalho/sparql is returning a page saying

<strong>We're sorry but this app doesn't work properly without
JavaScript enabled. Please enable it to continue.</strong>

      Andy


my fist error was puting <> in the endpoint.

but for
SELECT * WHERE {
    ?sub ?pred ?obj .
} limit 10

i get:

Error: Unexpected response format: text/html (requested: json)

i have use the

# Request whatever format is appropriate for the query type
%format default


-----------------------------------------------------------------------------------------------------------


# define the endpoint
%endpoint http://localhost:3030/#/dataset/Trabalho/sparql

# Don't show more than 80 results (event if more are fetched)
%show 80

# Request whatever format is appropriate for the query type
%format default

# Activate table output
%display table withtypes

%prefix rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
%prefix owl <http://www.w3.org/2002/07/owl#>
%prefix rdfs <http://www.w3.org/2000/01/rdf-schema#>
%prefix xsd <http://www.w3.org/2001/XMLSchema#>
%prefix dev <http://www.semanticweb.org/hugob/ontologies/2024/10/devedores#>



SELECT * WHERE {
    ?sub ?pred ?obj .
} limit 10


Error: Unexpected response format: text/html (requested: json)



Reply via email to