essepuntato / LODE

Live OWL Documentation Environment, to convert OWL ontologies into HTML human-readable pages.
ISC License
104 stars 55 forks source link

LODE 2 error: "HTTP Status 500 - String index out of range: -1" #20

Closed np00 closed 5 years ago

np00 commented 5 years ago

I get the following error if I try to submit my ontology: "string index index out of range" :(

Service used: http://lode2.linked.data.gov.au/ Module used: I tried all three File: https://raw.githubusercontent.com/vocol/dwd/master/dwd_weather_ontology.tt

Error:

HTTP Status 500 - String index out of range: -1

type Exception report

message String index out of range: -1

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    java.lang.String.substring(String.java:1960)
    com.edmondchuc.lode2.ExtractOntology.removeScripts(ExtractOntology.java:754)
    com.edmondchuc.lode2.ExtractOntology.tidy(ExtractOntology.java:457)
    com.edmondchuc.lode2.ExtractOntology.transform(ExtractOntology.java:383)
    com.edmondchuc.lode2.ExtractOntology.doPost(ExtractOntology.java:279)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:437)
    org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:177)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.32 (Ubuntu) logs.
np00 commented 5 years ago

Ah: In general, the service seems to work since it works with foaf for example.

nicholascar commented 5 years ago

The file you've referenced, https://raw.githubusercontent.com/vocol/dwd/master/dwd_weather_ontology.ttl, (but you missed the final 'l'!) and it has a tiny RDF format error (Line 79, dct:modified "2019-02-12" ^^xsd:date ; -> dct:modified "2019-02-12"^^xsd:date ;). With that error fixed, the file parses in LODE2 without any errors.

If you want to test the RDF validity of files like this before putting them into LODE(2), try using https://rdf-translator.appspot.com. I suppose we should improve the RDF error reporting in LODE(2)!

np00 commented 5 years ago

ah thank you, I used for validation rdfcat (apache jena) which did not catch that error. When checking the version of rdfcat, I just saw that the tool is deprecated and they recommend to use riot instead.

But thanks also for you link! I guess I will check both in the future.