我希望问题已经得到解决,但是为了它,它应该可以工作,你能否提供一组这样的数据(如果我理解你的意图):
创建测试数据,<http://example/shelf_A>
使用两个资源创建一个图,一个作者和一本引用该作者的书:
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> .
}
}
我们用引用该作者的书籍创建第二个图表,并声明它们在上一个图表中:
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"
}
结果是两个图表:
图http://example/shelf_A
:
http://example/author dcterms:name author
http://example/book dcterms:author http://example/author
http://example/book dcterms:title book
图http://example/shelf_B
:
http://example/book dcterms:provenance <http://example/shelf_A>