You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jim Reilly <ja...@yahoo.com> on 2012/04/13 15:26:55 UTC

Loading OWL and TDB


I have been trying to load an OWL doc into TDB and get an error when I query the DB after a JVM restart.


My load() method works, meaning the printAllQuery() shows the results.
But, when the JVM ends, and I re-start it, by just calling the  printAllQuery(), it gives me this error:
java.lang.NullPointerException at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.readPrefixMap(DatasetPrefixesTDB.java:175) at com.hp.hpl.jena.sparql.graph.GraphPrefixesProjection.getNsPrefixMap(GraphPrefixesProjection.java:62) at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:224) at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:215) at com.hp.hpl.jena.tdb.store.GraphTriplesTDB.createPrefixMapping(GraphTriplesTDB.java:99) at com.hp.hpl.jena.sparql.graph.GraphBase2.getPrefixMapping(GraphBase2.java:194) at com.hp.hpl.jena.rdf.model.impl.ModelCom.getPrefixMapping(ModelCom.java:908) at com.hp.hpl.jena.rdf.model.impl.ModelCom.withDefaultMappings(ModelCom.java:952) at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:66) at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:62) at com.hp.hpl.jena.rdf.model.ModelFactory.createModelForGraph(ModelFactory.java:166)
 at com.hp.hpl.jena.sparql.core.DatasetImpl.graph2model(DatasetImpl.java:268) at com.hp.hpl.jena.sparql.core.DatasetImpl.getDefaultModel(DatasetImpl.java:104)


So, is loading the OWL into memory and loading into TDB done differently somehow...????


Also note, my prefixes.dat is empty.



Here is the shortened method I've been using to test:

   public void load()
  {
    Dataset dataset = TDBFactory.assembleDataset("air-tdb-assembler.ttl");
    Model model = dataset.getDefaultModel();
    OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RDFS_INF, model);
    TDBLoader.loadModel(model, "file:src/test/resources/time.owl");

    printAllQuery();
  }

 public void printAllQuery()
  {
    try
    {
      Query ALL_QUERY = QueryFactory.create("SELECT * {?s ?p ?o}");
      QueryExecution qExec = QueryExecutionFactory.create(ALL_QUERY, dataset);
      ResultSet rs = qExec.execSelect();
      try
      {
        ResultSetFormatter.out(rs);
      }
      finally
      {
        qExec.close();
      }
    }
    finally
    {
      // dataset.end(); // declares the end of the read transaction
    }
  }


air-tdb-assembler.ttl:
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model      .

<#dataset> rdf:type         tdb:DatasetTDB ;
    tdb:location "target/jenaDatabase/jenaDS" ;
    .


 
Tkx,
Jim

Re: Loading OWL and TDB

Posted by Andy Seaborne <an...@apache.org>.
On 19/04/12 15:51, Jim Reilly wrote:
> Andy,
>
> I found the solution this morning...:
>
> use:   datasetGraphTDB.sync(); instead of:   TDB.sync(dataset) ;

Fixed.

