- From: Andy Seaborne <andy@apache.org>
- Date: Sat, 14 Oct 2023 10:43:25 +0100
- To: Pierre-Antoine Champin <pierre-antoine@w3.org>, public-rdf-star-wg@w3.org
On 12/10/2023 15:15, Pierre-Antoine Champin wrote: > Thanks Andy. Out of curioty, what would you do of the following N-Quads > (again, using qnames for convenience only): > > :s :p :o %{g1} > > Seems to me that this one has no asserted triple, only a "floating" > graph term... Yes. The N-Quads details were to show that it's possible. Like RDF Collections, the syntax in Turtle/TriG is more natural. It's quite easy to create nonsense RDF lists in N-Quads. The N-quads syntax form is repurposed for a declaration when the 4th slot is %{}. :s :p :o %{g1} says ":s :p :o" is a triple of a graph term we are referring to as %{g1} in the scope of this document. It is least change to N-Quads. N-Quads is a simple syntax for dump and restore. It is useful in our discussions because it is so simple. However, if that is considered a problem, then to make it not look like a quad: - :s :p :o %{g1} the leading bare "-" means "graph term definition" The idea is that graph terms can, as syntax, be thought of as "appendices" to the graph c.f. discussion in https://gist.github.com/niklasl/c22994e664663b6730613ecc1321c418 > What about this one: > > :s :p :o %{g1}. > :s :p :o %{g2}. > :a :b %{g1}. > :c :d %{g2}. > > Seems to be that this one would be equivalent (in the /abstract syntax/) to > > :s :p :o %{g1}. > :a :b %{g1}. > :c :d %{g1}. > > Do you agree? Yes, in the abstract data model. If the N-quads file has another line then no. :s :p :o %{g1}. :s :p :o %{g2}. :s :p :Z %{g1}. Graph terms have structural equality (they are literal-like). :a :b {:s :p :o} :c :d {:s :p :o} The problem is not the syntax per-se. It's the equality. ASK { :a :b ?G . :c :d ?G . } -> true. Our different proposals make that easier or harder to say in their syntax but any design that allows or entails "resource occurrenceOf graphTerm", then it's there. > Could that be a problem (non trivial to detect)? It's certainly non-trivial. Graph terms are conceptually just another term, but practically the fact some can be large makes them different. c.f. Large literals rdf:XMLLiteral, rdf:JSON, rdf:HTML. In triple terms (quoted triples) it is the there as well, in a mild form, where it's comparing trees. Andy > On 12/10/2023 14:00, Andy Seaborne wrote: >> I see using blank nodes as one possible implementation approach. The >> core idea is graph terms (types) and occurrences (tokens, uses of). >> >> I think we should focus on the whole model with draph terms in the RDF >> abstract data model; then see how we get there. Just looking at an >> incremental steps may leave RDF with the blocking legacy for "RDF 1.3". >> >> We can put quoted triples to one side for now and come back to them >> when the big picture is more settled. >> >> >> Proposal: Syntactic support for graph terms. >> >> We need syntactic support for graph terms. Graph terms will be larger >> than our one line examples to date - 10s of triples and up. Visually >> seeing that two graphs are the same graph will be error prone. >> >> _:a1 rdf:occurenceOf { :s :p :o } >> _:a1 rdf:type .... >> _:a2 rdf:occurenceOf { :s :p :o } >> _:a2 rdf:type .... >> >> And we need N-quads support. >> >> Suggestion: Have syntax to define a syntax element: >> >> USING %{label} FOR { :s :p :o1, :o2 } >> _:a1 rdf:occurenceOf %{label} >> _:a1 rdf:type .... >> _:a2 rdf:occurenceOf %{label} >> _:a2 rdf:type .... >> >> with >> >> _:a3 rdf:occurenceOf { :s :p :o } >> >> is a shorthand for an implicitly generated %{....}. c.f. blank nodes. >> >> "label" is scoped to the document. >> >> There are many ways to have define-use syntax. The form above keeps >> these aspects separate and the general style will naturally follow for >> other syntaxes we need to update. >> >> Unlike current TriG, a label is defined to stand for the graph, not a >> part of a graph. >> >> Now we can use URIs for tokens and that makes the occurrence and the >> type accessible over the web. >> https://lists.w3.org/Archives/Public/public-rdf-star-wg/2023Oct/0009.html >> >> It is syntax. It is not in the RDF abstract data model. Graph terms >> are in the RDF abstract data model. >> >> This might be N-Quads (prefixed names for email only!). No USING needed. >> >> # 4th slot. Grouping. >> :s :p :o1 %{g} . >> :s :p :o2 %{g} . >> # Use in object slot >> _:a1 rdf:occurrenceOf %{g} . >> # Use in subject slot >> %{g} :property "abc" . >> >> %{} is not a graph name. >> >> :s :p :o1 %{g} . >> >> co-ops the use of the 4th slot but does not imply it is a graph name. >> Nothing appears in GRAPH ?g {} . >> >> The form "%{ }" has many choices - {} is to suggest "graphs". >> >> JSON-LD use of blank node named graph is not affected. >> Blank nodes could be used for a RDF 1.1 like implementation. >> >> rdf:occurrenceOf was used above because as Pierre-Antoine noted >> (SemTF) there are different kinds of "occurrence". Syntax that omits >> the name for the relationship is hiding this and it is something we >> have to explore. >> >> It may even become a keyword if there is one property but we aren't >> there yet. >> >> Andy >>
Received on Saturday, 14 October 2023 09:43:33 UTC