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…
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…
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,…
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…
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",…
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 =…
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…
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…
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…
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…
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]
…
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…
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…
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 *…
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…