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

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

Closed
np00 opened this issue Feb 18, 2019 · 3 comments
Closed

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

np00 opened this issue Feb 18, 2019 · 3 comments

Comments

@np00
Copy link

np00 commented Feb 18, 2019

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
Copy link
Author

np00 commented Feb 18, 2019

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

@nicholascar
Copy link
Contributor

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
Copy link
Author

np00 commented Mar 6, 2019

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.

@np00 np00 closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants