You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by "Stian Soiland-Reyes (JIRA)" <ji...@apache.org> on 2018/01/05 15:55:00 UTC

[jira] [Created] (TAVERNA-1027) COMBINE parsing fails with updated Jena - app URI scheme not supported

Stian Soiland-Reyes created TAVERNA-1027:
--------------------------------------------

             Summary: COMBINE parsing fails with updated Jena - app URI scheme not supported
                 Key: TAVERNA-1027
                 URL: https://issues.apache.org/jira/browse/TAVERNA-1027
             Project: Apache Taverna
          Issue Type: Bug
          Components: Taverna Language
    Affects Versions: language 0.16.0
            Reporter: Stian Soiland-Reyes
            Assignee: Stian Soiland-Reyes


I'm trying to update taverna-language to use Jena 3.6.0 (already updated in taverna-maven-parent 3-incubating-SNAPSHOT), but then taverna-robundle fails a test:

"Resolving against bad URI <app:://4a8a0ff8-eab0-3930-8257-017dec3a8356/manifest0.xml>" 

This seems to be because Jena's IRI support now fails for non-IANA URI schemes like "app" when parsing RDF/XML - as within the COMBINE archive's metadata.

In RO Bundle we use UUID-based [app: URL scheme|https://www.w3.org/TR/app-uri/] as specified by W3C to represent files within a Research Object zip archive.

That means naturally when parsing RDF files within that archive that we'll use URIs like app://4a8a0ff8-eab0-3930-8257-017dec3a8356/manifest0.xml as a base URI, so that a reference "fred.doc" becomes "app://4a8a0ff8-eab0-3930-8257-017dec3a8356/fred.xml"

A workaround would be to replace "app" with "file", pretending the UUID is a hostname, but somehow this also fails with Jena as it mangles "file://4a8a0ff8-eab0-3930-8257-017dec3a8356/fred.xml" into file:///4a8a0ff8-eab0-3930-8257-017dec3a8356/fred.xml after parsing - so it becomes tricky tyo ask the RDF model about fred.xml afterwards.

A workaround to the workaround would be to use host-less file:/// URIs -- another to drop the UUID and pretend file:/// is the root of the local file system rather than the root of the zip archive.  (This would also then correctly support relative URIs like /fred.xml although those don't occur in COMBINE archive)


Stack trace:

{code}
Jan 05, 2018 3:45:58 PM org.apache.taverna.robundle.manifest.combine.CombineManifest findAnnotations
WARNING: Can't parse /manifest0.xml
org.apache.jena.riot.RiotException: [line: 3, col: 48] {E214} Resolving against bad URI <app://4a8a0ff8-eab0-3930-8257-017dec3a8356/manifest0.xml>: <./BorisEJB.xml>
	at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.error(ErrorHandlerFactory.java:140)
	at org.apache.jena.riot.lang.ReaderRIOTRDFXML$ErrorHandlerBridge.error(ReaderRIOTRDFXML.java:254)
	at org.apache.jena.rdfxml.xmlinput.impl.ARPSaxErrorHandler.error(ARPSaxErrorHandler.java:37)
	at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.warning(XMLHandler.java:196)
	at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.warning(XMLHandler.java:173)
	at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.warning(XMLHandler.java:168)
	at org.apache.jena.rdfxml.xmlinput.impl.XMLBaselessContext.checkBaseUse(XMLBaselessContext.java:108)
	at org.apache.jena.rdfxml.xmlinput.impl.AbsXMLContext.resolveAsURI(AbsXMLContext.java:131)
	at org.apache.jena.rdfxml.xmlinput.impl.AbsXMLContext.resolveAsURI(AbsXMLContext.java:123)
	at org.apache.jena.rdfxml.xmlinput.impl.URIReference.resolve(URIReference.java:166)
	at org.apache.jena.rdfxml.xmlinput.states.WantDescription.startElement(WantDescription.java:63)
	at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.startElement(XMLHandler.java:111)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
	at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLNamespaceBinder.startElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.jena.rdfxml.xmlinput.impl.RDFXMLParser.parse(RDFXMLParser.java:150)
	at org.apache.jena.rdfxml.xmlinput.ARP.load(ARP.java:118)
	at org.apache.jena.riot.lang.ReaderRIOTRDFXML.parse(ReaderRIOTRDFXML.java:135)
	at org.apache.jena.riot.lang.ReaderRIOTRDFXML.read(ReaderRIOTRDFXML.java:79)
	at org.apache.jena.riot.RDFParser.read(RDFParser.java:334)
	at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:324)
	at org.apache.jena.riot.RDFParser.parse(RDFParser.java:273)
	at org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:498)
	at org.apache.jena.riot.RDFDataMgr.parseFromInputStream(RDFDataMgr.java:870)
	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:268)
	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:254)
	at org.apache.taverna.robundle.manifest.combine.CombineManifest.parseRDF(CombineManifest.java:240)
	at org.apache.taverna.robundle.manifest.combine.CombineManifest.findAnnotations(CombineManifest.java:332)
	at org.apache.taverna.robundle.manifest.combine.CombineManifest.readCombineArchive(CombineManifest.java:465)
	at org.apache.taverna.robundle.Bundle.readOrPopulateManifest(Bundle.java:121)
	at org.apache.taverna.robundle.Bundle.getManifest(Bundle.java:87)
	at org.apache.taverna.robundle.Bundle.close(Bundle.java:61)
	at org.apache.taverna.robundle.Bundle.close(Bundle.java:52)
	at org.apache.taverna.robundle.manifest.combine.TestCombineManifest.convertDirectoryMadnessZipped(TestCombineManifest.java:152)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)