Search code examples
dbpediaspotlight-dbpedia

Locally extracting DBpedia Spotlight annotations from HTML files with Java API


Can I directly convert my HTML file to a DBpedia annotated file using the Java API? I found a related question:

but this is sends the text to web service; instead I need to convert locally. How can I do this?


Solution

  • You can use the parameter text to send an html content such as :

    <html><body> Hackers from the Syrian Electronic Army claimed responsibility for re-directing links sent by President Barack Obama to a pro-Assad video</body></html>

    E.g: http://spotlight.sztaki.hu:2222/rest/annotate?text=%3Chtml%3E%3Cbody%3E%20Hackers%20from%20the%20Syrian%20Electronic%20Army%20claimed%20responsibility%20for%20re-directing%20links%20sent%20by%20President%20Barack%20Obama%20to%20a%20pro-Assad%20video%3C/body%3E%3C/html%3E

    Do not forget to use POST instead of GET!