Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pipelines] Pipeline and intype=url #88

Open
jnehring opened this issue Aug 25, 2016 · 3 comments
Open

[Pipelines] Pipeline and intype=url #88

jnehring opened this issue Aug 25, 2016 · 3 comments
Labels

Comments

@jnehring
Copy link
Member

This pipeline does not work:

[{
        "method": "POST",
        "endpoint": "http://api.freme-project.eu/current/toolbox/nif-converter/",
        "parameters": {
            "intype": "url",
            "input" : "https://www.theguardian.com/world/2009/oct/27/berlin-wall-short-history"
        },
        "headers": {
            "content-type": "text/html",
            "accept": "text/turtle"
        }
    }, 
    {
        "method": "POST",
        "endpoint": "http://api.freme-project.eu/current/e-entity/freme-ner/documents/",
        "parameters": {
            "language": "en",
            "dataset" : "dbpedia"
        },
        "headers": {
            "content-type": "text/turtle",
            "accept": "text/html"
        }
    }

]

It causes an Internal Server Error.

@ArneBinder
Copy link
Contributor

The reason is, that roundtripping in the pipeline service requires any content to convert to turtle, but the body of the first request is empty.

@jnehring
Copy link
Member Author

Lets leave this bug open, currently we have more important things to do.

@ArneBinder
Copy link
Contributor

ArneBinder commented Oct 4, 2016

You can get the urlfilter functionality (also in combination with roundtripping) when you store a pipeline which handles just turtle and call it via pipelining/chain/{id} with the request parameters intype=url and input={YOUR_URL}. Furthermore, you can set the accept header to text/html to get roundtripping funcitonaility. The same holds for #89.

Try adding this pipeline:

[
{
  "method": "POST",
  "endpoint": "https://api-dev.freme-project.eu/current/e-entity/freme-ner/documents",
  "parameters": {
     "dataset": "dbpedia", 
    "language": "en"
  }
},
{
  "method": "POST",
  "endpoint": "https://api-dev.freme-project.eu/current/e-link/documents/",
  "parameters": {
    "templateid": "1"
  }
}
]

and call it with (do not forget to set the pipeline id):

curl -X POST -H "Accept: text/html" -H "Content-Type: text/html" -d '' "http://api-dev.freme-project.eu/current/pipelining/chain/{THE_NEW_PIPELINE_ID}?intype=url&input=http://beautifulberlin.blogspot.de/2009/07/short-history-of-berlin.html"

Perhaps, this should be mentioned in the section Using a Pipeline of the FREME pipelines article.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants