{"action":"opened","issue":{"url":"https://api.github.com/repos/owlcs/owlapi/issues/576","repository_url":"https://api.github.com/repos/owlcs/owlapi","labels_url":"https://api.github.com/repos/owlcs/owlapi/issues/576/labels{/name}","comments_url":"https://api.github.com/repos/owlcs/owlapi/issues/576/comments","events_url":"https://api.github.com/repos/owlcs/owlapi/issues/576/events","html_url":"https://github.com/owlcs/owlapi/issues/576","id":189717194,"number":576,"title":"OWL2DatatypeImpl.isTopEntity() compares with RDF_PLAIN_LITERAL","user":{"login":"redmitry","id":6804872,"avatar_url":"https://avatars.githubusercontent.com/u/6804872?v=3","gravatar_id":"","url":"https://api.github.com/users/redmitry","html_url":"https://github.com/redmitry","followers_url":"https://api.github.com/users/redmitry/followers","following_url":"https://api.github.com/users/redmitry/following{/other_user}","gists_url":"https://api.github.com/users/redmitry/gists{/gist_id}","starred_url":"https://api.github.com/users/redmitry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redmitry/subscriptions","organizations_url":"https://api.github.com/users/redmitry/orgs","repos_url":"https://api.github.com/users/redmitry/repos","events_url":"https://api.github.com/users/redmitry/events{/privacy}","received_events_url":"https://api.github.com/users/redmitry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-16T14:19:07Z","updated_at":"2016-11-16T14:19:07Z","closed_at":null,"body":"Hello,\r\n\r\nOWL2DatatypeImpl compares with RDF_PLAIN_LITERAL instead of RDF_LITERAL to check whether it is a \"top\" datatype.\r\n\r\nThis leads to error in my case with unqualified exact cardinality, where \r\n\r\n`dataFactory.getOWLDataExactCardinality((1, dataProperty)`\r\n\r\nleads to:\r\n\r\n```\r\n<owl:Restriction>\r\n  <owl:onProperty rdf:resource=\"http://es.elixir.bsc.xs2owl#age\"/>\r\n    <owl:qualifiedCardinality rdf:datatype=\"http://www.w3.org/2001/XMLSchema#nonNegativeInteger\">1</owl:qualifiedCardinality>\r\n  <owl:onDataRange rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#Literal\"/>\r\n</owl:Restriction>\r\n```\r\n\r\nThe problem is that in OWLDataFactoryImpl the TopDatatype is added (InternalizedEntities.RDFSLITERAL).\r\n\r\n```\r\npublic OWLDataExactCardinality getOWLDataExactCardinality(int cardinality, OWLDataPropertyExpression property) {\r\n        return new OWLDataExactCardinalityImpl(property, cardinality, getTopDatatype());\r\n}\r\n\r\n```\r\nbut in time of serialization (AbstractTranslator):\r\n\r\n```\r\nprivate void addDataCardinalityRestrictionTriples(OWLCardinalityRestriction<OWLDataRange> ce,\r\n        OWLPropertyExpression p, OWLRDFVocabulary cardiPredicate) {\r\n    if (ce.isQualified()) {\r\n        if (ce.isObjectRestriction()) {\r\n            addTriple(ce, OWL_ON_CLASS.getIRI(), ce.getFiller());\r\n        } else {\r\n            addTriple(ce, OWL_ON_DATA_RANGE.getIRI(), ce.getFiller());\r\n        }\r\n    }\r\n}\r\n```\r\nisQualified() returns false."}}
{"actor":{"display_login":"redmitry"}}