freme-project / freme-project.github.io

Apache License 2.0
2 stars 0 forks source link

Pipelines tutorial does not work #333

Closed jnehring closed 7 years ago

jnehring commented 7 years ago

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?

ghsnd commented 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?

ghsnd commented 7 years ago

Duplicate of freme-project/e-Link#69 ?

m1ci commented 7 years ago

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"

ghsnd commented 7 years ago

Template 1 works and yields results, so I guess we could use that. I'll update the tutorial.

ghsnd commented 7 years ago

I updated the tutorial, pushed the changes, but got this Travis build error, so I cannot check if the tutorial is OK now.

jnehring commented 7 years ago

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.

ghsnd commented 7 years ago

It looks good and it works. I consider this closed.