I'm trying to run a query across multiple named graphs, returning the name of the graph as a column in the result set. I tried using VALUES from the SPARQL 1.1 W3 draft:

SELECT *
WHERE
{ 
    VALUES ?graph { <graph1> <graph2> <graph3> }
    GRAPH ?graph
    { 
        ?s  ?p  ?o .
    }
}

In Virtuoso this results in an error (syntax error at 'VALUES' before '?graph'). Does Virtuoso support VALUES? If not, what is the alternative?

asked 22 Nov '12, 15:10

bcoughlan's gravatar image

bcoughlan
635
accept rate: 0%


Try:

SELECT *
FROM NAMED <graph1>
FROM NAMED <graph2>
FROM NAMED <graph3>
WHERE
{ 
    GRAPH ?graph
    { 
        ?s  ?p  ?o .
    }
}

Does that do what you want?

permanent link
This answer is marked "community wiki".

answered 22 Nov '12, 20:10

lee's gravatar image

lee
3.2k39
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,276
×195

question asked: 22 Nov '12, 15:10

question was seen: 756 times

last updated: 22 Nov '12, 20:10