W3C home > Mailing lists > Public > public-rdf-star@w3.org > November 2020

Re: First version of a test suite for RDF*

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Mon, 23 Nov 2020 18:59:36 -0500
To: public-rdf-star@w3.org
Message-ID: <3ae4b60f-7de6-e552-1443-657110ab0d30@gmail.com>
Here is a mapping from generalized RDF* to generalized RDF that I believe
satisfies all the test cases:


Short and a bit sloppy version:

Define M on RDF terms as follows:
  M(I) is the string of I for I an IRI
  M(L) is the long lexical form of L for L an RDF literal

Let L be an injective mapping from RDF triples to "fresh" blank nodes.

Define the mapping -* from a generalized RDF* graph G* to a generalized RDF
graph G as follows:
  Pick some embedded triple < s p o > such that none of s, p, and o are
embedded triples, replace all occurrences of it by L(< s p o >), and add the
triples
    < L(< s p o >) rdf:type rdf:Statement >
    < L(< s p o >) rdf:subject s > if s is not a malformed literal
    < L(< s p o >) rdf:subject* M(s) > if s is not a blank node
    < L(< s p o >) rdf:predicate p > if p is not a malformed literal
    < L(< s p o >) rdf:predicate* M(p) > if p is not a blank node
    < L(< s p o >) rdf:object o > if o is not a malformed literal
    < L(< s p o >) rdf:object* M(o) >  if o is not a blank node
  Finish when there are no embedded triples left.





Longer and more careful version:

Let rdf* be an IRI namespace.

Let M be an injective mapping from IRIs and RDF literals to strings starting
with "X"

Let L be an injective mapping from RDF triples to blank nodes whose range
excludes an infinite number of blank nodes.

Let N be an injective mapping from IRIs to IRIs, strings to strings, and blank
nodes to blank nodes that does not include any IRIs in the rdf* namespace or
strings that start with "X" or blank nodes in the range of L in its range.
(This is just used to ensure that the encoding of IRIs, strings, and blank
nodes do not clash with RDF terms in the graphs.)

Define the mapping -* from a generalized RDF* graph G* to a generalized RDF
graph G as follows:
  First replace each RDF term by its mapping under N.
  Pick some embedded triple < s p o > such that none of s, p, and o are
embedded triples, replace all occurrences of it by L(< s p o >), and add the
triples
    < L(< s p o >) rdf*:type rdf*:Statement >
    < L(< s p o >) rdf*:subject s > if s is not a malformed literal
    < L(< s p o >) rdf*:subject* M(s) > if s is not a blank node
    < L(< s p o >) rdf*:predicate p > if p is not a malformed literal
    < L(< s p o >) rdf*:predicate* M(p) > if p is not a blank node
    < L(< s p o >) rdf*:object o > if o is not a malformed literal
    < L(< s p o >) rdf*:object* M(o) >  if o is not a blank node
  Finish when there are no embedded triples left.





peter





On 11/23/20 6:30 AM, Pierre-Antoine Champin wrote:
> Hi all,
>
> as per my action assigned on our last call [1], I pushed a first version of
> a test-suite. The first goal is to provide a set of concrete examples of how
> RDF* implementations are expected to behave. An HTML rendering of that
> test-suite is available here:
>
> https://w3c.github.io/rdf-star/tests/semantics/manifest.html
>
> so that everyone can review, reference, and comment each of the test cases.
>
> If "entail" sounds esoteric to you, think of the 2nd graph in each test case
> as a SPARQL* ASK query, which is expected to return TRUE (or FALSE, in the
> case of "not entail").
>
> Coming next: a similar test suite for SPARQL*.
>
>   best
>
> [1] https://github.com/w3c/rdf-star/issues/40
> <https://github.com/w3c/rdf-star/issues/40>
>
Received on Monday, 23 November 2020 23:59:54 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 November 2020 23:59:55 UTC