NIF API¶
- GET /services/server/access/(service_id)¶
Access the service at service_url. The service_id can be retrieved from the service page in the Portal Since the requests to the server are likely to be long, POST /services/server/access/(service_id) is recommended.
Example request:
GET /service/access/SentimentAnalysisExample?input=I%20love%20EUROSENTIMENT HTTP/1.1 Host: eurosentiment.eu Accept: application/json, text/javascript
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "@context": [ "http://eurosentiment.eu/context.jsonld", { "@base": "http://eurosentiment.eu/service/access/SentimentAnalysisExample#" } ], "analysis": [ { "@id": "SentimentAnalysisExample", "@type": "marl:SentimentAnalysis", "dc:language": "en", "marl:maxPolarityValue": 10.0, "marl:minPolarityValue": 0.0 } ], "domain": "wndomains:electronics", "entries": [ { "opinions": [ { "prov:generatedBy": "SentimentAnalysisExample", "marl:polarityValue": 7.8, "marl:hasPolarity": "marl:Positive", "marl:describesObject": "http://eurosentiment.eu", } ], "nif:isString": "I love EUROSENTIMENT", "strings": [ { "nif:anchorOf": "EUROSENTIMENT", "nif:taIdentRef": "http://eurosentiment.eu" } ] } ] }
Query Parameters: - input (i) – No default. Depends on informat and intype
- informat (f) – one of turtle (default), text, json-ld
- intype (t) – one of direct (default), url
- outformat (o) – one of turtle (default), text, json-ld
- prefix (p) – prefix for the URIs
Request Headers: - Accept – the response content type depends on Accept header
- X-Eurosentiment-Token – optional OAuth token to authenticate
Response Headers: - Content-Type – this depends on Accept header of request
Status Codes: - 200 OK – no error
- 404 Not Found – service not found
- POST /services/server/access/(service_id)¶
The same as the previous method. This is the recommended method.
Form Parameters: - i/input – No default. Depends on informat and intype
- f/informat – one of turtle (default), text, json-ld
- t/intype – one of direct (default), url
- o/outformat – one of turtle (default), text, json-ld
- p/prefix – prefix for the URIs
Request Headers: - Accept – the response content type depends on Accept header
- X-Eurosentiment-Token – optional OAuth token to authenticate
Response Headers: - Content-Type – this depends on Accept header of request
Status Codes: - 200 OK – no error
- 404 Not Found – service not found