Closed jnehring closed 7 years ago
The issue can be reduced to e-Link template nr 3 that seems to be not correct anymore (it used to work). The message when using it is:
{
"exception": "eu.freme.common.exception.BadRequestException",
"path": "/e-link/documents/",
"message": "It seems your SPARQL template is not correctly defined.",
"error": "Bad Request",
"status": 400,
"timestamp": 1485352457504
}
Here is the template:
{
"id": 3,
"creationTime": 0,
"description": "",
"owner": {
"name": "admin",
"role": "ROLE_ADMIN"
},
"visibility": "PUBLIC",
"endpoint": "http://factforge.net/sparql",
"query": "PREFIX geo-pos: <http://www.w3.org/2003/01/geo/wgs84_pos#> CONSTRUCT { <@@@entity_uri@@@> geo-pos:lat ?lat . <@@@entity_uri@@@> geo-pos:long ?long . } WHERE { <@@@entity_uri@@@> geo-pos:lat ?lat . <@@@entity_uri@@@> geo-pos:long ?long . }",
"label": "dataset label",
"endpointType": "SPARQL"
}
Running the SPARQL query with substituted variable on http://factforge.net/sparql works, for instance:
PREFIX geo-pos: <http://www.w3.org/2003/01/geo/wgs84_pos#>
CONSTRUCT { <http://dbpedia.org/resource/Antwerp> geo-pos:lat ?lat . <http://dbpedia.org/resource/Antwerp> geo-pos:long ?long . }
WHERE { <http://dbpedia.org/resource/Antwerp> geo-pos:lat ?lat . <http://dbpedia.org/resource/Antwerp> geo-pos:long ?long . }
Can someone tell what is wrong with this template?
Duplicate of freme-project/e-Link#69 ?
I confirm that the query works manually submitting it to the SPARQL endpoint. However, the template does not work against the live API. Unfortunately, the template with ID 3 is not available anymore at the FREME dev and I can't debug
@jnehring @ghsnd @pheyvaer Can you maybe use template with ID 1 instead of 3? This will require small update of the tutorial.
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d @pipeline.json "https://api.freme-project.eu/current/pipelining/chain"
Template 1 works and yields results, so I guess we could use that. I'll update the tutorial.
I updated the tutorial, pushed the changes, but got this Travis build error, so I cannot check if the tutorial is OK now.
We do not use the travis build system, I will switch it off: #339
The dev API doc is located here: http://rv1443.1blu.de/doc/tutorials/pipeline-entity-link.html
To me it looks good. @ghsnd please test and close the issue if it is solved.
It looks good and it works. I consider this closed.
This tutorial shows this CURL request:
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "[{\"method\": \"POST\",\"endpoint\": \"https://api.freme-project.eu/current/e-entity/freme-ner/documents\",\"parameters\": {\"language\": \"en\",\"dataset\": \"dbpedia\",\"mode\": \"all\"},\"headers\": {\"content-type\": \"text/plain\",\"accept\": \"text/turtle\"},\"body\": \"This summer there is the Zomerbar in Antwerp, one of the most beautiful cities in Belgium.\"},{\"method\": \"POST\",\"endpoint\": \"https://api.freme-project.eu/current/e-link/documents/\",\"parameters\": {\"templateid\": \"3\"},\"headers\": {\"content-type\": \"text/turtle\",\"accept\": \"text/turtle\"}}]" "https://api.freme-project.eu/current/pipelining/chain"
The request fails. Can you please check what is wrong?