Here is the stack: java.lang.reflect.InvocationTargetException at org.topbraidcomposer.core.io.TBCIO$1.run(TBCIO.java:367) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Caused by: java.lang.NullPointerException at org.topbraid.tables.model.jxl.ExcelImportTableModel.getSheetName(ExcelImportTableModel.java:264) at org.topbraid.tables.importer.TableImporter.importSheet(TableImporter.java:147) at org.topbraid.tables.importer.TableImporter.<init>(TableImporter.java:49) at org.topbraid.tables.model.TableGraphStore.load(TableGraphStore.java:68) at org.topbraid.tables.model.jxl.ExcelGraphStore.load(ExcelGraphStore.java:26) at org.topbraid.core.registry.IFileGraphSource.loadSpecialGraph(IFileGraphSource.java:46) at org.topbraid.core.registry.GraphSource.loadGraph(GraphSource.java:89) at org.topbraid.core.io.IO.load(IO.java:314) at org.topbraidcomposer.core.io.TBCIO.loadModel(TBCIO.java:226) at org.topbraidcomposer.core.io.TBCIO.loadModel(TBCIO.java:257) at org.topbraidcomposer.core.io.TBCIO$1$1.run(TBCIO.java:298) at java.lang.Thread.run(Thread.java:619) Root exception: java.lang.NullPointerException at org.topbraid.tables.model.jxl.ExcelImportTableModel.getSheetName(ExcelImportTableModel.java:264) at org.topbraid.tables.importer.TableImporter.importSheet(TableImporter.java:147) at org.topbraid.tables.importer.TableImporter.<init>(TableImporter.java:49) at org.topbraid.tables.model.TableGraphStore.load(TableGraphStore.java:68) at org.topbraid.tables.model.jxl.ExcelGraphStore.load(ExcelGraphStore.java:26) at org.topbraid.core.registry.IFileGraphSource.loadSpecialGraph(IFileGraphSource.java:46) at org.topbraid.core.registry.GraphSource.loadGraph(GraphSource.java:89) at org.topbraid.core.io.IO.load(IO.java:314) at org.topbraidcomposer.core.io.TBCIO.loadModel(TBCIO.java:226) at org.topbraidcomposer.core.io.TBCIO.loadModel(TBCIO.java:257) at org.topbraidcomposer.core.io.TBCIO$1$1.run(TBCIO.java:298) at java.lang.Thread.run(Thread.java:619)
On Mon, Mar 8, 2010 at 12:21 PM, Holger Knublauch <[email protected]>wrote: > Hi Gerrick, > > if you receive a NullPointerException then this is where we need to drill > down. You shouldn't. Could you please send me the complete stack trace > (usually double-clicking on the entry in the Error Log) or any other > information that helps us understand whether there is a bug in our code or > in the SM scripts? > > Thanks, > Holger > > > On Mar 8, 2010, at 10:18 AM, Gerrick Bivins wrote: > > Hi Scott, > The problem I'm facing is that the workbook I have fails to import (Null > Pointer Exception is thrown) using the "tables" ontology via > ImportRDFFromWorkspace. The only way to load it, is to use > the sml:ImportExcelCellInstances which creates the "ss" (spreadsheet?) > ontology. So then adding to it and then exporting back to it would require > converting the ss ontology to the tables ontology, I think...Am I on the > right path? > > Gerrick > > On Mon, Mar 8, 2010 at 8:35 AM, Scott Henninger < > [email protected]> wrote: > >> Gerrick; The .xls importer will read in any Excel 2003 file. The >> importer will convert any .xls file to an ontology. New rows can be >> added using the properties (columns) and classes (worksheets) defined >> in the importer. To add new worksheets and columns, you simply need >> to define the classes and properties to be instances of the >> spreadsheet model. There is more at Help > Import and Export > >> Importing, Querying, Saving Table documents with Semantic Tables >> >> <ounds like this type of round tripping wouldn't work for a sheet that >> doesn't define ontologies> >> >> See above, the importer defines the ontology. >> >> <using sml:ImportExcelCellInstances> >> >> Use ImportRDFFromWorkspace and specify a .xls file. This imports >> (creates an ontology from the spreadsheet) exactly like opening a >> spreadsheet in the Navigator. >> >> -- Scott >> >> >> On Mar 8, 8:20 am, Gerrick Bivins <[email protected]> wrote: >> > Thanks all, >> > I got this to work. The problem was the columnIndex. Once I assigned >> that in >> > my construct statement, things worked. >> > >> > Sounds like this type of round tripping wouldn't work for a sheet that >> > doesn't define ontologies, ie must be read in >> > using sml:ImportExcelCellInstances. >> > Is that correct? >> > Gerrick >> > >> > On Sun, Mar 7, 2010 at 5:53 PM, Gerrick Bivins <[email protected]> >> wrote: >> > > Hi Holger, >> > > Thanks for the input. Here is what my construct query currently looks >> like >> > > in my script (just after import of the sheet that defines the >> ontology) >> > > CONSTRUCT >> > > { >> > > ?p a ?sheetTemplateClass. >> > > ?p ?sheetTemplateDate ?date. >> > > ?p ?sheetTemplateRandomText ?randomText . >> > > ?p tables:rowIndex ?rowIndex . >> > > } >> > > WHERE >> > > { >> > > ?sheet tables:sheetIndex 0. //get the namespace of the imported >> sheet >> > > LET(?ns :=afn:namespace(?sheet)). >> > > LET(?sheetTemplateClass :=smf:buildURI("{?ns}class"). >> > > LET(?sheetTemplateDate :=smf:buildURI("{?ns}date"). >> > > LET(?sheetTemplateRandomText :=smf:buildURI("{?ns}randomText"). >> > >> > > //translate properties from external model to sheets ontology >> > > ?otherModel a :OtherModel . >> > > ?otherModel :otherModelDate ?date . >> > > ?otherModel :otherModelCommentText ?randomText . >> > > ?otherModel :otherModelCount ?rowIndex . >> > >> > > LET(?p :=smf:buildURI("{?ns}Row0-{?rowIndex}")). >> > > } >> > >> > > From what you've described, it sounds like the thing I'm missing in my >> > > construct query is the assigning of columnIndex to the properties. Is >> that >> > > correct? >> > > Gerrick >> > >> > > On Sun, Mar 7, 2010 at 5:17 PM, Holger Knublauch < >> [email protected]>wrote: >> > >> > >> Hi Gerrick, >> > >> > >> the easiest way to understand this mechanism to look at how TopBraid >> > >> Composer opens an existing .xls file. Right click on it in the >> Navigator and >> > >> Open with TopBraid. You will see that each page of Excel file becomes >> one >> > >> class. Each row becomes one instance of that class. Those instances >> store >> > >> their row number in a property called tables:rowIndex. The instances >> also >> > >> have property values for each column. The properties contain a >> backward >> > >> reference to the number of the column they represent, using >> > >> tables:columnIndex. >> > >> > >> This metadata helps the Semantic Tables engine to round-trip between >> Excel >> > >> and RDF files. In order to create such an Excel file from scratch, >> you need >> > >> to simulate this structure, and create appropriate instances with >> > >> appropriate rowIndex and properties with appropriate columnIndex >> values. >> > >> > >> Regards >> > >> Holger >> > >> > >> On Mar 7, 2010, at 11:54 AM, Gerrick Bivins wrote: >> > >> > >> Hi Irene, >> > >> Seems like I'm missing a step... If I understand what you've describe >> > >> below, this creates the sheet but doesn't fill it in with data. >> > >> I can use a query to get the data to push into the sheet but I'm not >> > >> seeing the connection of turning a row of query results into a row >> > >> in the sheet. >> > >> Gerrick >> > >> > >> On Sat, Mar 6, 2010 at 8:48 PM, Irene Polikoff < >> [email protected]>wrote: >> > >> > >>> Gerrick, >> > >> > >>> Create a new class. Let's call it myspreadsheet:NewWorksheet where >> > >>> myspreadsheet is the name of your Excel file. When you opened the >> Excel >> > >>> file >> > >>> in TBC, the file name was used to create a namespace prefix. You >> will see >> > >>> it >> > >>> if you look at the class (or classes) that were created. >> > >> > >>> Now add the following triple: >> > >> > >>> myspreadsheet:NewWorksheet tables:sheetIndex "1" >> > >> > >>> Or, if your original spreadsheet had more than one worksheet, put N >> > >>> instead >> > >>> of 1, where N = the number of the pre-existing worksheets. This will >> > >>> create >> > >>> a new worksheet. >> > >> > >>> To save it use sml:ExportToRDFFile module. It will create a new file >> at >> > >>> the >> > >>> specified path inside the workspace. The serialization is derived >> from >> > >>> the >> > >>> file name according to TopBraid's conventions, e.g. files ending >> with >> > >>> .xls >> > >>> will be written as Excel files. >> > >> > >>> Irene >> > >> > >>> -----Original Message----- >> > >>> From: [email protected] >> > >>> [mailto:[email protected]] On Behalf Of gbiv >> > >>> Sent: Saturday, March 06, 2010 2:14 PM >> > >>> To: TopBraid Composer Users >> > >>> Subject: [tbc-users] Round Tripping XLS >> > >> > >>> Hello All, >> > >>> I'm trying to create a SPARQL motion script to do the following: >> > >>> 1)Open an rdf file in the workspace >> > >>> 2)Open an excel workbook >> > >>> 3)Add class information from the rdf file to a new sheet in the work >> > >>> book >> > >>> 4)Save the workbook >> > >> > >>> So far 1 and 2 are not a problem but I can't seem to find the >> > >>> information to add a sheet to the workbook and then save a file as a >> > >>> xls. >> > >> > >>> Any pointers? >> > >>> Gerrick >> > >> > >>> -- >> > >>> You received this message because you are subscribed to the Google >> Groups >> > >>> "TopBraid Composer Users" group. >> > >>> To post to this group, send email to >> > >>> [email protected]. >> > >>> To unsubscribe from this group, send email to >> > >>> [email protected]<topbraid-composer-users%[email protected]> >> <topbraid-composer-users%[email protected]<topbraid-composer-users%[email protected]> >> > >> > >>> . >> > >>> For more options, visit this group at >> > >>>http://groups.google.com/group/topbraid-composer-users?hl=en. >> > >> > >>> -- >> > >>> You received this message because you are subscribed to the Google >> Groups >> > >>> "TopBraid Composer Users" group. >> > >>> To post to this group, send email to >> > >>> [email protected]. >> > >>> To unsubscribe from this group, send email to >> > >>> [email protected]<topbraid-composer-users%[email protected]> >> <topbraid-composer-users%[email protected]<topbraid-composer-users%[email protected]> >> > >> > >>> . >> > >>> For more options, visit this group at >> > >>>http://groups.google.com/group/topbraid-composer-users?hl=en. >> > >> > >> -- >> > >> You received this message because you are subscribed to the Google >> Groups >> > >> "TopBraid Composer Users" group. >> > >> To post to this group, send email to >> > >> [email protected]. >> > >> To unsubscribe from this group, send email to >> > >> [email protected]<topbraid-composer-users%[email protected]> >> . >> > >> For more options, visit this group at >> > >>http://groups.google.com/group/topbraid-composer-users?hl=en. >> > >> > >> -- >> > >> You received this message because you are subscribed to the Google >> Groups >> > >> "TopBraid Composer Users" group. >> > >> To post to this group, send email to >> > >> [email protected]. >> > >> To unsubscribe from this group, send email to >> > >> [email protected]<topbraid-composer-users%[email protected]> >> <topbraid-composer-users%[email protected]<topbraid-composer-users%[email protected]> >> > >> > >> . >> > >> For more options, visit this group at >> > >>http://groups.google.com/group/topbraid-composer-users?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "TopBraid Composer Users" group. >> To post to this group, send email to >> [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<topbraid-composer-users%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/topbraid-composer-users?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups > "TopBraid Composer Users" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/topbraid-composer-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "TopBraid Composer Users" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<topbraid-composer-users%[email protected]> > . > > For more options, visit this group at > http://groups.google.com/group/topbraid-composer-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "TopBraid Composer Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/topbraid-composer-users?hl=en.
