Stephen,
You should use SPARQLwrapper for querying a remote sparql end-point:
https://rdflib.github.io/sparqlwrapper/
The following code will run:
from SPARQLWrapper import SPARQLWrapper, JSON
sparql = SPARQLWrapper("http://dbpedia.org/sparql")
> sparql.setQuery("""
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> SELECT ?label
> WHERE { <http://dbpedia.org/resource/Asturias> rdfs:label ?label }
> """)
> sparql.setReturnFormat(JSON)
> results = sparql.query().convert()
>
> for result in results["results"]["bindings"]:
> print(result["label"]["value"])
>
Trying this code with your address does not give a response.
Hope this helps.
Richard
On Wednesday, February 20, 2019 at 7:36:29 PM UTC+1, [email protected]
wrote:
>
> Hi I have been trying to run the following script and have not succeeded
> with loading the URI successfully. Does anyone know the issue + solution to
> this problem? This is the following script:
>
>
> import rdflib
> g = rdflib.Graph()
> g.load("
> http://169.36.179.223:10035/repositories/cso_core_collector-20190124")
>
> qres = g.query(
> """SELECT ?class
> WHERE {
> ?s rdf:type ?class
> } GROUP BY ?class"""
> )
>
> for row in qres:
> print(row)
>
>
--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups
"rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rdflib-dev/007146fd-3419-496b-9c0d-6d8edf67856f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.