When I Query my dataset in the Fuseki UI with this predefined query:
SELECT ?subject ?predicate ?object
WHERE {
?subject ?predicate ?object
}
LIMIT 25
it responses with no data available.
However, if I'm open the edit tab and click on the default graph it shows all my data.
I recon that it is a configure issue, but cant find any hint in the documentation.
The endpoint is set to anon in shiro
/**/query = anon
And the Endpoints are configured in the most basic way:
fuseki:endpoint [
fuseki:operation fuseki:query ;
fuseki:name "sparql" ;
## Set default-union-graph for this endpoint.
ja:context [ ja:cxtName "tdb:unionDefaultGraph" ; ja:cxtValue true ] ;
] ;
fuseki:endpoint [
fuseki:operation fuseki:query ;
fuseki:name "query"
] ;
When I'm query the data via http, the server response with a ttl file containing all my data:
http://localhost:8081/dataset/data?default
The Fuseki Server and Webapp runs inside a docker container using the following compose configuration:
version: '3'
services:
web:
image: tomcat:9.0
ports:
- "8081:8080"
volumes:
- ./logs/fuseki:/etc/fuseki/logs
- ./logs/tomcat:/usr/local/tomcat/logs
- ./triplestore/ROOT.war:/usr/local/tomcat/webapps/ROOT.war
- ./shiro.ini:/etc/fuseki/shiro.ini
- ./config.ttl:/etc/fuseki/config.ttl
Any suggestion for why the querys dont work are appreciated.
I tried querieng using the WebUI and via curl, both with the same result. Only downloading via http works.
EDIT: The way I put my data in the store
I use a python script to load my data into the store.
def write_to_fuseki():
print('write to fuseki')
headers = {'Content-Type': 'text/turtle;charset=utf-8'}
r = requests.put('http://localhost:8081/dataset/data?default',headers=headers, data=open('ontology/test.ttl', 'rb'), auth=('user', 'pw'))
I found the solution in this question:
Uploading a .ttl file to Fuseki using Java client - where are my triples in Fuseki?
It appears the union default graph setting was not doing what I expected. I changed the config, and removed all unionDefaultGraph settings and know my data appears in the search.
:service rdf:type fuseki:Service ;
fuseki:name "dataset" ;
fuseki:endpoint [
fuseki:operation fuseki:query ;
fuseki:name "sparql" ;
] ;
fuseki:endpoint [
fuseki:operation fuseki:query ;
fuseki:name "query"
] ;
fuseki:endpoint [
fuseki:operation fuseki:update ;
fuseki:name "update"
] ;
fuseki:endpoint [
fuseki:operation fuseki:gsp-r ;
fuseki:name "get"
] ;
fuseki:endpoint [
fuseki:operation fuseki:gsp-rw ;
fuseki:name "data"
] ;
fuseki:endpoint [
fuseki:operation fuseki:patch ;
fuseki:name "patch"
] ;
fuseki:dataset :dataset_tdb2 ;
.
:dataset_tdb2 rdf:type tdb2:DatasetTDB2 ; tdb2:location "databases/db" .