You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Andrea Scarpino <as...@noemalife.com> on 2014/10/16 15:36:18 UTC
How to rename a namedModel?
Hi all,
I'd like to hear from you the "optimal/suggested" way to rename a named
model into TDB dataset on file system.
Does adding the same Model twice in two different named models, duplicate
the triples or it does some "symlink"?
I've to load a very huge ontology (TDB size is 5.5GB after its load) from
file into a named model, in my TDB dataset on file system, which will be
named as this ontology owl:versionInfo/versionIRI (if present).
At the moment, to do that I load the ontology into a temporary TDB dataset
on file system, then I read owl:version* from that model and I put the
ontology in a named model in my main dataset.
I don't put it directly into my main dataset just to avoid to lock it
during the owl:version* check.
Thanks.
Cheers
--
Andrea Scarpino
Re: How to rename a namedModel?
Posted by Andy Seaborne <an...@apache.org>.
On 17/10/14 08:09, Andrea Scarpino wrote:
> Thanks for the reply.
>
> 2014-10-16 22:26 GMT+02:00 Andy Seaborne <an...@apache.org>:
>
>> You could do a streaming pass over the data to find the required naing
>> info them load.
>>
>
> Do you mean something like this?
>
> Model model = ModelFactory.createDefaultModel();
> model.read(inputstream);
> String version = fetchVersion(model);
> dataset.addNamedModel(model, version);
>
> I guess this loads the whole ontology into RAM, I'm right? If so, I'd like
> to avoid that.
See StreamRDF - the event interface to the parsers. You can write your
own StreamRDF and build up a chain of stream operations.
Here, parser to a StreamRDF that notes the name information but
otherwise does nothing with the data.
http://jena.apache.org/documentation/io/streaming-io.html
>
> Cheers
>
Re: How to rename a namedModel?
Posted by Andrea Scarpino <as...@noemalife.com>.
Thanks for the reply.
2014-10-16 22:26 GMT+02:00 Andy Seaborne <an...@apache.org>:
> You could do a streaming pass over the data to find the required naing
> info them load.
>
Do you mean something like this?
Model model = ModelFactory.createDefaultModel();
model.read(inputstream);
String version = fetchVersion(model);
dataset.addNamedModel(model, version);
I guess this loads the whole ontology into RAM, I'm right? If so, I'd like
to avoid that.
Cheers
--
Andrea Scarpino
Re: How to rename a namedModel?
Posted by Andy Seaborne <an...@apache.org>.
On 16/10/14 14:36, Andrea Scarpino wrote:
> Hi all,
> I'd like to hear from you the "optimal/suggested" way to rename a named
> model into TDB dataset on file system.
>
> Does adding the same Model twice in two different named models, duplicate
> the triples or it does some "symlink"?
Duplicate.
TDB stores quads g-s-p-o (and triples for the default graph).
If you want a different "g" its needs to copy the quads.
It's dictionaried - each using of the same RDF term is the same internal
id so the copy is of the quads, not the RDF terms themselves.
> I've to load a very huge ontology (TDB size is 5.5GB after its load)
Not that large :-)
> from
> file into a named model, in my TDB dataset on file system, which will be
> named as this ontology owl:versionInfo/versionIRI (if present).
> At the moment, to do that I load the ontology into a temporary TDB dataset
> on file system, then I read owl:version* from that model and I put the
> ontology in a named model in my main dataset.
> I don't put it directly into my main dataset just to avoid to lock it
> during the owl:version* check.
You could do a streaming pass over the data to find the required naing
info them load.
>
> Thanks.
> Cheers
>
Andy