You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Claude Warren <cl...@xenei.com> on 2018/11/27 16:57:40 UTC

Reasoner and updating data in Fuseki

I have a case using Fuseki.  I have 2 named graphs call them "data" and
"schema".  Data contains all the data, schema contains all the RDFS based
triples.

I can configure Fuseki so that an inference model uses an RDF Reasoner to
apply the "schmea" rules to the "data", call this graph "inf".  In addition
I think fuseki can be configured so that any updates to "inf" are added as
triples to "data".

My issue is that there are periodic updates to the "schema" (e.g. when new
a RDF class is created).  My understanding is that the reasoners do not
like it when you make updates to the graphs they are manipulating without
going through the reasoner itself.  So is there a way to make updates to
the "schema" graph via fuseki such that the "inf" graph/reasoner will be
happy?

Claude

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

Re: Reasoner and updating data in Fuseki

Posted by Claude Warren <cl...@xenei.com>.
I was afraid that was the answer.  I am thinking that I might try to build
a new reasoner model implementation that would specify 3 graphs: base truth
graph, rules and derived truth graph.  The graph would expose base truth,
rules, and base+derived truth as endpoints for query and allow updating for
base truth or rules.  I think the reasoner has the ability to accept new
rules it is just the fuseki interface that does not provide access to them.

Not sure when I can get to explore this idea. :(

Claude

On Sun, Dec 30, 2018 at 5:14 PM ajs6f <aj...@apache.org> wrote:

> Claude--
>
> I don't think you ever got a response on this. I'm not very expert with
> the inference framework, but am I correct in understanding your question to
> be: how, using only the assembler tools and Fuseki, can one update the
> schema of an inference model?
>
> If so, I don't think that _is_ possible (I hope I'm wrong and someone
> corrects me!), but some options that might be interesting:
>
> • Building a new dataset on-demand for schema changes. I think you should
> be able to use a new assembler doc for each change:
>
>
> https://jena.apache.org/documentation/fuseki2/fuseki-server-protocol.html#assembler-example
>
> (apparently we need an example there, :sigh:) and if your actual triples
> are resident on disk (in TDB, say) you should be able to avoid copying them.
>
> • Using a Fuseki extension. I haven't looked at this much (it's pretty
> new) but Andy has done a large amount of work to offer custom endpoints for
> Fuseki. It might be possible to offer an endpoint to load a new schema or
> do some other coarser manipulation to get what you need done.
>
> ajs6f
>
> > On Dec 6, 2018, at 9:55 AM, Claude Warren <cl...@xenei.com> wrote:
> >
> > Somehow I missed this response.
> >
> > If the schema and the data are in the same graph everything is fine, but
> I
> > have schema and data in separate graphs.
> >
> > So without putting the graphs together into a single graph is it
> possible,
> > via fuseki, to update the "schema" rules in an inference graph?
> >
> > Even if I put the schema and the data together in a union graph and run
> the
> > inferencer on that the updates still have to go to one or the other graph
> > right?  So i have to start mixing the schema and the data.
> >
> > Is there a way around this?  If not, does anyone have any idea how hard
> it
> > would be to implement an inference model that would allow updates of the
> > schema data.  I figure if that is available I can plug that into Fuseki
> > with a couple of custom hooks and do the updates.
> >
> > Claude
> >
> > On Fri, Nov 30, 2018 at 1:11 PM Andy Seaborne <an...@apache.org> wrote:
> >
> >>
> >>
> >> On 27/11/2018 16:57, Claude Warren wrote:
> >>> I have a case using Fuseki.  I have 2 named graphs call them "data" and
> >>> "schema".  Data contains all the data, schema contains all the RDFS
> based
> >>> triples.
> >>>
> >>> I can configure Fuseki so that an inference model uses an RDF Reasoner
> to
> >>> apply the "schmea" rules to the "data", call this graph "inf".  In
> >> addition
> >>> I think fuseki can be configured so that any updates to "inf" are added
> >> as
> >>> triples to "data".
> >>>
> >>> My issue is that there are periodic updates to the "schema" (e.g. when
> >> new
> >>> a RDF class is created).  My understanding is that the reasoners do not
> >>> like it when you make updates to the graphs they are manipulating
> without
> >>> going through the reasoner itself.  So is there a way to make updates
> to
> >>> the "schema" graph via fuseki such that the "inf" graph/reasoner will
> be
> >>> happy?
> >>
> >> What happens if schema and data are in the same graph and so the updates
> >> do go via the inference engine?
> >>
> >>>
> >>> Claude
> >>>
> >>
> >
> >
> > --
> > I like: Like Like - The likeliest place on the web
> > <http://like-like.xenei.com>
> > LinkedIn: http://www.linkedin.com/in/claudewarren
>
>

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

Re: Reasoner and updating data in Fuseki

Posted by ajs6f <aj...@apache.org>.
Claude--

I don't think you ever got a response on this. I'm not very expert with the inference framework, but am I correct in understanding your question to be: how, using only the assembler tools and Fuseki, can one update the schema of an inference model?

If so, I don't think that _is_ possible (I hope I'm wrong and someone corrects me!), but some options that might be interesting:

• Building a new dataset on-demand for schema changes. I think you should be able to use a new assembler doc for each change:

