Questions tagged [sparqlwrapper]

SPARQL Wrapper is a SPARQL Endpoint interface to Python

SPARQLWrapper is a SPARQL Endpoint interface to Python

158 questions
0
votes
1 answer

DBpedia rate limiting sparql requests?

I am running the following sparql query to DBpedia as I build a tree of a company hierarchy: def get_result(sparql, parent_company): sparql = SPARQLWrapper('https://dbpedia.org/sparql') sparql.setQuery(f''' SELECT ?name WHERE…
nholland
  • 1
  • 1
0
votes
0 answers

Strange spatial gaps in queries with DBpedia using Python SPARQL-Wrapper

I'm trying to query all the Wikipedia articles about places (have to be geolocated) in the United Kingdom. I'm using the SPARQL wrapper for python for my query to access the coordinates, article link, hierarchy and other metadata. and it looks like…
0
votes
1 answer

RuntimeWarning: unknown response content type 'text/html' returning raw response

I tried to use apache jena fuseki in my python code so I found this: https://sparqlwrapper.readthedocs.io/en/latest/main.html I followed the first example and here is my code: pip install sparqlwrapper from SPARQLWrapper import SPARQLWrapper,…
0
votes
0 answers

Need help fetching a person's age from wikidata query using sparql

I recently started working on sparql to generate query for getting the age of a specific person (say, Donald Trump) The only thing I could understand is that it would be an instance of Person class. Can someone help me with what else needs to be…
0
votes
0 answers

How to insert data into default graph name?

I am using python to insert data into blazegraph. I saw in the documentation of SparqlWrapper that I can set the defaultGraph as its parameter. wrapper = SPARQLWrapper("http://localhost:9999/blazegraph/namespace/kbss/sparql",…
Ian Kurtis
  • 137
  • 7
0
votes
1 answer

SPARQLWrapper - simple queries with no response

I'm looking for some help getting this very simple query started, so I can build upon it. At the moment I'm not retrieving any results, but this query works in Protege. from SPARQLWrapper import SPARQLWrapper, JSON, XML sparql =…
Carson Lloyd
  • 13
  • 1
  • 4
0
votes
0 answers

SPARQL Query on Python: Virtuoso 37000 Error SP030

I have a problem building a python script to run a query in SPARQL. What I would like to get is the list of information specified immediately after the SELECT (so artist, discography, etc..), for each artist possible. The script is as follows: from…
0
votes
0 answers

How to find number of [instanceOf OR subclass of] hops between any two wikidata entities?

For example, if I want to find number of hops between Politician (Q82955) and President of the US (Q11696), the answer should be 2. POTUS (Q11696) – subclassOf -> HeadOfGovernment (Q2285706) – subclassOf -> Politician (Q82955) How can I write a…
0
votes
0 answers

Is there a way to get the error code in SPARQLWrapper?

SPARQLWRapper provides us a user-friendly interface for issuing SPARQL queries, for example, you can execute a SPARQL query simply with the following two lines of code. sparql.setQuery(query) results = sparql.query().convert() However, one thing I…
Yu Gu
  • 2,382
  • 5
  • 18
  • 33
0
votes
1 answer

SPARQLWrapper - EndPointInternalError: endpoint returned code 500 and response

I'm trying to retrieve linked data from an endpoint which is secured. I've used the same credentials and configuration variables which successfully return results in YASGUI gives an error in Python. The error is: EndPointInternalError: endpoint…
Sef
  • 85
  • 7
0
votes
0 answers

is there a method to get data with sparql from medical MeSH data?

but me i want to get from this page for example : https://meshb.nlm.nih.gov/treeView : Musculoskeletal Diseases [C05] Bone Diseases [C05.116] Bone Diseases, Endocrine [C05.116.132] Acromegaly [C05.116.132.082] …
0
votes
0 answers

How can I filtering no definition concepts from my sparql query?

I am going to build a topic hierarchy tree using SPARQL query extracted from DBpedia. How can I filtering no definition concepts from my sparql query? My currently code is below: from SPARQLWrapper import SPARQLWrapper, N3 from…
BBQ
  • 23
  • 4
0
votes
1 answer

finding organization and industry/sector from string in dbpedia

I am generating a short list of 10 to 20 strings which I want to lookup on dbpedia to see if they have an organization tag and if so return the industry/sector tag. I have been looking at the SPARQLwrapper queries on their website but am having…
user1365234
  • 315
  • 1
  • 5
  • 16
0
votes
1 answer

Applying PageRank to a topic hierarchy tree(using SPARQL query extracted from DBpedia)

As I have a DBpedia query and I want to rank those results by using the PageRank algorithm. Toward the concept "Machine_learning", by using the SPARQL query below, I can find out all the ParentNodes, ChildNodes and SiblingNodes in DBpedia. select *…
BBQ
  • 23
  • 4
0
votes
1 answer

Cannot delete any triple from GraphDB using pythons SPARQLWrapper

I am trying to delete a simple triple from GraphDB (version = GraphDB free) using python's SPARQLWrapper and the code snippet I found here: https://github.com/RDFLib/sparqlwrapper - Update example. I always get the following…
Greenfish
  • 358
  • 2
  • 5
  • 19