Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
OK sorry, I meant that the first one imports the second one: gps: imports gp:. The imports are not cyclic. Location mapping is not part of the problem, I don't know why I attached it :) I guess you can just remove all the external imports (sp:, spin:, foaf:, sioc:) from the ontologies so they're out of the picture. On Fri, Jul 22, 2016 at 10:28 PM, Andy Seabornewrote: > So "import each other" is not a cycle? > > and does the location-mapping.n3 make a difference because I though the > issue was the overridden model.read was not being called which is not > related to location mapping. > > Andy > > > On 22/07/16 21:10, Martynas Jusevičius wrote: >> >> No this is about getOntology() not calling loadImports() in 3.0.1, >> which I now need to call myself. And OntModel is retrieved multiple >> times. >> >> I see there is Set m_imported in OntModelImpl -- could be >> exposed as OntModel.getImportedURIs() for example. >> >> The concurrency thing is another thread. I don't really have more than >> those stack-traces. Testing locking OntModel as Dave suggested. >> >> On Fri, Jul 22, 2016 at 10:05 PM, Andy Seaborne wrote: >>> >>> Martynas, >>> >>> This is the concurrency problem? Not JENA-1210 (imports) which happens >>> with >>> non-cyclic imports? >>> >>> Could you put a complete, minimal example for this please? >>> >>> It really does help to have them so that someone can know they are >>> working >>> on the problem reported. Otherwise, they spend a while just setting up >>> the >>> situation ... which takes a large chnuk of time ... which means it does >>> not >>> get done so soon. >>> >>> Andy >>> >>> >>> >>> On 22/07/16 18:07, Martynas Jusevičius wrote: These are 2 ontologies that import each other (gps: imports gp:): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gps.ttl https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gp.ttl Here is the location mapping (should cover all owl:imports from those 2 ontologies): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/location-mapping.n3 On Fri, Jul 15, 2016 at 10:01 PM, Andy Seaborne wrote: > > > Do you have some test files we can use? > > > On 15/07/16 20:30, Martynas Jusevičius wrote: >> >> >> >> Created an issue: https://issues.apache.org/jira/browse/JENA-1210 >> >> On Fri, Jul 15, 2016 at 5:48 PM, Andy Seaborne >> wrote: >>> >>> >>> >>> On 15/07/16 15:15, Martynas Jusevičius wrote: I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? >>> >>> >>> >>> >>> >>> Because old style RDFReaders now call RDFDataMgr but they can't get >>> the >>> full >>> benefit of content negotiation. IIRC. >>> >>> In 2.11, conneg was weak to non-existent. >>> >>> A hybrid may be possible. >>> >>> Andy >>> >>> On Fri, 15 Jul 2016 at 12:40, Andy Seaborne wrote: > On 14/07/16 15:17, Martynas Jusevičius wrote: >> >> >> >> >> Should I open a Jira for this as well? Seems like a bug to me. > > > > > > Yes. > > And a fix? > >Andy > > >>> > >>> >
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
So "import each other" is not a cycle? and does the location-mapping.n3 make a difference because I though the issue was the overridden model.read was not being called which is not related to location mapping. Andy On 22/07/16 21:10, Martynas Jusevičius wrote: No this is about getOntology() not calling loadImports() in 3.0.1, which I now need to call myself. And OntModel is retrieved multiple times. I see there is Set m_imported in OntModelImpl -- could be exposed as OntModel.getImportedURIs() for example. The concurrency thing is another thread. I don't really have more than those stack-traces. Testing locking OntModel as Dave suggested. On Fri, Jul 22, 2016 at 10:05 PM, Andy Seabornewrote: Martynas, This is the concurrency problem? Not JENA-1210 (imports) which happens with non-cyclic imports? Could you put a complete, minimal example for this please? It really does help to have them so that someone can know they are working on the problem reported. Otherwise, they spend a while just setting up the situation ... which takes a large chnuk of time ... which means it does not get done so soon. Andy On 22/07/16 18:07, Martynas Jusevičius wrote: These are 2 ontologies that import each other (gps: imports gp:): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gps.ttl https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gp.ttl Here is the location mapping (should cover all owl:imports from those 2 ontologies): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/location-mapping.n3 On Fri, Jul 15, 2016 at 10:01 PM, Andy Seaborne wrote: Do you have some test files we can use? On 15/07/16 20:30, Martynas Jusevičius wrote: Created an issue: https://issues.apache.org/jira/browse/JENA-1210 On Fri, Jul 15, 2016 at 5:48 PM, Andy Seaborne wrote: On 15/07/16 15:15, Martynas Jusevičius wrote: I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? Because old style RDFReaders now call RDFDataMgr but they can't get the full benefit of content negotiation. IIRC. In 2.11, conneg was weak to non-existent. A hybrid may be possible. Andy On Fri, 15 Jul 2016 at 12:40, Andy Seaborne wrote: On 14/07/16 15:17, Martynas Jusevičius wrote: Should I open a Jira for this as well? Seems like a bug to me. Yes. And a fix? Andy
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
No this is about getOntology() not calling loadImports() in 3.0.1, which I now need to call myself. And OntModel is retrieved multiple times. I see there is Set m_imported in OntModelImpl -- could be exposed as OntModel.getImportedURIs() for example. The concurrency thing is another thread. I don't really have more than those stack-traces. Testing locking OntModel as Dave suggested. On Fri, Jul 22, 2016 at 10:05 PM, Andy Seabornewrote: > Martynas, > > This is the concurrency problem? Not JENA-1210 (imports) which happens with > non-cyclic imports? > > Could you put a complete, minimal example for this please? > > It really does help to have them so that someone can know they are working > on the problem reported. Otherwise, they spend a while just setting up the > situation ... which takes a large chnuk of time ... which means it does not > get done so soon. > > Andy > > > > On 22/07/16 18:07, Martynas Jusevičius wrote: >> >> These are 2 ontologies that import each other (gps: imports gp:): >> >> https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gps.ttl >> >> https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gp.ttl >> >> Here is the location mapping (should cover all owl:imports from those >> 2 ontologies): >> >> https://github.com/AtomGraph/Processor/blob/master/src/main/resources/location-mapping.n3 >> >> On Fri, Jul 15, 2016 at 10:01 PM, Andy Seaborne wrote: >>> >>> Do you have some test files we can use? >>> >>> >>> On 15/07/16 20:30, Martynas Jusevičius wrote: Created an issue: https://issues.apache.org/jira/browse/JENA-1210 On Fri, Jul 15, 2016 at 5:48 PM, Andy Seaborne wrote: > > > On 15/07/16 15:15, Martynas Jusevičius wrote: >> >> >> >> I am afraid this code requires too much knowledge of OntModel inner >> workings, which I don't have. Calling loadImports() explicitly works >> as >> a >> workaround for me. >> >> Wouldn't the fix basically revert to the 2.11.0 code? It did not seem >> broken, so why was it "fixed" with RDFDataMgr in the first place? > > > > > Because old style RDFReaders now call RDFDataMgr but they can't get the > full > benefit of content negotiation. IIRC. > > In 2.11, conneg was weak to non-existent. > > A hybrid may be possible. > > Andy > > >> >> On Fri, 15 Jul 2016 at 12:40, Andy Seaborne wrote: >> >>> On 14/07/16 15:17, Martynas Jusevičius wrote: Should I open a Jira for this as well? Seems like a bug to me. >>> >>> >>> >>> >>> Yes. >>> >>> And a fix? >>> >>>Andy >>> >>> >> > >>> >
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
Martynas, This is the concurrency problem? Not JENA-1210 (imports) which happens with non-cyclic imports? Could you put a complete, minimal example for this please? It really does help to have them so that someone can know they are working on the problem reported. Otherwise, they spend a while just setting up the situation ... which takes a large chnuk of time ... which means it does not get done so soon. Andy On 22/07/16 18:07, Martynas Jusevičius wrote: These are 2 ontologies that import each other (gps: imports gp:): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gps.ttl https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gp.ttl Here is the location mapping (should cover all owl:imports from those 2 ontologies): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/location-mapping.n3 On Fri, Jul 15, 2016 at 10:01 PM, Andy Seabornewrote: Do you have some test files we can use? On 15/07/16 20:30, Martynas Jusevičius wrote: Created an issue: https://issues.apache.org/jira/browse/JENA-1210 On Fri, Jul 15, 2016 at 5:48 PM, Andy Seaborne wrote: On 15/07/16 15:15, Martynas Jusevičius wrote: I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? Because old style RDFReaders now call RDFDataMgr but they can't get the full benefit of content negotiation. IIRC. In 2.11, conneg was weak to non-existent. A hybrid may be possible. Andy On Fri, 15 Jul 2016 at 12:40, Andy Seaborne wrote: On 14/07/16 15:17, Martynas Jusevičius wrote: Should I open a Jira for this as well? Seems like a bug to me. Yes. And a fix? Andy
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
Is there a way to check whether imports already have been load for an OntModel? As to call loadImports() only once and avoid calling it with each OntModel access. On Thu, Jul 14, 2016 at 2:48 PM, Andy Seabornewrote: > On 13/07/16 22:33, Martynas Jusevičius wrote: >> >> Hey, >> >> I upgraded Jena from 2.11.0 to 3.0.1 and OntModel imports stopped >> working when getOntology() is called. >> >> I traced the problem to AdapterFileManager.readModelWorker(Model >> model, String filenameOrURI, String baseURI, String syntax), where >> >>model.read(in, baseURI, syntax) >> >> was at some point replaced with >> >>RDFDataMgr.read(model, mappedURI, baseURI, lang) >> >> and therefore OntModelImpl.read() doesn't get called, and >> OntModelImpl.loadImports() doesn't get called. >> >> Respective stacktraces provided below. Is there a workaround? > > > You could try calling loadImports on the OntModel from getOntology > > >> >> 3.0.1 >> >> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134) >> at >> org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:282) >> at org.apache.jena.util.FileManager.readModel(FileManager.java:341) >> at org.apache.jena.util.FileManager.readModel(FileManager.java:325) >> at >> org.apache.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1062) >> at >> org.apache.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:584) >> >> 2.11.0 >> >> >> com.hp.hpl.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1980) >> at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2250) >> at >> org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:302) >> at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:362) >> at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:346) >> at >> com.hp.hpl.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1063) >> at >> com.hp.hpl.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:585) >> >> >> Martynas >> atomgraph.com >> >
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
These are 2 ontologies that import each other (gps: imports gp:): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gps.ttl https://github.com/AtomGraph/Processor/blob/master/src/main/resources/org/graphity/processor/gp.ttl Here is the location mapping (should cover all owl:imports from those 2 ontologies): https://github.com/AtomGraph/Processor/blob/master/src/main/resources/location-mapping.n3 On Fri, Jul 15, 2016 at 10:01 PM, Andy Seabornewrote: > Do you have some test files we can use? > > > On 15/07/16 20:30, Martynas Jusevičius wrote: >> >> Created an issue: https://issues.apache.org/jira/browse/JENA-1210 >> >> On Fri, Jul 15, 2016 at 5:48 PM, Andy Seaborne wrote: >>> >>> On 15/07/16 15:15, Martynas Jusevičius wrote: I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? >>> >>> >>> >>> Because old style RDFReaders now call RDFDataMgr but they can't get the >>> full >>> benefit of content negotiation. IIRC. >>> >>> In 2.11, conneg was weak to non-existent. >>> >>> A hybrid may be possible. >>> >>> Andy >>> >>> On Fri, 15 Jul 2016 at 12:40, Andy Seaborne wrote: > On 14/07/16 15:17, Martynas Jusevičius wrote: >> >> >> Should I open a Jira for this as well? Seems like a bug to me. > > > > Yes. > > And a fix? > >Andy > > >>> >
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
Do you have some test files we can use? On 15/07/16 20:30, Martynas Jusevičius wrote: Created an issue: https://issues.apache.org/jira/browse/JENA-1210 On Fri, Jul 15, 2016 at 5:48 PM, Andy Seabornewrote: On 15/07/16 15:15, Martynas Jusevičius wrote: I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? Because old style RDFReaders now call RDFDataMgr but they can't get the full benefit of content negotiation. IIRC. In 2.11, conneg was weak to non-existent. A hybrid may be possible. Andy On Fri, 15 Jul 2016 at 12:40, Andy Seaborne wrote: On 14/07/16 15:17, Martynas Jusevičius wrote: Should I open a Jira for this as well? Seems like a bug to me. Yes. And a fix? Andy
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
On 15/07/16 15:15, Martynas Jusevičius wrote: I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? Because old style RDFReaders now call RDFDataMgr but they can't get the full benefit of content negotiation. IIRC. In 2.11, conneg was weak to non-existent. A hybrid may be possible. Andy On Fri, 15 Jul 2016 at 12:40, Andy Seabornewrote: On 14/07/16 15:17, Martynas Jusevičius wrote: Should I open a Jira for this as well? Seems like a bug to me. Yes. And a fix? Andy
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
I am afraid this code requires too much knowledge of OntModel inner workings, which I don't have. Calling loadImports() explicitly works as a workaround for me. Wouldn't the fix basically revert to the 2.11.0 code? It did not seem broken, so why was it "fixed" with RDFDataMgr in the first place? On Fri, 15 Jul 2016 at 12:40, Andy Seabornewrote: > On 14/07/16 15:17, Martynas Jusevičius wrote: > > Should I open a Jira for this as well? Seems like a bug to me. > > Yes. > > And a fix? > > Andy > >
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
On 14/07/16 15:17, Martynas Jusevičius wrote: Should I open a Jira for this as well? Seems like a bug to me. Yes. And a fix? Andy
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
Should I open a Jira for this as well? Seems like a bug to me. On Thu, 14 Jul 2016 at 15:48, Andy Seabornewrote: > On 13/07/16 22:33, Martynas Jusevičius wrote: > > Hey, > > > > I upgraded Jena from 2.11.0 to 3.0.1 and OntModel imports stopped > > working when getOntology() is called. > > > > I traced the problem to AdapterFileManager.readModelWorker(Model > > model, String filenameOrURI, String baseURI, String syntax), where > > > >model.read(in, baseURI, syntax) > > > > was at some point replaced with > > > >RDFDataMgr.read(model, mappedURI, baseURI, lang) > > > > and therefore OntModelImpl.read() doesn't get called, and > > OntModelImpl.loadImports() doesn't get called. > > > > Respective stacktraces provided below. Is there a workaround? > > You could try calling loadImports on the OntModel from getOntology > > > > > 3.0.1 > > > > at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134) > > at > org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:282) > > at org.apache.jena.util.FileManager.readModel(FileManager.java:341) > > at org.apache.jena.util.FileManager.readModel(FileManager.java:325) > > at > org.apache.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1062) > > at > org.apache.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:584) > > > > 2.11.0 > > > > > com.hp.hpl.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1980) > > at > com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2250) > > at > org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:302) > > at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:362) > > at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:346) > > at > com.hp.hpl.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1063) > > at > com.hp.hpl.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:585) > > > > > > Martynas > > atomgraph.com > > > >
Re: OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
On 13/07/16 22:33, Martynas Jusevičius wrote: Hey, I upgraded Jena from 2.11.0 to 3.0.1 and OntModel imports stopped working when getOntology() is called. I traced the problem to AdapterFileManager.readModelWorker(Model model, String filenameOrURI, String baseURI, String syntax), where model.read(in, baseURI, syntax) was at some point replaced with RDFDataMgr.read(model, mappedURI, baseURI, lang) and therefore OntModelImpl.read() doesn't get called, and OntModelImpl.loadImports() doesn't get called. Respective stacktraces provided below. Is there a workaround? You could try calling loadImports on the OntModel from getOntology 3.0.1 at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134) at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:282) at org.apache.jena.util.FileManager.readModel(FileManager.java:341) at org.apache.jena.util.FileManager.readModel(FileManager.java:325) at org.apache.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1062) at org.apache.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:584) 2.11.0 com.hp.hpl.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1980) at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2250) at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:302) at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:362) at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:346) at com.hp.hpl.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1063) at com.hp.hpl.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:585) Martynas atomgraph.com
OntModel imports not loaded (2.11.0 behavior broken in 3.0.1)
Hey, I upgraded Jena from 2.11.0 to 3.0.1 and OntModel imports stopped working when getOntology() is called. I traced the problem to AdapterFileManager.readModelWorker(Model model, String filenameOrURI, String baseURI, String syntax), where model.read(in, baseURI, syntax) was at some point replaced with RDFDataMgr.read(model, mappedURI, baseURI, lang) and therefore OntModelImpl.read() doesn't get called, and OntModelImpl.loadImports() doesn't get called. Respective stacktraces provided below. Is there a workaround? 3.0.1 at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134) at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:282) at org.apache.jena.util.FileManager.readModel(FileManager.java:341) at org.apache.jena.util.FileManager.readModel(FileManager.java:325) at org.apache.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1062) at org.apache.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:584) 2.11.0 com.hp.hpl.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1980) at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2250) at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:302) at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:362) at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:346) at com.hp.hpl.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1063) at com.hp.hpl.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:585) Martynas atomgraph.com