Re: Testing data consistency between graphs

> On Jan 18, 2019, at 5:58 PM, Austin William Wright <aaa@bzfx.net> wrote:
> 
> Hi SWIG,
> 
> I've got an application that queries statements from an RDF database, and in this process, the resulting graph might "lose" the IRI of a resource and replace it with a bnode. (Specifically, my result is an RDFa document, where an element with @typeof but no @about will produce a bnode, even if it has an IRI in my data store). I want to ensure that the data in my result graph is consistent with the data in the source graph:
> 
> The query result graph might only return a subset of the source data, which is legal because of the Open World Assumption.
> 
> And (I presume) it's legal to substitute an IRI with a bnode (in the subject & object positions). In this case, the statement is just saying "Some resource exists with the given properties" which is still a true statement.

Yes. In fact, these two changes (taking a subset, and replacing an IRI with a bnode) are exactly what is called ’simple entailment’ in the RDF specs, cf https://www.w3.org/TR/rdf11-mt/#dfn-interpolation <https://www.w3.org/TR/rdf11-mt/#dfn-interpolation>. Taken together, they preserve truth in all RDF graphs, and they are the only operations which preserve truth for /any/ RDF graph. 

> 
> I want to test that the data in my result graph is data also present in a reference graph (my source database): that no IRIs were cast to literals, that the lang/datatype on literals is preserved, and so on.
> 
> Graph isomorphism doesn't suffice, because bnodes are only matched with bnodes. So first, is there a formally described function that does this? Or else, what should it be called, perhaps "consistent with”?

“simply entails” is the terminology used in the normative specification documents. 

Best wishes

Pat Hayes

> 
> And second, are there any other cases of applications modifying graphs to replace an IRI with a bnode?
> 
> Thanks,
> 
> Austin.

Received on Sunday, 20 January 2019 00:01:50 UTC