({{, RDFCollection[{(Subscript[e, 1]),(Subscript[e, 2]),…}] 
represents a list-like collection of the (Subscript[e, i]) in functions like (PackageLink[RDFStore, paclet:GraphStore/ref/RDFStore, GraphStore Package Symbol]) and (PackageLink[SPARQLSelect, paclet:GraphStore/ref/SPARQLSelect, GraphStore Package Symbol]).}})

OpenersNotesSection(Spacer1)Details

The RDF collection vocabulary includes the following terms:

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Needs["GraphStore`"]

Specify a graph which lists the favorite fruits of Bob:

ex[s_]:=IRI["http://example.org/"<>s];

RDFStore[{
RDFTriple[ex["bob"],ex["favoriteFruits"],RDFCollection[{ex["mango"],ex["strawberry"]}]]
}]

OpenersExampleSection1(Spacer1)Scope  (2)

Needs["GraphStore`"]

Specify an RDF graph containing a collection of letters:

rdf[s_]:=IRI["http://www.w3.org/1999/02/22-rdf-syntax-ns#"<>s];
ex[s_]:=IRI["http://example.org/"<>s];

g=RDFStore[{
RDFTriple[ex["a"],ex["list"],RDFCollection[{"a","b","c"}]]
}];

Check whether there is any collection that contains three elements:

g//SPARQLAsk[RDFTriple[SPARQLVariable["x"],SPARQLVariable["y"],RDFCollection[{SPARQLVariable["e1"],SPARQLVariable["e2"],SPARQLVariable["e3"]}]]]

Retrieve the middle element:

g//SPARQLSelect[RDFTriple[SPARQLVariable["x"],SPARQLVariable["y"],RDFCollection[{SPARQLVariable["e1"],SPARQLVariable["e2"],SPARQLVariable["e3"]}]]->"e2"]

Retrieve all elements:

g//SPARQLSelect[{
RDFTriple[ex["a"],ex["list"],SPARQLVariable["l"]],
SPARQLPropertyPath[SPARQLVariable["l"],{rdf["rest"]...,rdf["first"]},SPARQLVariable["x"]]
}->"x"]

Needs["GraphStore`"]

Specify an RDF graph in two different ways:

rdf[s_]:=IRI["http://www.w3.org/1999/02/22-rdf-syntax-ns#"<>s];
ex[s_]:=IRI["http://example.org/"<>s];

g1=RDFStore[{
RDFTriple[ex["a"],ex["list"],RDFCollection[{1,2}]]
}];

g2=RDFStore[{
RDFTriple[ex["a"],ex["list"],RDFBlankNode["a"]],
RDFTriple[RDFBlankNode["a"],rdf["first"],1],
RDFTriple[RDFBlankNode["a"],rdf["rest"],RDFBlankNode["b"]],
RDFTriple[RDFBlankNode["b"],rdf["first"],2],
RDFTriple[RDFBlankNode["b"],rdf["rest"],rdf["nil"]]
}];

The RDF graphs are isomorphic:

iso=SelectFirst[
AssociationThread[
Cases[First[g2],_RDFBlankNode,{2}],
#
]&/@Permutations[Cases[First[g1],_RDFBlankNode,{2}]],
ContainsExactly[First[g1],First[g2]/.#]&
]

ContainsExactly[First[g1],First[g2]/.iso]

OpenersExampleSection3(Spacer1)Possible Issues  (1)

Needs["GraphStore`"]

RDF has no built-in list datatype:

ex[s_]:=IRI["http://example.org/"<>s];

ExportString[
RDFStore[{
RDFTriple[ex["a"],ex["numberList"],{1,2}]
}],
"Turtle"
]

Use an RDF collection instead:

ExportString[
RDFStore[{
RDFTriple[ex["a"],ex["numberList"],RDFCollection[{1,2}]]
}],
"Turtle",
"Prefixes"-><|"ex"->"http://example.org/"|>
]

Alternatively, choose a non-list-valued property and assign multiple values to it:

ExportString[
RDFStore[{
RDFTriple[ex["a"],ex["number"],1],
RDFTriple[ex["a"],ex["number"],2]
}],
"Turtle",
"Prefixes"-><|"ex"->"http://example.org/"|>
]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(PackageLink[RDFStore, paclet:GraphStore/ref/RDFStore, GraphStore Package Symbol])  ▪  (PackageLink[SPARQLSelect, paclet:GraphStore/ref/SPARQLSelect, GraphStore Package Symbol])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic RDF Structures, paclet:GraphStore/guide/RDFConcepts])}, {▪(RefLinkPlain[Graph Store Overview, paclet:GraphStore/guide/GraphStoreOverview])}})}})