I have a SPARQL query that returns results in the Stardog query panel when inference is enabled, but not when it's disabled. When I try the query through python with SPARQLwrapper, I get no results. I tried with a different query, which doesn't rely…
I have the following example of querying wikidata via Python's SPARQLWrapper:
import rdflib, urllib
from SPARQLWrapper import SPARQLWrapper, JSON, XML, TURTLE, RDF, N3
from rdflib import Graph, Namespace, URIRef, RDF#, RDFS, Literal
def…
I know that by default fuseki provides different urls for both query and update, allowing some elegant management.
Now, i want to get a single URL for both update and query. The rationale behind this need is to avoid the propagation of two urls in…
I have an SPARQL query that mimics a zick-zack pattern like following.
?p1 :infector ?p.
?p2 :infector ?p1.
?p3 :infector ?p2.
?p4 :infector ?p3.
?p5 :infector ?p4
.................
Basically, in the pattern subject of one triple using as an object…
I want to crawl 100 pages of wikipedia , so I want to increment the wikiPageID by 1, each time. How can i do it?
PREFIX rdfs:
SELECT * WHERE {
?saket dbo:wikiPageID 57570.
?saket foaf:isPrimaryTopicOf…
I want to extract some text of Wikipedia as JSON, using SPARQL. The following query retrieves the text, but in HTML format. How can I get the JSON output?
# -*- coding: utf-8 -*-
from SPARQLWrapper import SPARQLWrapper, JSON
from pprint import…
I am trying to send a URL as a parameter to the sesame workbench, using sparql. How can I do that?
More specifically, A working sample from my code is;
p="OSPF"
queryString = ("""
PREFIX rdf:
PREFIX…
I am writing an SPARQL query where I am creating an RDF graph. I am using SPARQL CONSTRUCT. As a requirement of my work, I have to concatenate two subject values and used it with CONSTRUCT statement. I have tried to do following (my RDF graph is in…
I'm having some trouble on execute a sparql update. As the title say the problem is the apostrophe in the 2nd triple of the query. This is the error:
Response: Error 400: Lexical error at line 20,column 229. Encountered " " (32) after: "s"
Here is…
This SUM aggregate function is not working. It gives no result.
select (SUM(?p) as ?prcc) ?sune
where {
?inl Sp:hasp ?p.
?inl Sp:hassuid ?supid.
?supid Sp:hassune ?sune.
}
GROUP BY ?sune
The data in "p" is in double format. So when i…
I'm a newbie to SPARQL, and I would like to combine two columns into one
initial table
a|b|1
c|d|2
wanted table
a|b
c|d
b|1
d|2
its like creating two different tables and putting them one on the other.
I need that to make a visualisation using…
I am developing an application which uses a common Fuseki dataset with other developers. A Javascript function calls AJAX (jQuery $.ajax()) and sends to the Python script three variables via POST request.
Javascript:
$.ajax({
url:…
I have been having this weird issue, I am trying to insert into a virtuoso graph using SPARQLWrapper library in python.
I am able to insert a triple via the browser based endpoint at localhost:8890\sparql , but when I try the same query via my…
How can we ask federated queries using SPARQLWrapper? If it is not possible, is there any alternate library available for making such queries for Python?