Re: RDF lists/arrays and n-ary relations [was Re: OWL and RDF lists]

On 9/22/22 16:34, Pierre-Antoine Champin wrote:
> I think it is useful to consider every proposed extension, and carefully 
> consider whether it really requires an extension of the underlying data 
> model, or whether it can be managed purely as syntactic sugar.

Agreed.  That would be best for backward compatibility.  And it occurs 
to me that some of these ideas for new "built-in" object types, such as 
arrays and composite object, could actually be implemented as syntactic 
sugar for named graphs.  For example, this array of dog show winners:

   # Example 1
   :dogShow winners ( :ginger :bailey ) .

might be treated as syntactic sugar for this TriG:

   # Example 1-expanded
   :dogShow :winners N2 .
   N2 { :dogShow :winners
          [
            0 :ginger ;
            1 :bailey
          ] .
      }

where N2 is an auto-generated named graph name of some kind (TBD) -- 
perhaps a blank node, a relative URI, or a Skolem URI.  By "unblessing" 
N2, you get to "see" the triples that implement that list object.

And this composite diagnosis object, used for an n-ary relation:

   # Example 6
   :christine :diagnosis @[
     :disease :breastCancer ;
     :probability 0.8
   ] .

might be treated as syntactic sugar for this TriG:

   # Example 6-expanded
   :christine :diagnosis N6 .

   N6 { :christine :diagnosis
          [
            :disease :breastCancer ;
            :probability 0.8
          ] .
      }

And this RDF-star syntax:

   # Example 9
   :a :name "Alice" {|
       :statedBy :bob ;
       :recorded "2021-07-07"^^xsd:date
       |} .

could be syntactic sugar for this TriG:

   # Example 9-expanded
   :a :name "Alice" .
   N9 { :a :name "Alice" . }
   N9 :statedBy :bob ;
       :recorded "2021-07-07"^^xsd:date .

This would have the benefit of supporting labeled property graphs, n-ary 
relations and arrays all under the same mechanism, without adding 
anything to the RDF core.

Thoughts?

David Booth

Received on Thursday, 22 September 2022 21:39:08 UTC