{"action":"created","issue":{"url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/465","repository_url":"https://api.github.com/repos/openlink/virtuoso-opensource","labels_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/465/comments","events_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/465/events","html_url":"https://github.com/openlink/virtuoso-opensource/issues/465","id":102162868,"number":465,"title":"OPTIONAL not working correctly in CONSTRUCT, works OK in SELECT","user":{"login":"jakubklimek","id":718827,"avatar_url":"https://avatars.githubusercontent.com/u/718827?v=3","gravatar_id":"","url":"https://api.github.com/users/jakubklimek","html_url":"https://github.com/jakubklimek","followers_url":"https://api.github.com/users/jakubklimek/followers","following_url":"https://api.github.com/users/jakubklimek/following{/other_user}","gists_url":"https://api.github.com/users/jakubklimek/gists{/gist_id}","starred_url":"https://api.github.com/users/jakubklimek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakubklimek/subscriptions","organizations_url":"https://api.github.com/users/jakubklimek/orgs","repos_url":"https://api.github.com/users/jakubklimek/repos","events_url":"https://api.github.com/users/jakubklimek/events{/privacy}","received_events_url":"https://api.github.com/users/jakubklimek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-20T15:16:58Z","updated_at":"2016-02-22T14:49:43Z","closed_at":null,"body":"Commit: 1b42443a6312189bc5efa842cd45d2740336e78a\r\nDatabase: http://linked.opendata.cz/dump/dberr.zip\r\n\r\nIn the database, we have a triple\r\n```\r\n<http://linked.opendata.cz/resource/sukl/medicinal-product-packaging/0132829> dcterms:title \"AMOKSIKLAV 1,2 G\"@cs .\r\n```\r\nUsing the SPARQL endpoint,\r\n\r\nThis works and returns that triple:\r\n```\r\nPREFIX r: <http://linked.opendata.cz/resource/sukl/medicinal-product-packaging/0132829>\r\n\r\nCONSTRUCT {\r\n  r: r: ?t .\r\n}\r\n WHERE {\r\n  OPTIONAL {\r\n    r: dcterms:title ?t .\r\n  }\r\n  OPTIONAL {\r\n    r: skos:prefLabel ?l .\r\n  }\r\n}\r\n```\r\nThis does not work - returns an empty turtle, should have returned the same as above:\r\n```\r\nPREFIX r: <http://linked.opendata.cz/resource/sukl/medicinal-product-packaging/0132829>\r\n\r\nCONSTRUCT {\r\n  r: r: ?t , ?l .\r\n}\r\n WHERE {\r\n  OPTIONAL {\r\n    r: dcterms:title ?t .\r\n  }\r\n  OPTIONAL {\r\n    r: skos:prefLabel ?l .\r\n  }\r\n}\r\n```\r\nHowever, changing CONSTRUCT to SELECT works again (returns ?t and ?l is null):\r\n```\r\nPREFIX r: <http://linked.opendata.cz/resource/sukl/medicinal-product-packaging/0132829>\r\n\r\nSELECT ?t ?l\r\n WHERE {\r\n  OPTIONAL {\r\n    r: dcterms:title ?t .\r\n  }\r\n  OPTIONAL {\r\n    r: skos:prefLabel ?l .\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/comments/187213672","html_url":"https://github.com/openlink/virtuoso-opensource/issues/465#issuecomment-187213672","issue_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/465","id":187213672,"user":{"login":"m1ci","id":977735,"avatar_url":"https://avatars.githubusercontent.com/u/977735?v=3","gravatar_id":"","url":"https://api.github.com/users/m1ci","html_url":"https://github.com/m1ci","followers_url":"https://api.github.com/users/m1ci/followers","following_url":"https://api.github.com/users/m1ci/following{/other_user}","gists_url":"https://api.github.com/users/m1ci/gists{/gist_id}","starred_url":"https://api.github.com/users/m1ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1ci/subscriptions","organizations_url":"https://api.github.com/users/m1ci/orgs","repos_url":"https://api.github.com/users/m1ci/repos","events_url":"https://api.github.com/users/m1ci/events{/privacy}","received_events_url":"https://api.github.com/users/m1ci/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T14:49:43Z","updated_at":"2016-02-22T14:49:43Z","body":"just faced with the same issue.\r\n@jakubklimek any workaround to suggest?"}}