This note is a summary of some cwm/euler implementation experience w.r.t. accessing RDF collections.

The RDF collection to be queried is "The students in course 6.001 are Amy, Mohamed, and Johann" and is represented using the graph shown in
An RDF Collection (list structure)

In this graph, each member of the collection, such as s:Amy, is the object of an rdf:first property whose subject is a resource (a blank node in this example) that represents a list. This list resource is linked to the rest of the list by an rdf:rest property. The end of the list is indicated by the rdf:rest property having as its object the resource rdf:nil (the resource rdf:nil represents the empty list, and is defined as being of type rdf:List).

The RDF/N3 for this example looks like

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://example.org/students/vocab#> .

:students rdfs:range rdf:List.

<http://example.org/courses/6.001>     :students  (
    <http://example.org/students/Amy>
    <http://example.org/students/Mohamed>
    <http://example.org/students/Johann>  ) .

The SPARQL query to be answered looks like

PREFIX list: <http://www.w3.org/2000/10/swap/list#>
PREFIX : <http://example.org/students/vocab#>

CONSTRUCT
  { ?S :follows ?C }

WHERE
  { ?C :students ?L. ?S list:in ?L }

The predicate list:in is true iff the object is a list and the subject is in that list. One way to test the list:in relationship is via ruleset [RPO-RULES] that  are loaded with the RDF dataset  in inference engines such as [CWM] and [EULER]. That way the command line cwm students.n3 rpo-rules.n3 -think -sparql=students.rq will return the RDF/N3 graph

     @prefix : <http://example.org/students/vocab#> .
   
    <http://example.org/students/Amy>     :follows <http://example.org/courses/6.001> .
   
    <http://example.org/students/Johann>     :follows <http://example.org/courses/6.001> .
   
    <http://example.org/students/Mohamed>     :follows <http://example.org/courses/6.001> .