Onto another problem...
File dir = new File(baseDir + "/" + projName);
if (!dir.exists()) {
dir.mkdirs();
Dataset dataset =
TDBFactory.createDataset(baseDir + "/" + projName);
dataset.begin(ReadWrite.WRITE);
OntModel project =
ModelFactory
.createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF);
model.setNsPrefix("", SemanticStoreService.BASE_URI + projName
+ "/");
dataset.setDefaultModel(project);
throws the following exception:
Exception in thread "main" java.lang.UnsupportedOperationException: Can't set
default graph via GraphStore on a TDB-backed dataset
at
com.hp.hpl.jena.tdb.store.DatasetGraphTDB.setDefaultGraph(DatasetGraphTDB.java:314)
at
com.hp.hpl.jena.sparql.core.DatasetGraphTrackActive.setDefaultGraph(DatasetGraphTrackActive.java:115)
at
com.hp.hpl.jena.sparql.core.DatasetImpl.setDefaultModel(DatasetImpl.java:215)
at
com.sas.store.service.SemanticStoreService.createProject(SemanticStoreService.java:203)
I'm not sure what's going on here. How would you set the default graph of a
newly created dataset? Note that this code is for the case when the dataset
does not exist yet.
On a side note, it might be nice to add a method for
TDBFactory.createDataset(File dir)...
Edward Swing
Applied Research Technologist
Vision Systems + Technology, Inc., a SAS Company
6021 University Boulevard * Suite 360 * Ellicott City * Maryland * 21043
Tel: 410.418.5555 Ext: 919 * Fax: 410.418.8580
Email: [email protected]<mailto:[email protected]>
Web: http://www.vsticorp.com<http://www.vsticorp.com/>