{"action":"closed","issue":{"url":"https://api.github.com/repos/dhlab-basel/Knora/issues/78","repository_url":"https://api.github.com/repos/dhlab-basel/Knora","labels_url":"https://api.github.com/repos/dhlab-basel/Knora/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/dhlab-basel/Knora/issues/78/comments","events_url":"https://api.github.com/repos/dhlab-basel/Knora/issues/78/events","html_url":"https://github.com/dhlab-basel/Knora/issues/78","id":139047470,"number":78,"title":"Ontology query returns no results with GraphDB when repository created with inference","user":{"login":"benjamingeer","id":558389,"avatar_url":"https://avatars.githubusercontent.com/u/558389?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamingeer","html_url":"https://github.com/benjamingeer","followers_url":"https://api.github.com/users/benjamingeer/followers","following_url":"https://api.github.com/users/benjamingeer/following{/other_user}","gists_url":"https://api.github.com/users/benjamingeer/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamingeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamingeer/subscriptions","organizations_url":"https://api.github.com/users/benjamingeer/orgs","repos_url":"https://api.github.com/users/benjamingeer/repos","events_url":"https://api.github.com/users/benjamingeer/events{/privacy}","received_events_url":"https://api.github.com/users/benjamingeer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dhlab-basel/Knora/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"benjamingeer","id":558389,"avatar_url":"https://avatars.githubusercontent.com/u/558389?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamingeer","html_url":"https://github.com/benjamingeer","followers_url":"https://api.github.com/users/benjamingeer/followers","following_url":"https://api.github.com/users/benjamingeer/following{/other_user}","gists_url":"https://api.github.com/users/benjamingeer/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamingeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamingeer/subscriptions","organizations_url":"https://api.github.com/users/benjamingeer/orgs","repos_url":"https://api.github.com/users/benjamingeer/repos","events_url":"https://api.github.com/users/benjamingeer/events{/privacy}","received_events_url":"https://api.github.com/users/benjamingeer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dhlab-basel/Knora/milestones/1","html_url":"https://github.com/dhlab-basel/Knora/milestones/On%20Deck","labels_url":"https://api.github.com/repos/dhlab-basel/Knora/milestones/1/labels","id":1549435,"number":1,"title":"On Deck","description":null,"creator":{"login":"benjamingeer","id":558389,"avatar_url":"https://avatars.githubusercontent.com/u/558389?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamingeer","html_url":"https://github.com/benjamingeer","followers_url":"https://api.github.com/users/benjamingeer/followers","following_url":"https://api.github.com/users/benjamingeer/following{/other_user}","gists_url":"https://api.github.com/users/benjamingeer/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamingeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamingeer/subscriptions","organizations_url":"https://api.github.com/users/benjamingeer/orgs","repos_url":"https://api.github.com/users/benjamingeer/repos","events_url":"https://api.github.com/users/benjamingeer/events{/privacy}","received_events_url":"https://api.github.com/users/benjamingeer/received_events","type":"User","site_admin":false},"open_issues":52,"closed_issues":54,"state":"open","created_at":"2016-01-28T16:58:42Z","updated_at":"2016-05-02T12:36:27Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-03-07T17:59:35Z","updated_at":"2016-05-02T12:36:27Z","closed_at":"2016-05-02T12:36:27Z","body":"Here's a simplified example based on the ontology responder's cardinality query.\r\n\r\n### Sample data\r\n\r\n```\r\n    prefix base: <http://www.example.org/base#>\r\n    prefix project: <http://www.example.org/project#>\r\n\r\n    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\r\n    PREFIX owl: <http://www.w3.org/2002/07/owl#>\r\n    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\r\n    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\r\n\r\n    INSERT DATA {\r\n       \r\n        # Base ontology\r\n\r\n        base:seqnum rdf:type owl:DatatypeProperty .\r\n\r\n        base:Resource rdf:type owl:Class ;\r\n            rdfs:subClassOf [ rdf:type owl:Restriction ;\r\n                              owl:onProperty base:seqnum ;\r\n                              owl:maxCardinality \"1\"^^xsd:nonNegativeInteger\r\n                            ] .\r\n       \r\n        base:hasFileValue rdf:type owl:ObjectProperty .\r\n\r\n        base:hasStillImageFileValue rdf:type owl:ObjectProperty ;\r\n            rdfs:subPropertyOf base:hasFileValue .\r\n       \r\n        base:Representation rdf:type owl:Class ;\r\n            rdfs:subClassOf base:Resource ,\r\n                            [ rdf:type owl:Restriction ;\r\n                              owl:onProperty base:hasFileValue ;\r\n                              owl:minCardinality \"1\"^^xsd:nonNegativeInteger\r\n                            ] .\r\n       \r\n        base:StillImageRepresentation rdf:type owl:Class ;\r\n            rdfs:subClassOf base:Representation  ,\r\n                [ rdf:type owl:Restriction ;\r\n                  owl:onProperty base:hasStillImageFileValue ;\r\n                  owl:minCardinality \"1\"^^xsd:nonNegativeInteger\r\n                ] .\r\n\r\n        # Project-specific ontology\r\n       \r\n        project:seqnum rdf:type owl:DatatypeProperty ;\r\n            rdfs:subPropertyOf base:seqnum .\r\n       \r\n        project:page rdf:type owl:Class ;\r\n            rdfs:subClassOf base:StillImageRepresentation ,\r\n                            [\r\n                              rdf:type owl:Restriction ;\r\n                              owl:onProperty project:seqnum ;\r\n                              owl:maxCardinality \"1\"^^xsd:nonNegativeInteger\r\n                            ] .\r\n    }\r\n```\r\n\r\n### Query\r\n\r\n```\r\n    prefix base: <http://www.example.org/base#>\r\n    prefix project: <http://www.example.org/project#>\r\n\r\n    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\r\n    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\r\n    PREFIX owl: <http://www.w3.org/2002/07/owl#>\r\n\r\n    SELECT ?class ?cardinalityProp ?cardinalityVal WHERE {\r\n        project:page rdfs:subClassOf* ?class .\r\n\r\n        ?class rdfs:subClassOf ?restriction .\r\n        ?restriction a owl:Restriction .\r\n        ?restriction owl:onProperty ?cardinalityProp .\r\n        ?restriction ?cardinality ?cardinalityVal .\r\n        FILTER(?cardinality = owl:cardinality || ?cardinality = owl:minCardinality || ?cardinality = owl:maxCardinality)\r\n\r\n        MINUS {\r\n            project:page rdfs:subClassOf* ?otherClass .\r\n            ?otherClass rdfs:subClassOf+ ?class .\r\n            ?otherClass rdfs:subClassOf ?otherRestriction .\r\n            ?otherRestriction a owl:Restriction .\r\n            ?otherRestriction owl:onProperty ?otherProperty .\r\n            ?otherProperty rdfs:subPropertyOf* ?cardinalityProp .\r\n        }\r\n    }\r\n```\r\n\r\n### Results\r\n\r\nWhen the repository has been created with the rule-set option \"No inference\", I get these results:\r\n\r\n| class                                                | cardinalityProp                                    | cardinalityVal              |\r\n|------------------------------------------------------|----------------------------------------------------|-----------------------------|\r\n| http://www.example.org/project#page                  | http://www.example.org/project#seqnum              | \"1\"^^xsd:nonNegativeInteger |\r\n| http://www.example.org/base#StillImageRepresentation | http://www.example.org/base#hasStillImageFileValue | \"1\"^^xsd:nonNegativeInteger |\r\n\r\nWhen the repository has been created with RDFS inference, and I then turn off inference for the update operation and for the SELECT query in the GraphDB Workbench, I get no results.\r\n\r\nI've emailed Ontotext about it.\r\n"}}