Hi Simon,
Hi folks
I'm having an issue importing/converting a local html file using sparql motion scripts as opposed to a web file at a URL. A web html file works fine in my tests.
I can use the importXHTML module on a web URL fine e.g. wwww.examplesite.com/htmlfileBut if I try point it at a local file it fails. I've tried the following http protocol without success. e.g. file:///fileLocation/htmlfile (specifiying .html file type makes no difference and also with or without .html type added on disc). I also tried file://localhost/fileLocation/htmlfile with no success.
I also tried converting the html file to xhtml using oxgenXML but this made no change.
Are you referring to this error?
Caused by: java.net.MalformedURLException: Only http & https
protocols supported
at
org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:636)
at
org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:629)
at
org.jsoup.helper.HttpConnection.execute(HttpConnection.java:261)
at
org.jsoup.helper.HttpConnection.get(HttpConnection.java:250)
at
org.topbraid.html2xml.HTML2XML.parseFromURL(HTML2XML.java:28)
at
org.topbraid.sparqlmotion.lib.internal.ImportXHTMLModule.execute(ImportXHTMLModule.java:37)
... 7 more
is there some aspect of tidy function or something else at play that either I'm missing or can't control for a local file ?
I guess we could switch to this if the URL is a local file:
https://jsoup.org/cookbook/input/load-document-from-file
Would this solve your use case? (There still is time for the 6.3 final release).
Given that the current version only support HTTP, could you use the EDG/TBL server to access the files? For example, with TBC-ME:
1) Create a folder in the workspace such as myfiles.www
2) Copy your .html file(s) into that folder, e.g. hk.html
3) Use sml:url http://localhost:8083/tbl/lib/myfiles/hk.html
In my quick test that worked fine.
As a related question on debugging this. Is it possible to see more info anywhere about these modules other than the basic info in TBCME help and at the SPIN vocab files which are only of limited help ? e.g. more details on the underlying classes and signatures ?
Not that I could think of. The stack traces should you some of the internals, but only if something goes wrong.
Maybe the rest of the email can be ignored if the solution above works for you?
Holger
--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/17f9a123-98b7-49e2-bc67-11524e0e1911%40googlegroups.com.
On 14/11/2019 11:45, Holger Knublauch wrote:
Hi Simon,
On 14/11/2019 06:52, Simon Opper wrote:
Hi folks
I'm having an issue importing/converting a local html file using sparql motion scripts as opposed to a web file at a URL. A web html file works fine in my tests.
I can use the importXHTML module on a web URL fine e.g. wwww.examplesite.com/htmlfileBut if I try point it at a local file it fails. I've tried the following http protocol without success. e.g. file:///fileLocation/htmlfile (specifiying .html file type makes no difference and also with or without .html type added on disc). I also tried file://localhost/fileLocation/htmlfile with no success.
I also tried converting the html file to xhtml using oxgenXML but this made no change.Are you referring to this error?
Caused by: java.net.MalformedURLException: Only http & https protocols supported
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:636)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:629)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:261)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:250)
at org.topbraid.html2xml.HTML2XML.parseFromURL(HTML2XML.java:28)
at org.topbraid.sparqlmotion.lib.internal.ImportXHTMLModule.execute(ImportXHTMLModule.java:37)
... 7 more
is there some aspect of tidy function or something else at play that either I'm missing or can't control for a local file ?I guess we could switch to this if the URL is a local file:
https://jsoup.org/cookbook/input/load-document-from-file
Would this solve your use case? (There still is time for the 6.3 final release).
FWIW I have just changed the implementation so that sml:ImportXHTML now also handles file: URLs out of the box, for 6.3.
Holger
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/25552c97-8cec-e814-3130-f775ee6e9f7f%40topquadrant.com.
| |
|
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CABfSiROer3iexv8THFsegNsEYSjhrHiCRb1ws2-38ueEKgyocw%40mail.gmail.com.
An error has been reported:
No folder found with alias "generaltesting".

To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/79A4AEA1-7AD6-46B3-9206-47186E6B22A2%40topquadrant.com.