> where the datasetGraphTDB was from the DatasetGraphTransaction that
> was from the Dataset, and that seemed to work (see code below, init()
> method for reference, if interested.).
>
> For reference only:
>
> I am just writing a simple JenaDAO class and a JeneDAOTest junit test
> for ... testing my methods.. ;-) Nothing too complicated...
>
> So, between test runs, I would (or would NOT) run a maven clean that
> would delete my TDB DB, thus allowing me the test over JVM restarts,
> all from a Win/DOS cmd line... (using maven).  I was only add 1
> Statement, stopping, and then querying...
>
>
> I'm running in Winblows 7,  don't have cygwin installed, so can't run
> the tdbquery...  [I would have just for reference for ya...] But, per
> maven, and clean compile and install, get the latest versions....
>
>
>
> Is there any thoughts of writing equivalent windows .bat scripts for
> those unix scripts...?   (or an  Ant script that would work on both
> OS's...?)?

Sure - but better if a windows person contributes them, not being a 
Windows user at the moment.

https://svn.apache.org/repos/asf/incubator/jena/Jena2/JenaZip/trunk/bat/sparql.bat

was my attempt at short notice for a command script.

If you are using Fuseki, a trick is:

java -jar fuseki-server.jar tdb.tdbloader ...

or

java -jar 'TDBInstallDir\lib\*;' tdb.tdbloader ...

(windows needs the trailing ";" for some reason, Linux does not need a ":").

	Andy

>
>
> Thanks for the help, much appreciated!!!
>
>
> Tkx, Jim
>
>
>
> private void init() { String assemblerFile = "tdb-assembler.ttl";
> dataset = TDBFactory.assembleDataset(assemblerFile); model =
> dataset.getDefaultModel(); DatasetGraphTransaction dst =
> (DatasetGraphTransaction) dataset.asDatasetGraph(); datasetGraphTDB =
> dst.getBaseDatasetGraph(); fileMgr = FileManager.get();
> fileMgr.addLocatorClassLoader(JenaDAO.class.getClassLoader()); }
>
>
> public void addStatement(Statement statement) {
> model.add(statement); datasetGraphTDB.sync(); }

Re: Loading OWL and TDB

Posted by Jim Reilly <ja...@yahoo.com>.
Andy,

I found the solution this morning...:

use:   datasetGraphTDB.sync();
instead of:   TDB.sync(dataset) ;

where the datasetGraphTDB was from the DatasetGraphTransaction that was from the Dataset, and that seemed to work (see code below, init() method for reference, if interested.).

For reference only:

I am just writing a simple JenaDAO class and a JeneDAOTest junit test for ... testing my methods.. ;-)
Nothing too complicated...

So, between test runs, I would (or would NOT) run a maven clean that would delete my TDB DB, thus allowing me the test over JVM restarts, all from a Win/DOS cmd line... (using maven).  I was only add 1 Statement, stopping, and then querying...


I'm running in Winblows 7,  don't have cygwin installed, so can't run the tdbquery...  [I would have just for reference for ya...]
But, per maven, and clean compile and install, get the latest versions....



Is there any thoughts of writing equivalent windows .bat scripts for those unix scripts...?   (or an  Ant script that would work on both OS's...?)?


Thanks for the help, much appreciated!!!
 
 
Tkx,
Jim



  private void init()
  {
    String assemblerFile = "tdb-assembler.ttl";
    dataset = TDBFactory.assembleDataset(assemblerFile);
    model = dataset.getDefaultModel();
    DatasetGraphTransaction dst = (DatasetGraphTransaction) dataset.asDatasetGraph();
    datasetGraphTDB = dst.getBaseDatasetGraph();
    fileMgr = FileManager.get();
    fileMgr.addLocatorClassLoader(JenaDAO.class.getClassLoader());
  }


  public void addStatement(Statement statement)
  {
    model.add(statement);
    datasetGraphTDB.sync();
  }





________________________________
 From: Andy Seaborne <an...@apache.org>
To: jena-users@incubator.apache.org 
Sent: Thursday, April 19, 2012 9:50 AM
Subject: Re: Loading OWL and TDB
 
Jim,

(I'm not on a machine capable of doing anything like run an IDE or a 
Java program for a few more days)

Could you turn thins into a complete, minimal example? i.e. a piece of 
code that illustrates the undesirable effect.  Details matter here so 
there is a risk that I might misunderstand your setup details.

Also, the output from "tdbquery -version" to say which snapshots you are 
using would be useful when I get back to a big computer.

    Andy

On 18/04/12 18:30, Jim Reilly wrote:
> Andy,
>
> Thanks and that worked by the way.  I am using maven and have these setting, so I get the latest:
> jena-arq:<version>2.9.1-incubating-SNAPSHOT</version>
>
> jena-tdb:<version>0.9.1-incubating-SNAPSHOT</version>
>
>
>
> Now, I am having a similar issues as before, but with using the model to add a statement (vs before was TDBLoader) and the issue is between restarts of the JVM.
>
>
> If, I use this:
>
>      model.add(statement);
>      TDB.sync(dataset);
>
>
>
> on a restart, I get a count of 1 with my Count query, but no visible results with my All query:
>
> 1) All query:         "SELECT * {?s ?p ?o}"
> 2 ) Count query:   "SELECT (count(*) AS ?count) { ?s ?p ?o }"
>
>
>
> But, if I change the TDB.sync(dataset) to model.close(), it does work, and I see the results as well as still the count of 1.
>
>
>
> So, do I need to close the model after an add, or call some other method to sync, or is it a bug....???
>
>
>
> Tkx,
> Jim
>
>
>
> ________________________________
>   From: Andy Seaborne<an...@apache.org>
> To: jena-users@incubator.apache.org
> Sent: Monday, April 16, 2012 12:07 PM
> Subject: Re: Loading OWL and TDB
>
> On 16/04/12 16:33, Jim Reilly wrote:
>> Andy,
>>
>> I tried the TDB.sync without the model.close, but that did not work
>> (meaning no data shown after a JVM re-start).
>
> Lack of clarity on my part.
>
> There is a bug in the 0.9.0 release whereby sync of a dataset was not getting passed down to the storage correctly (this is JENA-234). dataset.close should do a sync if the dataset has not been used for transactions at all, that is, it's running in 0.8 style.  The dataset implementation in TDB 0.9.0 behaves non-transactionally until used in some transaction - this is to maximise compatibility with existing code.
>
> Unfortunately, JENA-234 means that .close was not causing a sync and sync was not getting propagated properly. Fixed now in development builds and svn.
>
> The development build 0.9.1-incubator-SNAPSHOT (via [1] as described in [2])
>
>      Andy
>
> [1] https://repository.apache.org/content/repositories/snapshots/org/apache/jena/
>
> [2] http://incubator.apache.org/jena/download/maven.html

