From steffen.ryll at student.hpi.uni-potsdam.de Mon Jul 7 12:09:45 2008 From: steffen.ryll at student.hpi.uni-potsdam.de (Steffen Ryll) Date: Mon, 07 Jul 2008 12:09:45 +0200 Subject: [Rdf2go-devel] [Patch] Jena model implementation's readFrom(Reader) Message-ID: <4871EB69.1080307@student.hpi.uni-potsdam.de> Hi all, I discovered a problem recently, when using RDF2Go's Jena backend. When you pass a Reader and a base URI to readFrom(), it ignored the baseURI, and the underlying Jena classes complained heavily. For clarification: This call works smoothly, where rdfStream is an InputStream: this.rdfModel.readFrom(rdfStream, Syntax.RdfXml, baseURI); But, this call makes Jena complain about an empty namespace: this.rdfModel.readFrom(rdfReader, Syntax.RdfXml, baseURI); I've attached a patch that fixes this issue. I wasn't sure how your test cases are structured, nor how I could test this problem. The only manifestation was log messages from Jena... Cheers, Steffen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: readFrom-baseURI.patch Url: http://ontoware.org/pipermail/rdf2go-devel/attachments/20080707/fe7140f8/attachment-0001.ksh From mariusz.cygan at deri.org Mon Jul 21 11:50:40 2008 From: mariusz.cygan at deri.org (Mariusz Cygan) Date: Mon, 21 Jul 2008 10:50:40 +0100 Subject: [Rdf2go-devel] adding two models Message-ID: <48845BF0.9080705@deri.org> Hi, I was investigating Model.addModel(Model) implementation in the AbstractModel class. /** subclasses should overwrite this for performance reasons */ public void addModel(Model model) { ClosableIterator it = model.iterator(); Set statements = new HashSet(); while (it.hasNext()) { Statement stmt = it.next(); statements.add(stmt); } it.close(); for( Statement stmt : statements) { this.addStatement( stmt.getSubject(), stmt.getPredicate(), stmt.getObject()); } } In the Sesame plugin implementation it takes a lot of time to add two models because every addStatement is a separate transaction. The comments suggest though to use Model.addAll(Iterator). Don't you think it would be a good idea to rewrite the addModel in the abstract implementation or at least override this method in Sesame plugin? Best, -- Mariusz Cygan Research Assistant, DERI National University of Ireland, Galway From gunnar.grimnes at dfki.de Mon Jul 21 13:05:13 2008 From: gunnar.grimnes at dfki.de (Gunnar Aastrand Grimnes) Date: Mon, 21 Jul 2008 13:05:13 +0200 Subject: [Rdf2go-devel] adding two models In-Reply-To: <48845BF0.9080705@deri.org> References: <48845BF0.9080705@deri.org> Message-ID: <48846D69.2070003@dfki.de> This method is strangely awkward. I guess the reason is that you want to be able to have do this: ModelSet ms= ... m1=ms.getModel(uri1); m2=ms.getModel(uri2); m2.addModel(m1); and this strange caching of all statements in a hashset is required for some implementations not to deadlock? Anyway - this special case should be detectable by the implementation and handled separately. Have you checked if the sesame plugin does not override this method? If not can you try to write such a method? :) Cheers, - Gunnar Mariusz Cygan wrote: > Hi, > > I was investigating Model.addModel(Model) implementation in the > AbstractModel class. > > /** subclasses should overwrite this for performance reasons */ > public void addModel(Model model) { > ClosableIterator it = model.iterator(); > Set statements = new HashSet(); > while (it.hasNext()) { > Statement stmt = it.next(); > statements.add(stmt); > } > it.close(); > for( Statement stmt : statements) { > this.addStatement( stmt.getSubject(), stmt.getPredicate(), > stmt.getObject()); > } > } > > In the Sesame plugin implementation it takes a lot of time to add two > models because every addStatement is a separate transaction. The > comments suggest though to use Model.addAll(Iterator). Don't you think > it would be a good idea to rewrite the addModel in the abstract > implementation or at least override this method in Sesame plugin? > > Best, > From mariusz.cygan at deri.org Mon Jul 21 13:16:30 2008 From: mariusz.cygan at deri.org (Mariusz Cygan) Date: Mon, 21 Jul 2008 12:16:30 +0100 Subject: [Rdf2go-devel] adding two models In-Reply-To: <48846D69.2070003@dfki.de> References: <48845BF0.9080705@deri.org> <48846D69.2070003@dfki.de> Message-ID: <4884700E.30004@deri.org> /** * Implementation of the RDF2Go model interface for an OpenRDF Repository. * * Note that RepositoryModel and RepositoryModelSet only work well together * because they both keep their RepositoryConnections in auto-commit mode. This * cannot be changed by the user. Do mass-updates using {@link #update(Diff)}, * {@link #addAll(Iterator)} or {@link #removeAll(Iterator)}, then the current * connection will be used in non-autocommit mode and commited, including a * rollback when it fails. */ public class RepositoryModel extends AbstractLockingModel implements Model { The sesame plugin doesn't override the addModel method. Of course I can use model.addAll(model.iterator()) as it is done in one transaction and is much faster. As for now I'm not using any ModelSets. I should be able to find some time and fix this in sesame patch, but I was thinking that maybe it would be better if you rewrite the addModel in AbstractModel using model.addAll(model.iterator()). Cheers, Mariusz Cygan Research Assistant, DERI National University of Ireland, Galway Gunnar Aastrand Grimnes wrote: > This method is strangely awkward. I guess the reason is that you want to > be able to have do this: > > ModelSet ms= ... > > m1=ms.getModel(uri1); > > m2=ms.getModel(uri2); > > m2.addModel(m1); > > and this strange caching of all statements in a hashset is required for > some implementations not to deadlock? > > Anyway - this special case should be detectable by the implementation > and handled separately. > > Have you checked if the sesame plugin does not override this method? > > If not can you try to write such a method? :) > > Cheers, > > - Gunnar > > Mariusz Cygan wrote: >> Hi, >> >> I was investigating Model.addModel(Model) implementation in the >> AbstractModel class. >> >> /** subclasses should overwrite this for performance reasons */ >> public void addModel(Model model) { >> ClosableIterator it = model.iterator(); >> Set statements = new HashSet(); >> while (it.hasNext()) { >> Statement stmt = it.next(); >> statements.add(stmt); >> } >> it.close(); >> for( Statement stmt : statements) { >> this.addStatement( stmt.getSubject(), stmt.getPredicate(), >> stmt.getObject()); >> } >> } >> >> In the Sesame plugin implementation it takes a lot of time to add two >> models because every addStatement is a separate transaction. The >> comments suggest though to use Model.addAll(Iterator). Don't you think >> it would be a good idea to rewrite the addModel in the abstract >> implementation or at least override this method in Sesame plugin? >> >> Best, >> From voelkel at fzi.de Tue Jul 22 14:59:01 2008 From: voelkel at fzi.de (Max Voelkel) Date: Tue, 22 Jul 2008 14:59:01 +0200 Subject: [Rdf2go-devel] RDFTool and SimpleDataFormat Message-ID: <1157399385.20080722145901@fzi.de> Hi, today is RDF2Go clean-up day. I stumbled over a very old email from Grant Ingersoll . He noticed that RDFTool (maintained by Leo) has an issue with Threads and SimpleDataFormat. I was surprised and Googled, until I found a huge heated debate about just how bad SimpleDataFormat is. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4228335 The discussion seems to conclude, that there is no good fix in general an the solution from Grant (using ThreadLocal) was also discouraged by some. Now I am overwhelmed around the complexity of the issue (has nothing to do with RDF at all). Leo, Grant can you help to resolve & explain the issue? Grants proposal in brief: 1) private static DateFormat dateTimeFormat = null; --> private static ThreadLocal dateTimeFormatTL = new ThreadLocal(); 2) public static DateFormat getDateFormat() { if (dateFormat == null) { dateFormat = new SimpleDateFormat("yyyy-MM-dd"); } return dateFormat; } --> public static DateFormat getDateFormat() { DateFormat dateFormat = dateFormatTL.get(); if (dateFormat == null) { dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormatTL.set(dateFormat); } return dateFormat; } Lots more infos are here http://blogs.atlassian.com/developer/2007/07/dateformat_objects_and_threads.html Btw, the current code of the class is here http://semweb4j.googlecode.com/svn/trunk/org.semweb4j.rdf2go.impl.util/src/main/java/org/ontoware/rdf2go/util/RDFTool.java There are so many options, which way should we go? Does using ThreadLocals solves all problems you have, Grant? Kind Regards, Max -- Max V?lkel voelkel at fzi.de | www.Xam.de office +49 721 96 54-854 mobile +49 171 83 59 678 -- FZI Forschungszentrum Informatik an der Universit?t Karlsruhe Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe Tel.: +49-721-9654-0, Fax: +49-721-9654-959 Stiftung des b?rgerlichen Rechts, Az: 14-0563.1 Regierungspr?sidium Karlsruhe. Vorstand: Prof. Dr.-Ing. R?diger Dillmann, Dipl. Wi.-Ing. Michael Flor Prof. Dr. Dr.-Ing. Jivka Ovtcharova, Prof. Dr. rer. nat. Rudi Studer Vorsitzender des Kuratoriums: Ministerialdirigent G?nther Le?nerkraus From leo.sauermann at dfki.de Tue Jul 22 15:12:15 2008 From: leo.sauermann at dfki.de (Leo Sauermann) Date: Tue, 22 Jul 2008 15:12:15 +0200 Subject: [Rdf2go-devel] RDFTool and SimpleDataFormat In-Reply-To: <1157399385.20080722145901@fzi.de> References: <1157399385.20080722145901@fzi.de> Message-ID: <4885DCAF.6000705@dfki.de> It was Max Voelkel who said at the right time 22.07.2008 14:59 the following words: > Hi, today is RDF2Go clean-up day. I stumbled over a very old email from Grant > Ingersoll . > > He noticed that RDFTool (maintained by Leo) has an issue with Threads and > SimpleDataFormat. I was surprised and Googled, until I found a huge heated > debate about just how bad SimpleDataFormat is. > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4228335 > > The discussion seems to conclude, that there is no good fix in general an the > solution from Grant (using ThreadLocal) was also discouraged by some. > Now I am overwhelmed around the complexity of the issue (has nothing to do with > RDF at all). > > Leo, Grant can you help to resolve & explain the issue? > > Grants proposal in brief: > > 1) > private static DateFormat dateTimeFormat = null; > --> > private static ThreadLocal dateTimeFormatTL = new ThreadLocal(); > > 2) > > public static DateFormat getDateFormat() { > if (dateFormat == null) { > dateFormat = new SimpleDateFormat("yyyy-MM-dd"); > } > return dateFormat; > } > --> > public static DateFormat getDateFormat() { > DateFormat dateFormat = dateFormatTL.get(); > if (dateFormat == null) { > dateFormat = new SimpleDateFormat("yyyy-MM-dd"); > dateFormatTL.set(dateFormat); > } > return dateFormat; > } > > Lots more infos are here > http://blogs.atlassian.com/developer/2007/07/dateformat_objects_and_threads.html > > > Btw, the current code of the class is here > http://semweb4j.googlecode.com/svn/trunk/org.semweb4j.rdf2go.impl.util/src/main/java/org/ontoware/rdf2go/util/RDFTool.java > > There are so many options, which way should we go? > Does using ThreadLocals solves all problems you have, Grant? > I think ThreadLocal is ok. it leaves a bit of clutter at the end, but who cares.... best Leo > Kind Regards, > Max > -- > Max V?lkel > voelkel at fzi.de | www.Xam.de > office +49 721 96 54-854 > mobile +49 171 83 59 678 > -- > FZI Forschungszentrum Informatik an der Universit?t Karlsruhe > Haid-und-Neu-Str. 10-14, D-76131 Karlsruhe > Tel.: +49-721-9654-0, Fax: +49-721-9654-959 > Stiftung des b?rgerlichen Rechts, Az: 14-0563.1 Regierungspr?sidium Karlsruhe. > Vorstand: Prof. Dr.-Ing. R?diger Dillmann, Dipl. Wi.-Ing. Michael Flor > Prof. Dr. Dr.-Ing. Jivka Ovtcharova, Prof. Dr. rer. nat. Rudi Studer > Vorsitzender des Kuratoriums: Ministerialdirigent G?nther Le?nerkraus > > > -- ____________________________________________________ DI Leo Sauermann http://www.dfki.de/~sauermann Deutsches Forschungszentrum fuer Kuenstliche Intelligenz DFKI GmbH Trippstadter Strasse 122 P.O. Box 2080 Fon: +49 631 20575-116 D-67663 Kaiserslautern Fax: +49 631 20575-102 Germany Mail: leo.sauermann at dfki.de Geschaeftsfuehrung: Prof.Dr.Dr.h.c.mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes Amtsgericht Kaiserslautern, HRB 2313 ____________________________________________________ From mariusz.cygan at deri.org Thu Jul 24 14:15:24 2008 From: mariusz.cygan at deri.org (Mariusz Cygan) Date: Thu, 24 Jul 2008 13:15:24 +0100 Subject: [Rdf2go-devel] Fwd: JIRA [keks] Commented: (RTGO-53) Sesame ModelSet should support other query languages In-Reply-To: <57aa22380807220919p3895433cte50a2935f8d0d8d5@mail.gmail.com> References: <28331719.1216737671851.JavaMail.SYSTEM@octopus13> <18567634.1216737791351.JavaMail.SYSTEM@octopus13> <57aa22380807220919p3895433cte50a2935f8d0d8d5@mail.gmail.com> Message-ID: <4888725C.3000904@deri.org> What do you mean by 'This cannot be fixed on the level ob AbstractModels. ' ? Mariusz Cygan Research Assistant, DERI National University of Ireland, Galway Sebastian Kruk wrote: > ---------- Forwarded message ---------- > From: "Max V?lkel (JIRA)" > Date: Tue, 22 Jul 2008 16:43:11 +0200 (CEST) > Subject: JIRA [keks] Commented: (RTGO-53) Sesame ModelSet should > support other query languages > To: Sebastian, Kruk, sebastian.kruk at gmail.com > > > [ > http://octopus13.fzi.de:8080/browse/RTGO-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12015 > ] > > Max V?lkel commented on RTGO-53: > -------------------------------- > > This cannot be fixed on the level ob AbstractModels. > > > Sesame ModelSet should support other query languages > > ---------------------------------------------------- > > > > Key: RTGO-53 > > URL: http://octopus13.fzi.de:8080/browse/RTGO-53 > > Project: RDF2Go > > Issue Type: Improvement > > Affects Versions: 4.6.* > > Reporter: Sebastian Kruk > > Assignee: Max V?lkel > > Priority: Minor > > Fix For: 4.6.* > > > > > > I got > > org.ontoware.rdf2go.exception.QueryLanguageNotSupportedException: > > Unsupported query language: SeRQL ... see developer mailing list > > -- > This message is automatically generated by JIRA. > - > If you think it was sent incorrectly contact one of the > administrators: > http://octopus13.fzi.de:8080/secure/Administrators.jspa > - > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > > > > -- > -- > -------------------------------------------- > -- Sebastian Ryszard Kruk > -- Lead Researcher, Project Manager > -- Digital Enterprise Research Institute > -- National University of Ireland, Galway > -- mailto: sebastian.kruk at gmail.com > -- GG: 335067, Jabber: sebastian.kruk at gmail.com > -- Skype: sebastiankruk > -- WWW: http://www.sebastiankruk.com/ > -- mobile (IRL): +353 85 7126591 > -- VoIP (PL): +48 52 5110114 > -------------------------------------------- > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google > Groups "Corrib Clan" group. > To post to this group, send email to corrib at googlegroups.com > To unsubscribe from this group, send email to > corrib-unsubscribe at googlegroups.com > For more options, visit this group at > http://groups.google.com/group/corrib?hl=en > -~----------~----~----~----~------~----~------~--~--- > From venkatesh88 at gmail.com Thu Jul 31 12:15:43 2008 From: venkatesh88 at gmail.com (Venkatesh Nandakumar) Date: Thu, 31 Jul 2008 12:15:43 +0200 Subject: [Rdf2go-devel] Validation in RDF2GO Message-ID: <4986ffac0807310315l2fad751cyc36f3cdf02b0bbae@mail.gmail.com> Hi, I'm pretty new to RDF2G0... I wanted to know if there is some abstraction that you have made in the lines of ValidityReport of Jena, for RDFS Reasoner? Or is there any other way to do it? My aim is to feed into the RDF2G0 model an rdf interpretation of the CommonWikiSyntax and find if it is Valid. Thanking you, Venkatesh Nandakumar