Question

I'm trying to use SPARQL 1.1 property paths with VirtuosoOS 6.1 but something is wrong. I use the next graph:

@prefix foo: <foo/> .
@prefix bar: <bar/> .
@prefix type: <type/> .

bar:a1 type:read foo:b1 .
bar:a1 type:write foo:b2 .
bar:a1 type:write foo:b3 .
bar:a2 type:read foo:b4 .
bar:a2 type:write foo:b5 .
bar:a3 type:write foo:b6 .
foo:b2 type:link foo:b4 .
foo:b4 type:link foo:b6 .

I want to find all "linked" "foo"s that start from x, where x is bar:a1 ---(type:write)--> x. Obviously the answer is foo:b4 and foo:b6.

So, I use this query

prefix bar: <bar/>
prefix type: <type/>

select ?y where {
    bar:a1 type:write ?x .
    ?x type:link+ ?y
}

But Virtuoso says

Virtuoso 37000 Error SP030: SPARQL compiler, line 8: syntax error at '?y' before '}'

What is wrong with my query? Maybe Virtuoso doesn't support this feature?

Was it helpful?

Solution

You can check whether your query is legal syntax with the query validator at sparql.org. Your query is well-formed, so this is an issue with Virtuoso support. According to Does Virtuoso versions <=6.0 support SPARQL 1.1?, you can get SPARQL 1.1 support through extensions in earlier versions, and that 6.2 and onward support SPARQL 1.1 without need for extensions. According to the official Virtuoso Open-Source Edition page, it looks like versions 6.1.7 and 7.0.0 should have support for property paths.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top