Re: Loading OWL and TDB

Posted by Andy Seaborne <an...@apache.org>.
Jim,

(I'm not on a machine capable of doing anything like run an IDE or a 
Java program for a few more days)

Could you turn thins into a complete, minimal example? i.e. a piece of 
code that illustrates the undesirable effect.  Details matter here so 
there is a risk that I might misunderstand your setup details.

Also, the output from "tdbquery -version" to say which snapshots you are 
using would be useful when I get back to a big computer.

	Andy

On 18/04/12 18:30, Jim Reilly wrote:
> Andy,
>
> Thanks and that worked by the way.  I am using maven and have these setting, so I get the latest:
> jena-arq:<version>2.9.1-incubating-SNAPSHOT</version>
>
> jena-tdb:<version>0.9.1-incubating-SNAPSHOT</version>
>
>
>
> Now, I am having a similar issues as before, but with using the model to add a statement (vs before was TDBLoader) and the issue is between restarts of the JVM.
>
>
> If, I use this:
>
>      model.add(statement);
>      TDB.sync(dataset);
>
>
>
> on a restart, I get a count of 1 with my Count query, but no visible results with my All query:
>
> 1) All query:         "SELECT * {?s ?p ?o}"
> 2 ) Count query:   "SELECT (count(*) AS ?count) { ?s ?p ?o }"
>
>
>
> But, if I change the TDB.sync(dataset) to model.close(), it does work, and I see the results as well as still the count of 1.
>
>
>
> So, do I need to close the model after an add, or call some other method to sync, or is it a bug....???
>
>
>
> Tkx,
> Jim
>
>
>
> ________________________________
>   From: Andy Seaborne<an...@apache.org>
> To: jena-users@incubator.apache.org
> Sent: Monday, April 16, 2012 12:07 PM
> Subject: Re: Loading OWL and TDB
>
> On 16/04/12 16:33, Jim Reilly wrote:
>> Andy,
>>
>> I tried the TDB.sync without the model.close, but that did not work
>> (meaning no data shown after a JVM re-start).
>
> Lack of clarity on my part.
>
> There is a bug in the 0.9.0 release whereby sync of a dataset was not getting passed down to the storage correctly (this is JENA-234). dataset.close should do a sync if the dataset has not been used for transactions at all, that is, it's running in 0.8 style.  The dataset implementation in TDB 0.9.0 behaves non-transactionally until used in some transaction - this is to maximise compatibility with existing code.
>
> Unfortunately, JENA-234 means that .close was not causing a sync and sync was not getting propagated properly. Fixed now in development builds and svn.
>
> The development build 0.9.1-incubator-SNAPSHOT (via [1] as described in [2])
>
>      Andy
>
> [1] https://repository.apache.org/content/repositories/snapshots/org/apache/jena/
>
> [2] http://incubator.apache.org/jena/download/maven.html


