Questions tagged [sparqlwrapper]

SPARQL Wrapper is a SPARQL Endpoint interface to Python

SPARQLWrapper is a SPARQL Endpoint interface to Python

158 questions
1
vote
1 answer

SPARQL Namespace conflict while querying

I'm quite puzzled by the behavior of my endpoint, nor by the processing of the request. The basic RDFS namespace seems to clash with another definition while querying, resulting in an error when declaring the prefix and a normal output when omitting…
1
vote
1 answer

Is it possible to upload files from efs instance to amazon Neptune through python

I have files stored in EFS. I want to upload the files to Neptune. I came across many references where files are uploaded to Neptune from S3. But in my use case i am having files in EFS. Is it possible to upload from efs to Neptune through…
1
vote
1 answer

How to get the WikiPageRedirects attribute for a dbpedia resource

I want to write a sparql query to return the WikiPageRedirects attribute for a given dbpedia resource. For example: MongoDB has 3 as depicted here https://dbpedia.org/page/MongoDB I write this query to get them: PREFIX dbo:…
LearnToGrow
  • 1,656
  • 6
  • 30
  • 53
1
vote
0 answers

DBPedia SparQL URLError: urlopen error [WinError 10060] in Python

I am trying to run following query on dbpedia approximately 1500 times in a loop with different parameters but it gives me URLError: urlopen error [WinError 10060] error. Sometimes it gives me error after processing 15 records and sometimes it gives…
Anusha Ali
  • 13
  • 3
1
vote
1 answer

SPARQL - What does a single colon do in a prefix?

I've often seen a SPARQL query starting with this prefix: PREFIX : But what exactly does it mean to use only a colon ":" in a prefix? I usually know it as putting another abbreviation in front of it. Like for example…
Krikell96
  • 75
  • 5
1
vote
1 answer

problem using Uniprot SPARQL endpoint and CONSTRUCT

From SPARQLwrapper I can successfully query and return results using SPARQL select. When I try to use the CONSTRUCT example from the website I get and error "ExpatError: no element found: line 1, column 0" I've tested my code with a dbpedia…
scuffster
  • 51
  • 1
1
vote
1 answer

Sparql query dates json results in the same format that in web portal

How to get the results related to dates from Sparql queries in wikidata in JSON through Python codes in the same format they appear when I query directly through the web? When I query in Wikidata Query Portal (Try it), some dates appear formatted…
1
vote
0 answers

How to insert data into named graph using SPARQL?

I am using python to insert data into blazegraph. I want to specify the named graph to which the data gets inserted, but the code I am using is triggering the error: SPARQLWrapper.SPARQLExceptions.QueryBadFormed: QueryBadFormed: a bad request has…
Ian Kurtis
  • 137
  • 7
1
vote
0 answers

Repeated results from SPARQL query

I could not find any help for my problem that I encounter when I am trying to get list of all basketball players from Wikidata. First I get the number of players (it is someting around 130k). Then I am creating query with specific offset and limit…
Riomare
  • 65
  • 1
  • 10
1
vote
2 answers

How to run a sparql query from Python over my GraphDB repository?

I'm trying to run a simple query: """ PREFIX rdfs: SELECT ?label WHERE { ?a rdfs:label ?label } """) Over my GraphDB repository, but from Python. After some searching I found that SPARQL wrapper…
Robin
  • 135
  • 10
1
vote
0 answers

How can I find the path distance between any two entities in wikidata? Also, how can I found the path length from the very top of the taxonomy?

I tried looking the SPARQL documentation but couldn't find anything that helps. This is what I need to do. (PathL is pathlength)
1
vote
1 answer

SPARQLWrapper can't make CONSTRUCT query return other than XML

I'm using SPARQLWrapper to query a local SPARQL endpoint (using apache-jena-fuseki), and some of my queries are CONSTRUCT queries. The query will give me valid results on web-based SPARQL interface, e.g. yasgui. When using SPARQLWrapper, the default…
renyuneyun
  • 608
  • 5
  • 18
1
vote
1 answer

How to handle "too many requests" on Wikidata using SPARQLWrapper?

I am iterating through a list users of approximately 1000 entries, like so: def wikidata_user_lookup(id_str): q = f''' SELECT ?item ?itemLabel ?kind ?kindLabel WHERE {{ ?item p:P2002 ?twitter . …
theQman
  • 1,690
  • 6
  • 29
  • 52
1
vote
0 answers

RDFLib first query slow on small graph (56 triples)

I have a small graph in a Jena/Fuseki store that I query using rdflib/SPARQLWrapper via CONSTRUCT to build a smaller graph that contains all the info I need. The resulting graph is a RDFLib Graph with 56 triples in total. Looking at the Jena logs…
fatz
  • 698
  • 7
  • 14
1
vote
1 answer

Sparql Query parameterized with string concatenation

I would like to write a Sparql query to obtain information about particular wikipedia articles. I'm a sparql newbie and could use some insights on using zlist as a parameter and passing it a list of articles, as .format would do in python. SELECT…
rene
  • 21
  • 6
1 2
3
10 11