owlcs / jfact

JFact repository
13 stars 8 forks source link

"test@"^^PlainLiteral and "test"^^xsd:string are supposed to be equivalent #8

Closed ignazio1977 closed 8 years ago

ignazio1977 commented 9 years ago

This was reported by @matentzn and validated by @tsarkov

The following test should pass:

OWLOntology o = m.createOntology();
OWLDataProperty p = df.getOWLDataProperty(IRI.create("urn:test:p"));
m.addAxiom(o, df.getOWLFunctionalDataPropertyAxiom(p));
OWLNamedIndividual i = df.getOWLNamedIndividual(IRI.create("urn:test:i"));
m.addAxiom(o, df.getOWLDataPropertyAssertionAxiom(p, i, df.getOWLLiteral("test")));
m.addAxiom(o, df.getOWLDataPropertyAssertionAxiom(p, i, df.getOWLLiteral("test", "")));
m.addAxiom(o, df.getOWLDataPropertyAssertionAxiom(p, i, df.getOWLLiteral("test", OWL2Datatype.RDF_PLAIN_LITERAL)));
m.addAxiom(o, df.getOWLDataPropertyAssertionAxiom(p, i, df.getOWLLiteral("test", OWL2Datatype.XSD_STRING)));
OWLReasoner r = new JFactFactory().createReasoner(o);
assertTrue(r.isConsistent());
ansell commented 9 years ago

How does that relate to RDF-1.1 support where PlainLiteral disappears and everything becomes xsd:string?

Naively, it seems like if the PlainLiteral<->xsd:string equivalence is already required by OWL-2 then RDF-1.1 should not conflict with it at all.

ignazio1977 commented 9 years ago

Bad choice of words on my side. PlainLiteral is meant to be an ancestor of xsd:string. I haven't been able to locate an official document detailing this; however, if confirmed, my view is the same as yours: RDF 1.1 support is a lot simpler. I'll take another look at your patch soon.

ansell commented 9 years ago

My patch is probably horribly out of date at this point, but I can regenerate it if necessary when there is a target version for RDF-1.1 support. Until then, stick to Sesame-2.7 for Rio integration. Sesame-2.8 has RDF-1.1 so PlainLiteral's will appear as xsd:string with no way to distinguish them at the in-memory Sesame Literal level.