{"action":"created","issue":{"url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/514","labels_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/514/comments","events_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/514/events","html_url":"https://github.com/openlink/virtuoso-opensource/issues/514","id":123278395,"number":514,"title":"Property path query not executed properly","user":{"login":"LorenzBuehmann","id":976029,"avatar_url":"https://avatars.githubusercontent.com/u/976029?v=3","gravatar_id":"","url":"https://api.github.com/users/LorenzBuehmann","html_url":"https://github.com/LorenzBuehmann","followers_url":"https://api.github.com/users/LorenzBuehmann/followers","following_url":"https://api.github.com/users/LorenzBuehmann/following{/other_user}","gists_url":"https://api.github.com/users/LorenzBuehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/LorenzBuehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LorenzBuehmann/subscriptions","organizations_url":"https://api.github.com/users/LorenzBuehmann/orgs","repos_url":"https://api.github.com/users/LorenzBuehmann/repos","events_url":"https://api.github.com/users/LorenzBuehmann/events{/privacy}","received_events_url":"https://api.github.com/users/LorenzBuehmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-21T13:18:41Z","updated_at":"2015-12-24T15:48:16Z","closed_at":null,"body":"Hi,\r\n\r\nI'm currently playing aournd with SPARQL 1.1 Property Paths, and just found a problem with this toy query on DBpedia (http://dbpedia.org/sparql) which is based on Virtuoso version 07.20.3215 on Linux (i686-generic-linux-glibc212-64), Single Server Edition:\r\n\r\n```\r\nselect * where {?s <foo>|!<foo> ?o.} limit 10\r\n```\r\nIt's not meaningful but should indeed just return some subjects and objects that are related by some predicate.\r\n\r\nThe exception I get:\r\n```\r\nVirtuoso 37000 Error SP031: SPARQL compiler: The list of return values contains '*' but the pattern does not contain variables\r\n\r\nSPARQL query:\r\ndefine sql:big-data-const 0 \r\n#output-format:text/html\r\ndefine sql:signal-void-variables 1 define input:default-graph-uri <http://dbpedia.org> select * where {dbr:Berlin <foo>|!<foo> ?o.} limit 10\r\n```\r\n[click](http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&qtxt=select+*+where+%7B%3Fs+%3Cfoo%3E%7C%21%3Cfoo%3E+%3Fo.%7D+limit+10&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=10000&debug=on)\r\n\r\nIt also fails when I bind the subject to a specific resource and use ?o as projection variable, e.g. \r\n```\r\nselect ?o where {dbr:Berlin <foo>|!<foo> ?o.} limit 10\r\n```\r\n[click](http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&qtxt=select+?o+where+%7Bdbr%3ABerlin+%3Cfoo%3E%7C%21%3Cfoo%3E+%3Fo.%7D+limit+10&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=10000&debug=on)"},"comment":{"url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/comments/167128622","html_url":"https://github.com/openlink/virtuoso-opensource/issues/514#issuecomment-167128622","issue_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/514","id":167128622,"user":{"login":"kidehen","id":1541745,"avatar_url":"https://avatars.githubusercontent.com/u/1541745?v=3","gravatar_id":"","url":"https://api.github.com/users/kidehen","html_url":"https://github.com/kidehen","followers_url":"https://api.github.com/users/kidehen/followers","following_url":"https://api.github.com/users/kidehen/following{/other_user}","gists_url":"https://api.github.com/users/kidehen/gists{/gist_id}","starred_url":"https://api.github.com/users/kidehen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kidehen/subscriptions","organizations_url":"https://api.github.com/users/kidehen/orgs","repos_url":"https://api.github.com/users/kidehen/repos","events_url":"https://api.github.com/users/kidehen/events{/privacy}","received_events_url":"https://api.github.com/users/kidehen/received_events","type":"User","site_admin":false},"created_at":"2015-12-24T15:48:16Z","updated_at":"2015-12-24T15:48:16Z","body":"On 12/24/15 10:04 AM, Lorenz Bühmann wrote:\n>\n> That's not what I meant, looks like you did not get my updated comment.\n>\n> Of course I could also use another SPARQL query to get all objects\n> that are connected to a specific resource. But that's not the problem\n> here. But, let me explain it again in more details:\n>\n> I'm playing around with property paths because it allows to simulate\n> some kind of graph operations, e.g. whether there is a path between\n> two nodes. I know that this can be expensive.\n>\n> According to SPARQL 1.1 property paths, it's not possible to use\n> variables in that position.\n> But, it's theoretically possible to use a workaround by use the\n> disjunction of any property and the negation of the same property.\n> Let's use the property |<p>|, then we have\n>\n> |select distinct ?o where {dbr:Berlin <p>|!<p> ?o} |\n>\n> with an empty result (see here\n> <http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&qtxt=select+distinct+%3Fo+where+%7Bdbr%3ABerlin+%3Cp%3E%7C%21%3Cp%3E+%3Fo%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on>).\n> The query looks correct for me and from what I understand w.r.t.\n> property paths, it should return anything that is connected to\n> dbr:Berlin because\n> 1. I know that the property |<p>|does not exist\n> 2. and moreover the second option of the property both disjunction has\n> to match.\n>\n> Note that it also doesn't work for any existing property, e.g.\n> |rdfs:label|, i.e.\n>\n> |select distinct ?o where {dbr:Berlin rdfs:label|!rdfs:label ?o} |\n>\n> (see here\n> <http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&qtxt=select+distinct+%3Fo+where+%7Bdbr%3ABerlin+rdfs%3Alabel%7C%21rdfs%3Alabel+%3Fo%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000>)\n>\n> Maybe Virtuoso is trying to do some kind of optimization because if I\n> use two different properties - regardless of whether it exists or not\n> - it works, because then the second part of the disjunction matches\n> for sure:\n>\n> |select distinct ?o where {dbr:Berlin <p1>|!<p2> ?o} |\n>\n> (see here\n> <http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&qtxt=select+distinct+%3Fo+where+%7Bdbr%3ABerlin+%3Cp1%3E%7C%21%3Cp2%3E+%3Fo%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000>)\n>\n> Sorry for the confusion and thank you for the support in any case!\n>\n\nThis is the correct link with solution based on strict checking of void\nvariables disabled:\n\nhttp://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select+distinct+%3Fo+where+%7Bdbr%3ABerlin+%3Cp1%3E%7C%21%3Cp2%3E+%3Fo%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000\n\nAnyway, we need to look at this matter a little closer. It has been\nescalated.\n\n-- \nRegards,\n\nKingsley Idehen\t      \nFounder & CEO \nOpenLink Software     \nCompany Web: http://www.openlinksw.com\nPersonal Weblog 1: http://kidehen.blogspot.com\nPersonal Weblog 2: http://www.openlinksw.com/blog/~kidehen\nTwitter Profile: https://twitter.com/kidehen\nGoogle+ Profile: https://plus.google.com/+KingsleyIdehen/about\nLinkedIn Profile: http://www.linkedin.com/in/kidehen\nPersonal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this\n\n"}}