https://jena.apache.org/documentation/fuseki2/fuseki-server-protocol.html#assembler-example

(apparently we need an example there, :sigh:) and if your actual triples are resident on disk (in TDB, say) you should be able to avoid copying them.

• Using a Fuseki extension. I haven't looked at this much (it's pretty new) but Andy has done a large amount of work to offer custom endpoints for Fuseki. It might be possible to offer an endpoint to load a new schema or do some other coarser manipulation to get what you need done.

ajs6f

> On Dec 6, 2018, at 9:55 AM, Claude Warren <cl...@xenei.com> wrote:
> 
> Somehow I missed this response.
> 
> If the schema and the data are in the same graph everything is fine, but I
> have schema and data in separate graphs.
> 
> So without putting the graphs together into a single graph is it possible,
> via fuseki, to update the "schema" rules in an inference graph?
> 
> Even if I put the schema and the data together in a union graph and run the
> inferencer on that the updates still have to go to one or the other graph
> right?  So i have to start mixing the schema and the data.
> 
> Is there a way around this?  If not, does anyone have any idea how hard it
> would be to implement an inference model that would allow updates of the
> schema data.  I figure if that is available I can plug that into Fuseki
> with a couple of custom hooks and do the updates.
> 
> Claude
> 
> On Fri, Nov 30, 2018 at 1:11 PM Andy Seaborne <an...@apache.org> wrote:
> 
>> 
>> 
>> On 27/11/2018 16:57, Claude Warren wrote:
>>> I have a case using Fuseki.  I have 2 named graphs call them "data" and
>>> "schema".  Data contains all the data, schema contains all the RDFS based
>>> triples.
>>> 
>>> I can configure Fuseki so that an inference model uses an RDF Reasoner to
>>> apply the "schmea" rules to the "data", call this graph "inf".  In
>> addition
>>> I think fuseki can be configured so that any updates to "inf" are added
>> as
>>> triples to "data".
>>> 
>>> My issue is that there are periodic updates to the "schema" (e.g. when
>> new
>>> a RDF class is created).  My understanding is that the reasoners do not
>>> like it when you make updates to the graphs they are manipulating without
>>> going through the reasoner itself.  So is there a way to make updates to
>>> the "schema" graph via fuseki such that the "inf" graph/reasoner will be
>>> happy?
>> 
>> What happens if schema and data are in the same graph and so the updates
>> do go via the inference engine?
>> 
>>> 
>>> Claude
>>> 
>> 
> 
> 
> -- 
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren


Re: Reasoner and updating data in Fuseki

Posted by Claude Warren <cl...@xenei.com>.
Somehow I missed this response.

If the schema and the data are in the same graph everything is fine, but I
have schema and data in separate graphs.

So without putting the graphs together into a single graph is it possible,
via fuseki, to update the "schema" rules in an inference graph?

Even if I put the schema and the data together in a union graph and run the
inferencer on that the updates still have to go to one or the other graph
right?  So i have to start mixing the schema and the data.

Is there a way around this?  If not, does anyone have any idea how hard it
would be to implement an inference model that would allow updates of the
schema data.  I figure if that is available I can plug that into Fuseki
with a couple of custom hooks and do the updates.

Claude

On Fri, Nov 30, 2018 at 1:11 PM Andy Seaborne <an...@apache.org> wrote:

>
>
> On 27/11/2018 16:57, Claude Warren wrote:
> > I have a case using Fuseki.  I have 2 named graphs call them "data" and
> > "schema".  Data contains all the data, schema contains all the RDFS based
> > triples.
> >
> > I can configure Fuseki so that an inference model uses an RDF Reasoner to
> > apply the "schmea" rules to the "data", call this graph "inf".  In
> addition
> > I think fuseki can be configured so that any updates to "inf" are added
> as
> > triples to "data".
> >
> > My issue is that there are periodic updates to the "schema" (e.g. when
> new
> > a RDF class is created).  My understanding is that the reasoners do not
> > like it when you make updates to the graphs they are manipulating without
> > going through the reasoner itself.  So is there a way to make updates to
> > the "schema" graph via fuseki such that the "inf" graph/reasoner will be
> > happy?
>
> What happens if schema and data are in the same graph and so the updates
> do go via the inference engine?
>
> >
> > Claude
> >
>


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

Re: Reasoner and updating data in Fuseki

Posted by Andy Seaborne <an...@apache.org>.

On 27/11/2018 16:57, Claude Warren wrote:
> I have a case using Fuseki.  I have 2 named graphs call them "data" and
> "schema".  Data contains all the data, schema contains all the RDFS based
> triples.
> 
> I can configure Fuseki so that an inference model uses an RDF Reasoner to
> apply the "schmea" rules to the "data", call this graph "inf".  In addition
> I think fuseki can be configured so that any updates to "inf" are added as
> triples to "data".
> 
> My issue is that there are periodic updates to the "schema" (e.g. when new
> a RDF class is created).  My understanding is that the reasoners do not
> like it when you make updates to the graphs they are manipulating without
> going through the reasoner itself.  So is there a way to make updates to
> the "schema" graph via fuseki such that the "inf" graph/reasoner will be
> happy?

What happens if schema and data are in the same graph and so the updates 
do go via the inference engine?

> 
> Claude
>