Service clause failed - sparql

I am trying to query different repositories in allegrograph using sparql service clause but I am getting service clause failed error, could anyone let me know what am I doing wrong.
I think it has something to do with the endpoint.
This is my sample query:
query_string = """PREFIX ab: <http://learningsparql.com/ns/addressbook#>
PREFIX d: <http://learningsparql.com/ns/data#>
SELECT ?first
WHERE{
service <http://localhost:10035/repositories/repo1/> {
?s ab:firstName ?first. }
}"""
error : Server returned 400: Canceling query because a SERVICE clause failed.

Related

GraphDB Running Queries not showing up in the Monitor Tab in Workbench and not executing

Iam using GraphDB 10.0 and trying to run an insert statement in Workbench. This query starts running. Then I switch to the monitor tab which has no records. So I never see this query there. When I return back to the Sparql tab which contains my insert statement, I see no longer the progress circle instead the following info message :
'No results from previous run. Click Run or press Ctrl/Cmd-Enter to
execute the current query or update.'
This query eventually never gets executed.
In the logs, this query turns up in the query-log but not in the slow-query-log where I see the other successful queries.
Can someone suggest why I see this behaviour?
Here is the query :
PREFIX dsr: <https://sigir.com/model/>
insert
{GRAPH <https://sigir.com/datafactory/measures>
{
?ntwgiri a dsr:NetWeight ;
dsr:value ?ntwg_float .
}
} where {
service <repository:measures> {
SELECT distinct ?ntwgiri ?ntwg_float
where {
?ntwgiri a dsr:NetWeight ;
dsr:value ?ntwg_float .
}
}
}

AWS IoT SQL Rule

Am trying to execute the IoT Rule as part of the CFT template.
This rule has to ignore the message which has this field sNumber starting with F0F1.
The rule is like
SELECT * FROM 'topic/+/+/+' WHERE 'sNumber' NOT LIKE 'F0F1%'
But, am facing this error:
Resource handler returned message: "Expected a comparison operation:
StringNode(sNumber) 'sNumber' NOT LIKE 'F0F1%'
--------------------------------------------------------------------------------------------------------------------------------^ at 1:34 (Service: Iot, Status Code: 400, Request ID:
75e91f11-05c8-4e22-8cd7-0a3567261695, Extended Request ID: null)"
(RequestToken: 6cd8d39d-1b2d-4076-6253-60212009a63a, HandlerErrorCode:
InvalidRequest)
Can you help me understand what need to be done to achieve my requirement.
Try using startswith() function
SELECT * FROM 'topic/+/+/+' WHERE NOT startswith(sNumber, 'F0F1')

Pydrill Heapmemory Issue while Executing Spark submit commnads

Exception :
[MainThread ] [ERROR] : Message : TransportError(500, '{\n "errorMessage" : "RESOURCE ERROR: There is not enough heap memory to run this query using the web interface. \n\nPlease try a query with fewer columns or with a filter or limit condition to limit the data returned. \nYou can also try an ODBC/JDBC client. \n\n[Error Id: 8dc824fc-b1b5-4352-85fe-84e2eb5ff71d on

OLE DB provider "IBMDASQL" for linked server returned message "SQL0104: Token . was not valid

simple open query insert fails when running from stored procedure but same thing works if i run it manually;
INSERT INTO OPENQUERY([ServerName],
'select LocationCode, Name, Zip from Location.TKT')
VALUES( 1200, 'David', 52330);
same SP is running fine in Production but not in DEV machine i am getting the below error. Any clue?
Error Message:
OLE DB provider "IBMDASQL" for linked server "ServerName" returned message "SQL0104: Token . was not valid. Valid tokens: .
Cause . . . . . : A syntax error was detected at token .. Token . is not a valid token. A partial list of valid tokens is . This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token .. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is , correct the SQL statement because it does not end with a valid clause.".

TruncatedChunkException when querying my SPARQL endpoint with Jena

I'm executing a query against my SPARQL endpoint and getting a strange error (see below). But if I add a pretty low LIMIT in the number of results my query returns a result as expected. As a test I queried DBpedia and had no issues even for retrieving millions of results. I suspect that it has something to do with some of the data that is being returned from my endpoint is causing the issue. Any ideas on how to resolve this?
QueryExecution qe = QueryExecutionFactory.sparqlService(sparqlEndpoint,
sparqlQuery);
ResultSet results = qe.execSelect();
Exception in thread "main" org.apache.jena.atlas.AtlasException:
org.apache.http.TruncatedChunkException: Truncated chunk ( expected
size: 4096; actual size: 3151)
The other end is sending broken data (at the HTTP level).
Check the service at sparqlEndpoint.