You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Laurent Pellegrino <la...@gmail.com> on 2012/07/02 17:00:38 UTC
TDB NodeTable
Hello,
Is it possible to retrieve the NodeTable associated to a TDB instance?
I have to query it (read-only),
Do I have to create a new one from the files representation? In that
case which class should I use (It seems they are a lot of NodeTable*
classes) and what are the parameters to pass?
Is there any difference between transactional and non-transactional
TDB instances to retrieve this NodeTable?
Kind Regards,
Laurent
Re: TDB NodeTable
Posted by Andy Seaborne <an...@apache.org>.
On 02/07/12 16:00, Laurent Pellegrino wrote:
> Hello,
>
> Is it possible to retrieve the NodeTable associated to a TDB instance?
> I have to query it (read-only),
>
> Do I have to create a new one from the files representation? In that
> case which class should I use (It seems they are a lot of NodeTable*
> classes) and what are the parameters to pass?
>
> Is there any difference between transactional and non-transactional
> TDB instances to retrieve this NodeTable?
>
> Kind Regards,
>
> Laurent
>
If you are just reading the files, with no TDB running:
See command tdb.tdbnode
If in java with TDB:
DatasetGraphTxn dsg = StoreConnection.make("DB").begin(ReadWrite.READ) ;
NodeTable x = dsg.getTripleTable().getNodeTupleTable().getNodeTable() ;
Iterator<Pair<NodeId, Node>> iter = x.all() ;
for ( ; iter.hasNext() ; )
etc etc
dsg.end() ;
This is NOT all the nodes in the graph - you'll have to ask the graph
for that (inlined nodes do not go in the node table).
Be careful.
Andy