Re: Loading OWL and TDB

Posted by Jim Reilly <ja...@yahoo.com>.
Andy,

Thanks and that worked by the way.  I am using maven and have these setting, so I get the latest:
jena-arq:  <version>2.9.1-incubating-SNAPSHOT</version>

jena-tdb:  <version>0.9.1-incubating-SNAPSHOT</version>



Now, I am having a similar issues as before, but with using the model to add a statement (vs before was TDBLoader) and the issue is between restarts of the JVM.


If, I use this:

    model.add(statement);
    TDB.sync(dataset);



on a restart, I get a count of 1 with my Count query, but no visible results with my All query:

1) All query:         "SELECT * {?s ?p ?o}"
2 ) Count query:   "SELECT (count(*) AS ?count) { ?s ?p ?o }" 



But, if I change the TDB.sync(dataset) to model.close(), it does work, and I see the results as well as still the count of 1.



So, do I need to close the model after an add, or call some other method to sync, or is it a bug....???


 
Tkx,
Jim



________________________________
 From: Andy Seaborne <an...@apache.org>
To: jena-users@incubator.apache.org 
Sent: Monday, April 16, 2012 12:07 PM
Subject: Re: Loading OWL and TDB
 
On 16/04/12 16:33, Jim Reilly wrote:
> Andy,
> 
> I tried the TDB.sync without the model.close, but that did not work
> (meaning no data shown after a JVM re-start).

Lack of clarity on my part.

There is a bug in the 0.9.0 release whereby sync of a dataset was not getting passed down to the storage correctly (this is JENA-234). dataset.close should do a sync if the dataset has not been used for transactions at all, that is, it's running in 0.8 style.  The dataset implementation in TDB 0.9.0 behaves non-transactionally until used in some transaction - this is to maximise compatibility with existing code.

Unfortunately, JENA-234 means that .close was not causing a sync and sync was not getting propagated properly. Fixed now in development builds and svn.

The development build 0.9.1-incubator-SNAPSHOT (via [1] as described in [2])

    Andy

[1] https://repository.apache.org/content/repositories/snapshots/org/apache/jena/

[2] http://incubator.apache.org/jena/download/maven.html

Re: Loading OWL and TDB

Posted by Andy Seaborne <an...@apache.org>.
On 16/04/12 16:33, Jim Reilly wrote:
> Andy,
>
> I tried the TDB.sync without the model.close, but that did not work
> (meaning no data shown after a JVM re-start).

Lack of clarity on my part.

There is a bug in the 0.9.0 release whereby sync of a dataset was not 
getting passed down to the storage correctly (this is JENA-234). 
dataset.close should do a sync if the dataset has not been used for 
transactions at all, that is, it's running in 0.8 style.  The dataset 
implementation in TDB 0.9.0 behaves non-transactionally until used in 
some transaction - this is to maximise compatibility with existing code.

Unfortunately, JENA-234 means that .close was not causing a sync and 
sync was not getting propagated properly. Fixed now in development 
builds and svn.

The development build 0.9.1-incubator-SNAPSHOT (via [1] as described in [2])

	Andy

[1] 
https://repository.apache.org/content/repositories/snapshots/org/apache/jena/

[2] http://incubator.apache.org/jena/download/maven.html

Re: Loading OWL and TDB

Posted by Jim Reilly <ja...@yahoo.com>.
Andy,

I tried the TDB.sync without the model.close, but that did not work (meaning no data shown after a JVM re-start).

 
 
Tkx,
Jim



________________________________
 From: Andy Seaborne <an...@apache.org>
To: jena-users@incubator.apache.org 
Sent: Saturday, April 14, 2012 1:18 PM
Subject: Re: Loading OWL and TDB
 
