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: <> .
@prefix rdf: <> .
@prefix : <> .

:students rdfs:range rdf:List.

<>     :students  (
    <>  ) .

The SPARQL query to be answered looks like

PREFIX list: <>

  { ?S :follows ?C }

  { ?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 : <> .
    <>     :follows <> .
    <>     :follows <> .
    <>     :follows <> .