Here are some examples showcasing Virtuoso's support for this functionality:
<http://people.example/alice> <http://people.example/name> "Alice", "Alice Foo", "A. Foo" . <http://people.example/alice> <http://people.example/knows> <http://people.example/bob> , <http://people.example/carol> . <http://people.example/bob> <http://people.example/name> "Bob", "Bob Bar", "B. Bar" . <http://people.example/carol> <http://people.example/name> "Carol", "Carol Baz", "C. Baz" .
<#alice> <#name> "Alice" . <#alice> <#name> "Alice Foo" . <#alice> <#name> "A. Foo" . <#alice> <http://xmlns.com/foaf/0.1/knows> <#bob>, <#carol> . <#bob> <#name> "Bob" . <#bob> <#name> "Bob Bar" . <#bob> <#name> "B. Bar" . <#carol> <#name> "Carol" . <#carol> <#name> "Carol Baz" . <#carol> <#name> "C. Baz" .
INSERT { GRAPH <urn:sparql:tests:subquery> { <#alice> <#name> "Alice" . <#alice> <#name> "Alice Foo" . <#alice> <#name> "A. Foo" . <#alice> <http://xmlns.com/foaf/0.1/knows> <#bob>, <#carol> . <#bob> <#name> "Bob" . <#bob> <#name> "Bob Bar" . <#bob> <#name> "B. Bar" . <#carol> <#name> "Carol" . <#carol> <#name> "Carol Baz" . <#carol> <#name> "C. Baz" . } }
SELECT ?y ?minName WHERE { <#alice> <http://xmlns.com/foaf/0.1/knows> ?y . { SELECT ?y (MIN(?name) AS ?minName) WHERE { ?y <#name> ?name . } GROUP BY ?y } }