On 13/04/12 18:40, Jim Reilly wrote:
> Andy,
>
> Great, it worked, thanks for the help!!
>
> Now, will the issue be fixed or is closing the model the correct solution (I'm new to Jena).
> If it has to be closed, I read those issues about having to possibly reopen/recreate and such,
> what does that really mean... (issues involved)

As you're using TDB without transactions, you should do a 
TDB.sync(dataset) before exiting.  (model.close is secretly doing it; 
TDB.sync(dataset) isbetter style, it is really the dataset that is being 
sync'ed, not just the model)

    Andy

>
>
>
> Tkx,
> Jim

Re: Loading OWL and TDB

Posted by Andy Seaborne <an...@apache.org>.
On 13/04/12 18:40, Jim Reilly wrote:
> Andy,
>
> Great, it worked, thanks for the help!!
>
> Now, will the issue be fixed or is closing the model the correct solution (I'm new to Jena).
> If it has to be closed, I read those issues about having to possibly reopen/recreate and such,
> what does that really mean... (issues involved)

As you're using TDB without transactions, you should do a 
TDB.sync(dataset) before exiting.  (model.close is secretly doing it; 
TDB.sync(dataset) isbetter style, it is really the dataset that is being 
sync'ed, not just the model)

	Andy

>
>
>
> Tkx,
> Jim

Re: Loading OWL and TDB

Posted by Jim Reilly <ja...@yahoo.com>.
Andy,

Great, it worked, thanks for the help!!

Now, will the issue be fixed or is closing the model the correct solution (I'm new to Jena).
If it has to be closed, I read those issues about having to possibly reopen/recreate and such,
what does that really mean... (issues involved)

  

Tkx,
Jim



________________________________
 From: Andy Seaborne <an...@apache.org>
To: jena-users@incubator.apache.org 
Sent: Friday, April 13, 2012 9:39 AM
Subject: Re: Loading OWL and TDB
 
Small world?

See https://issues.apache.org/jira/browse/JENA-234 (yesterday/today)

Workaround - try calling model.close() after TDBLoader.loadModel

    Andy


On 13/04/12 14:26, Jim Reilly wrote:
>
>
> I have been trying to load an OWL doc into TDB and get an error when I query the DB after a JVM restart.
>
>
> My load() method works, meaning the printAllQuery() shows the results.
> But, when the JVM ends, and I re-start it, by just calling the  printAllQuery(), it gives me this error:
> java.lang.NullPointerException at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.readPrefixMap(DatasetPrefixesTDB.java:175) at com.hp.hpl.jena.sparql.graph.GraphPrefixesProjection.getNsPrefixMap(GraphPrefixesProjection.java:62) at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:224) at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:215) at com.hp.hpl.jena.tdb.store.GraphTriplesTDB.createPrefixMapping(GraphTriplesTDB.java:99) at com.hp.hpl.jena.sparql.graph.GraphBase2.getPrefixMapping(GraphBase2.java:194) at com.hp.hpl.jena.rdf.model.impl.ModelCom.getPrefixMapping(ModelCom.java:908) at com.hp.hpl.jena.rdf.model.impl.ModelCom.withDefaultMappings(ModelCom.java:952) at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:66) at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:62) at com.hp.hpl.jena.rdf.model.ModelFactory.createModelForGraph(ModelFactory.java:166)
>   at com.hp.hpl.jena.sparql.core.DatasetImpl.graph2model(DatasetImpl.java:268) at com.hp.hpl.jena.sparql.core.DatasetImpl.getDefaultModel(DatasetImpl.java:104)
>
>
> So, is loading the OWL into memory and loading into TDB done differently somehow...????
>
>
> Also note, my prefixes.dat is empty.
>
>
>
> Here is the shortened method I've been using to test:
>
>     public void load()
>    {
>      Dataset dataset = TDBFactory.assembleDataset("air-tdb-assembler.ttl");
>      Model model = dataset.getDefaultModel();
>      OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RDFS_INF, model);
>      TDBLoader.loadModel(model, "file:src/test/resources/time.owl");
>
>      printAllQuery();
>    }
>
>   public void printAllQuery()
>    {
>      try
>      {
>        Query ALL_QUERY = QueryFactory.create("SELECT * {?s ?p ?o}");
>        QueryExecution qExec = QueryExecutionFactory.create(ALL_QUERY, dataset);
>        ResultSet rs = qExec.execSelect();
>        try
>        {
>          ResultSetFormatter.out(rs);
>        }
>        finally
>        {
>          qExec.close();
>        }
>      }
>      finally
>      {
>        // dataset.end(); // declares the end of the read transaction
>      }
>    }
>
>
> air-tdb-assembler.ttl:
> @prefix tdb:<http://jena.hpl.hp.com/2008/tdb#>  .
> @prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>  .
> @prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>  .
> @prefix ja:<http://jena.hpl.hp.com/2005/11/Assembler#>  .
>
> [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
> tdb:GraphTDB    rdfs:subClassOf  ja:Model      .
>
> <#dataset>  rdf:type         tdb:DatasetTDB ;
>      tdb:location "target/jenaDatabase/jenaDS" ;
>      .
>
>
>
> Tkx,
> Jim
>

Re: Loading OWL and TDB

Posted by Andy Seaborne <an...@apache.org>.
Small world?

See https://issues.apache.org/jira/browse/JENA-234 (yesterday/today)

Workaround - try calling model.close() after TDBLoader.loadModel

	Andy


On 13/04/12 14:26, Jim Reilly wrote:
>
>
> I have been trying to load an OWL doc into TDB and get an error when I query the DB after a JVM restart.
>
>
> My load() method works, meaning the printAllQuery() shows the results.
> But, when the JVM ends, and I re-start it, by just calling the  printAllQuery(), it gives me this error:
> java.lang.NullPointerException at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.readPrefixMap(DatasetPrefixesTDB.java:175) at com.hp.hpl.jena.sparql.graph.GraphPrefixesProjection.getNsPrefixMap(GraphPrefixesProjection.java:62) at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:224) at com.hp.hpl.jena.tdb.store.DatasetPrefixesTDB.getPrefixMapping(DatasetPrefixesTDB.java:215) at com.hp.hpl.jena.tdb.store.GraphTriplesTDB.createPrefixMapping(GraphTriplesTDB.java:99) at com.hp.hpl.jena.sparql.graph.GraphBase2.getPrefixMapping(GraphBase2.java:194) at com.hp.hpl.jena.rdf.model.impl.ModelCom.getPrefixMapping(ModelCom.java:908) at com.hp.hpl.jena.rdf.model.impl.ModelCom.withDefaultMappings(ModelCom.java:952) at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:66) at com.hp.hpl.jena.rdf.model.impl.ModelCom.<init>(ModelCom.java:62) at com.hp.hpl.jena.rdf.model.ModelFactory.createModelForGraph(ModelFactory.java:166)
>   at com.hp.hpl.jena.sparql.core.DatasetImpl.graph2model(DatasetImpl.java:268) at com.hp.hpl.jena.sparql.core.DatasetImpl.getDefaultModel(DatasetImpl.java:104)
>
>
> So, is loading the OWL into memory and loading into TDB done differently somehow...????
>
>
> Also note, my prefixes.dat is empty.
>
>
>
> Here is the shortened method I've been using to test:
>
>     public void load()
>    {
>      Dataset dataset = TDBFactory.assembleDataset("air-tdb-assembler.ttl");
>      Model model = dataset.getDefaultModel();
>      OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RDFS_INF, model);
>      TDBLoader.loadModel(model, "file:src/test/resources/time.owl");
>
>      printAllQuery();
>    }
>
>   public void printAllQuery()
>    {
>      try
>      {
>        Query ALL_QUERY = QueryFactory.create("SELECT * {?s ?p ?o}");
>        QueryExecution qExec = QueryExecutionFactory.create(ALL_QUERY, dataset);
>        ResultSet rs = qExec.execSelect();
>        try
>        {
>          ResultSetFormatter.out(rs);
>        }
>        finally
>        {
>          qExec.close();
>        }
>      }
>      finally
>      {
>        // dataset.end(); // declares the end of the read transaction
>      }
>    }
>
>
> air-tdb-assembler.ttl:
> @prefix tdb:<http://jena.hpl.hp.com/2008/tdb#>  .
> @prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>  .
> @prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#>  .
> @prefix ja:<http://jena.hpl.hp.com/2005/11/Assembler#>  .
>
> [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
> tdb:GraphTDB    rdfs:subClassOf  ja:Model      .
>
> <#dataset>  rdf:type         tdb:DatasetTDB ;
>      tdb:location "target/jenaDatabase/jenaDS" ;
>      .
>
>
>
> Tkx,
> Jim
>