Empty graphs in Fuseki simply don't exist.  They no more exist than a
predicate that has not been used.  Named graphs only come into existence
when there is at least one triple added to it.  If you think about datasets
as collections of quads (<g> <s> <p> <o>) then you can see that the dataset
can only locate graphs that have data.  The only other option is that an
infinite number of graphs exist, in which case listing all the graphs would
be impossible.  I am sure there is a deep philosophical discussion here but
the Jena  rule is that if the graph does not have data it does not exist.

As for your second question, you did not give an example of how you
inserted the data.  If you did not provide a graph name to insert into then
the data would go into the default graph named "urn:x-arq:DefaultGraph"
(defined in org.apache.jena.sparql.core.Quad.defaultGraphIRI).  If you did
provide the graph name then the data would be inserted into that graph as
your debugging shows.  When you say it does not exist in the graph are you
referring to on disk?  How did you write the data back out?  The UnionModel
depends on the underlying models to preserve their data.  If those models
are in-memory models then they will not be written back to disk, if they
are TDB models (or other similar auto storing models) then they should  be
written back to the underlying storage.  This assumes that all transactions
and other issues are correctly handled.

Claude



On Thu, Sep 26, 2019 at 10:05 AM Nouwt, B. (Barry)
<[email protected]> wrote:

> Hi all,
>
> I am trying to get the Apache Jena UnionModel working for my scenario, but
> I keep encountering unexpected behavior. I’ve set up a minimal,
> free-standing example on github in this repository (clone the git repo,
> configure Maven in your IDE and execute the main() method, I.e. it probably
> does not run from the .jar):
>
>  https://github.com/barrynl/jena-example
>
>
>
> I have two questions related to this example:
>
> My first question is related to empty graphs in Jena Fuseki. If I load the
> conf.ttl (from the git repo above) at startup in Apache Jena Fuseki without
> the dummy data in the two named graphs, the two graphs seem to disappear (I
> think this does not happen in my Java Example). I read somewhere that empty
> graphs are automatically deleted in Fuseki to prevent old graphs from
> showing up in the Fuseki interface. For my use case I would like to
> configure two (possibly empty at first) named graphs via a conf.ttl and be
> able to store data in them afterwards. Is this possible?
>
> My second question is about the demonstraded behaviour of the Java example
> in the git repository above. I load a dataset with a UnionModel from a
> conf.ttl file and insert new data in it via SPARQL. Although the new data
> shows up in the select query, it does not show up in either of the two
> names graphs the UnionModel consists of. My question is: where is this data
> stored if not in one of the names graphs? (If I inspect the UnionModel via
> a debugger, the inserted data DOES show up in the correct named graph)
>
> Hopefully someone can shed some light on this behaviour. Thanks in advance!
>
> Regards, Barry
> This message may contain information that is not intended for you. If you
> are not the addressee or if this message was sent to you by mistake, you
> are requested to inform the sender and delete the message. TNO accepts no
> liability for the content of this e-mail, for the manner in which you use
> it and for damage of any kind resulting from the risks inherent to the
> electronic transmission of messages.
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to