I hope that the problem as been fixed since, but for the sake of it, it should work, could you provide a set of data like this (if I understand your intention):
creation of the test data, a graph <http://example/shelf_A>
is created with two resources, an author and a book referring to this author:
PREFIX dcterms: <http://purl.org/dc/terms/>
INSERT DATA {
# create graph <http://example/shelf_A> if it doesn't exist
GRAPH <http://example/shelf_A> {
# add triple (http://example/author, name, author)
<http://example/author> dcterms:name "author" .
# add triples (http://example/book, title, book)
# and (http://example/book, author, http://example/author)
<http://example/book> dcterms:title "book" ;
dcterms:author <http://example/author> .
}
}
we create a second graph with the books referring to this author and state that they are in the previous graph:
PREFIX dcterms: <http://purl.org/dc/terms/>
INSERT
{
# create graph is it doesn't exist
GRAPH <http://example/shelf_B> {
# add the triple (?bood, provenance, http://example/shelf_A)
# ?book comes from the request below
?book dcterms:provenance <http://example/shelf_A>
}
}
WHERE
{
# select all books (?book) which have an author
# and this author is named "author"
?book dcterms:author ?author .
?author dcterms:name "author"
}
the result are two graphs:
graph http://example/shelf_A
:
http://example/author dcterms:name author
http://example/book dcterms:author http://example/author
http://example/book dcterms:title book
graph http://example/shelf_B
:
http://example/book dcterms:provenance <http://example/shelf_A>