This should be easy…
I have the following assembler file.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
<#tdbstore> rdf:type tdb:DatasetTDB ;
tdb:location "DB" ;
.
<#ICD9> rdf:type tdb:GraphTDB ;
tdb:graphName <http://purl.bioontology.org/ontology/HOM_ICD9/> ;
tdb:dataset <#tdbstore> ;
.
With the following Java code:
Model assemblerSpec = FileManager.get().loadModel( "db.ttl" );
Resource root = assemblerSpec.createResource(
assemblerSpec.expandPrefix( "ICD9" ) );
Model model = Assembler.general.openModel( root );
An exception is thrown on the 3rd line (the assemblerSpec and root are not
null):
Exception in thread "main"
com.hp.hpl.jena.assembler.exceptions.NoSpecificTypeException: the root ICD9 has
no most specific type that is a subclass of ja:Object
at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:101)
at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:69)
at
com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:37)
at
com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:34)
at
com.hp.hpl.jena.assembler.assemblers.AssemblerGroup.openModel(AssemblerGroup.java:23)
at com.sas.hls.hoa.ontology.Test.main(Test.java:18)
ICD9 is a tdb:GraphTDB, (its most specific type)
tdb:GraphTDB rdfs:subClassOf ja:Model,
ja:Model is a subclass of ja:Object.
So why would this be occurring?
I need to make a lot of progress on my project over this weekend, so help today
is greatly appreciated.
David Jordan
Software Developer
SAS Institute Inc.
Health & Life Sciences, Research & Development
Bldg R ▪ Office 4467
600 Research Drive ▪ Cary, NC 27513
Tel: 919 531 1233 ▪ [email protected]<mailto:[email protected]>
www.sas.com<http://www.sas.com>
SAS® … THE POWER TO KNOW®