You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Phillip Rhodes <mo...@gmail.com> on 2024/11/20 23:48:11 UTC

Re: Reification [Was: Preparing for Jena5 - API deprecations]

So wait... is reification being *totally* removed from Jena, or is it
just being punted out of the core API(s) and left as bit of
library/utility code?

Curious, as I had just been thinking that reification would be
important to something I'm working on. Although, now that I give it
some more thought, I might be wrong about that.


Phil


On Sat, Jul 22, 2023 at 4:38 AM Andy Seaborne <an...@apache.org> wrote:
>
> Reification is only supported in the Model API, not Graph. It's already
> simpler than it was when first introduced, when it had 3 different modes.
>
> The complexity on storage was huge.
>
> https://www.hpl.hp.com/techreports/2003/HPL-2003-266.pdf
>
> Reification subsequently got simplified to library code in the Model API
> which corresponds to the original "Reification standard mode".
>
> https://jena.apache.org/documentation/notes/reification_previous.html
>
> See ReifierStd, which is all static functions. (There are no
> "hiddenTriples" - that was an old feature)
>
>     Andy

Re: Reification [Was: Preparing for Jena5 - API deprecations]

Posted by Phillip Rhodes <mo...@gmail.com>.
OK, just FYI, I was able to use the RDF* mechanism to successfully
implement the desired mapping between the Jena TDB triplestore and the
AgentSpeak beliefs and everything (at least everything I've tested so
far) works.

Thanks for the heads-up, Andy!

Phil

Re: Reification [Was: Preparing for Jena5 - API deprecations]

Posted by Phillip Rhodes <mo...@gmail.com>.
On Fri, Nov 22, 2024 at 4:48 AM Andy Seaborne <an...@apache.org> wrote:
> What's the use case?

I'm working on a TDB backed "BeliefBase" to use with AgentSpeak
(Jason) agent programs. Beliefs there look a bit like Prolog
predicates, so you can have something like married(tommy,gina) to say
"Tommy and Gina are married". And the arity can, of course, go higher
- arbitrarily high as far as I know. Anyway, I had originally thought
that I might want to use Reification as part of my approach to
modeling this, but in the end I realized it actually makes more sense
to have a concrete, identifiable "base" Resource for the arity-0
version of the belief, and then additional Statements that "attach"
the additional Terms using a Property. Right now I'm using
RDFS.member, although that's probably not right. :-)

That said, I've now come back to the Reification thing for a slightly
different reason. I have triples now that look like this:

----------------------------------------
| x
     | y                                                           | z
                                      |
=================================================================================================================================================
========================================
| <http://ontology.fogbeam.com/belief/161e3e20-7453-4377-9c27-23267531c015>
| <http://ontology.fogbeam.com/belief/BDIBelief>              | <http
://ontology.fogbeam.com/belief/foobar> |
| <http://ontology.fogbeam.com/belief/161e3e20-7453-4377-9c27-23267531c015>
| <https://ontology.fogbeam.com/predicate/predicateIndicator> | "foob
ar/2"                                  |
| <http://ontology.fogbeam.com/belief/161e3e20-7453-4377-9c27-23267531c015>
| <https://ontology.fogbeam.com/predicate/arity>              | "2"
                                      |
| <http://ontology.fogbeam.com/belief/161e3e20-7453-4377-9c27-23267531c015>
| <http://www.w3.org/2000/01/rdf-schema#member>               | "1.0"
                                      |
| <http://ontology.fogbeam.com/belief/161e3e20-7453-4377-9c27-23267531c015>
| <http://www.w3.org/2000/01/rdf-schema#member>               | "20.0
"                                      |
-------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------

and when I load the Beliefs from the triplestore I'd like to make sure
the embedded terms in a belief like foobar(1,20) show up in the right
order. So now I'm wondering if it might make sense to reify one of the
Statements like

<http://ontology.fogbeam.com/belief/161e3e20-7453-4377-9c27-23267531c015>
| <http://www.w3.org/2000/01/rdf-schema#member>               | "1.0"

so I can add a "termIndex" Property. I could use the same pattern of
explicitly create a concrete resource for each Term and everything,
but it feels like it would complicate the code a lot to do that.

Anyway, I'll keep experimenting with this and see what I can cook up.
Any suggestions are greatly appreciated though.


> RDF 1.2 (RDF-star) may be what you are looking for. It is reification,
> in the abstract sense.  It differentiates between the use of a triple,
> and the abstract concept of a triple as a concept; all triples "exist",
> what matters for provenance or claims is when they are used in a graph.

OK, I'll have to do some reading on that. I've been away from Jena /
RDF / SemanticWeb stuff a bit for the past few years until recently
and wasn't familiar with this until now. But from this blurb I found
online

"RDF-star allows descriptions to be added to edges in a graph such as
scores, weights, temporal aspects and provenance to edges in a graph."

This sounds like exactly what I'm trying to do.

Phil

Re: Reification [Was: Preparing for Jena5 - API deprecations]

Posted by Andy Seaborne <an...@apache.org>.
On 20/11/2024 23:48, Phillip Rhodes wrote:
> So wait... is reification being *totally* removed from Jena, or is it
> just being punted out of the core API(s) and left as bit of
> library/utility code?

An application can use the reification vocabulary. That hasn't changed. 
It is the Model API support specific to reification that's gone - with 
the functionality in the library ReifierStd.

It's just been API presentation. There hasn't been any storage support, 
such as compact storage, for reification for many years.

> Curious, as I had just been thinking that reification would be
> important to something I'm working on. Although, now that I give it
> some more thought, I might be wrong about that.

What's the use case?

RDF 1.2 (RDF-star) may be what you are looking for. It is reification, 
in the abstract sense.  It differentiates between the use of a triple, 
and the abstract concept of a triple as a concept; all triples "exist", 
what matters for provenance or claims is when they are used in a graph.

While RDF-star isn't finished, the publication dates for the RDF 
specifications are quite soon so the work is relatively stable.

     Andy

RDF 1.2: There may yet be changes but as things stand at the moment:

* RDF-star is most of the work.
   It is not the same as the RDF-Star CG.
   But most uses of RDF-Star CG work will work.

Other changes of note:

* Initial text direction:
   https://www.w3.org/TR/rdf12-concepts/#dfn-dir-lang-string

* Formalizing canonical writing of n-quads
   This is used by RDF Canonicalization.

* See https://www.w3.org/TR/rdf12-concepts/

* Errata, converting documents to ReSpec format, and cleaning up.


When the WG has published both the RDF documents and SPARQL documents, 
it will go into "maintenance and new features" mode. This means errata 
can be addressed promptly and that non-breaking small, new features can 
be added (likely more related to SPARQL than RDF).

Related news:

There is going to be a SHACL 1.2 Working Group
https://www.w3.org/2024/10/data-shapes.html


> Phil
> 
> 
> On Sat, Jul 22, 2023 at 4:38 AM Andy Seaborne <an...@apache.org> wrote:
>>
>> Reification is only supported in the Model API, not Graph. It's already
>> simpler than it was when first introduced, when it had 3 different modes.
>>
>> The complexity on storage was huge.
>>
>> https://www.hpl.hp.com/techreports/2003/HPL-2003-266.pdf
>>
>> Reification subsequently got simplified to library code in the Model API
>> which corresponds to the original "Reification standard mode".
>>
>> https://jena.apache.org/documentation/notes/reification_previous.html
>>
>> See ReifierStd, which is all static functions. (There are no
>> "hiddenTriples" - that was an old feature)
>>
>>      Andy