Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to Endpoint #40

Closed
dabuchera opened this issue Jun 10, 2022 · 6 comments
Closed

Connect to Endpoint #40

dabuchera opened this issue Jun 10, 2022 · 6 comments

Comments

@dabuchera
Copy link

dabuchera commented Jun 10, 2022

Hi

Running into similar problems as #30

The endpoint is a Fuseki Server running locally with the following dataset

@prefix bot:      <https://w3id.org/bot#> .
@prefix bot_test: <http://example.org/bot_test#> .
@prefix cc:       <http://creativecommons.org/ns#> .
@prefix dbo:      <http://dbpedia.org/ontology/> .
@prefix dc:       <http://purl.org/dc/terms/> .
@prefix dce:      <http://purl.org/dc/elements/1.1/> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vann:     <http://purl.org/vocab/vann/> .
@prefix xml:      <http://www.w3.org/XML/1998/namespace> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/bot_test>
        rdf:type         owl:Ontology ;
        cc:license       <http://creativecommons.org/licenses/by/3.0/> ;
        dce:description  "Example showing how the BOT ontology can be used to describe the topology of a building.\nThe building has four external walls and consists of 2 storeys. In the first storey there are rooms 101 and 102. In the second storey there is room 201.\nRoom 101 has an entrance door, one window and a table.\nRoom 102 has a window and a sofa.\nA door connects room 101 and room 102.\nA trapdoor connects room 102 and room 201." ;
        dc:creator       <http://www.terkaj.com#walter> ;
        dc:issued        "2017-04-05"^^xsd:date ;
        dc:modified      "2017-04-05"^^xsd:date ;
        owl:imports      <https://w3id.org/bot> .
bot_test:BuildingTest
        rdf:type       owl:NamedIndividual , bot:Building ;
        bot:hasStorey  bot_test:Storey1 , bot_test:Storey2 .
bot_test:Storey1  rdf:type  owl:NamedIndividual , bot:Storey ;
        bot:hasSpace  bot_test:Room101 , bot_test:Room102 .
bot_test:Storey2  rdf:type  owl:NamedIndividual , bot:Storey ;
        bot:hasSpace  bot_test:Room201 .
bot_test:Room101  rdf:type   owl:NamedIndividual , bot:Space ;
        bot:adjacentElement  bot_test:door_101_102 , bot_test:door_entrance , bot_test:wall_101_102 , bot_test:wall_external_N , bot_test:wall_external_S , bot_test:wall_external_W , bot_test:window101 ;
        bot:containsElement  bot_test:table_101 .

Querying directly on fuseki works but getting following error

image

Tried out different clients such as StreamQuery, Parsing. The error above results with the SparqlClient (see below)

image

@dabuchera
Copy link
Author

dabuchera commented Jun 10, 2022

When running Queries with the SparqlClient such as the following, I'm running into errors like below

image

image

Could be related to #37

@tpluscode
Copy link
Contributor

Judging by the error, the response you get is a HTML document. I guess. that might be the Fuseki's UI.

Are you sure the the endpointUrl is correct? May be missing the /query in path

@dabuchera
Copy link
Author

endpointUrl should be correct. Fuseki running on

http://localhost:3030/#/dataset/ds/query
or
http://localhost:3030/#/dataset/ds/sparql

image

@dabuchera
Copy link
Author

Not sure if it is maybe because of the Turtle syntax of the data

@dabuchera
Copy link
Author

dabuchera commented Jun 11, 2022

Ok Solved

The following mistakes were done:

First, read the the SPARQL docs in detail -> Link
Three different possibilities are possible to query. All of them are possible and well documented in the types definition

image

image

Second, Make sure the query is formatted right i.e. only as a string, and assure that the header has the right Content-Type set

image

@tpluscode
Copy link
Contributor

Fuseki running on

http://localhost:3030/#/dataset/ds/query
or
http://localhost:3030/#/dataset/ds/sparql

Those are not Fuseki's SPARQL endpoints but the user interface. You should instead use http://localhost:3030/ds/query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants