Warm tip: This article is reproduced from serverfault.com, please click

Inconsistency in RDFS entailment regime

发布于 2021-01-29 16:25:53

The document for SPARQL 1.1 Entailment Regimes asserts that it is possible to produce an inconsistent graph, moreover there is a single source of the inconsistency: rdf:XMLLiteral:

ex:a ex:b "<"^^rdf:XMLLiteral .
ex:b rdfs:range rdf:XMLLiteral .

The reasoning is that < is not a valid XML fragment and thus "<"^^rdf:XMLLiteral must be interpreted as something that is not in rdfs:Literal (apparently). This seems somewhat arbitrary and complicated, so I have the following questions:

  • Why cannot "<"^^rdf:XMLLiteral be simply interpreted as "<"? It makes sense that it is not an XML literal, but why cannot it be a literal at all?
  • Why only rdf:XMLLiteral and not for example xsd:boolean or other datatypes? There are lots of inconsistencies that can be found if we start validating common datatypes.
  • Since RDF 1.1, I understand rdf:XMLLiteral is non-normative. Does it mean that newer interpretations of RDFS are always consistent?
  • Was this rule ever implemented in practice, and are there some SPARQL endpoints that may (still) reject RDFS-inconsistent graphs?
Questioner
IS4
Viewed
0
Antoine Zimmermann 2021-02-15 07:19:15

SPARQL 1.1 Entailment regimes, standardised in March 2013, is based on RDF Semantics from the 2004 standard (which I will refer to as RDF 1.0). In RDF 1.0, RDFS entailment does not impose that datatype URIs are interpreted as datatypes, but it assigns a special semantics to rdf:XMLLiteral and literals that have this datatype URI. Other literals are not constrained in any ways by their datatype URIs, therefore xsd:boolean, for instance, doesn't influence the consistency in RDFS entailment. In fact, RDF entailment imposes the special treatment of rdf:XMLLiteral, which carries on to RDFS entailment.

In order to find additional inconsistencies due to datatypes, you have to consider another entailment regime like D-entailment or OWL. In RDF 1.0, D-entailment was defined as an extension of RDFS, so there is no "validating common datatypes" in RDFS. This should answer your second question.

Further, "<"^^rdf:XMLLiteral is an ill-typed XML literal, so it must not be interpreted as an XML value and, by constraints on RDF entailment, its interpretation must not be of type rdf:XMLLiteral, that is, more formally, the pair (IL("<"^^rdf:XMLLiteral),IS(rdf:XMLLiteral)), composed of the interpretation of literal "<"^^rdf:XMLLiteral and of the interpretation of URI rdf:XMLLiteral, must not be in the extension IEXT(IS(rdf:type)) of property rdf:type. Also, ill-typed XML literals must not be equal to any literal values, which necessarily includes the plain literal values (UNICODE strings and language-tagged strings), so it cannot denote the string "<". The reason is that we don't want that ill-typed literals denote the same value as some well formed literals. This should answer your first question.

In 2014, RDF 1.1 was standardised with an updated semantics. D-entailment is no longer an extension of RDFS entailment. It is the other way around: RDFS entailment is defined with respect to a set D of recognized datatype IRIs. This means that RDFS entailment is no longer a single entailment regime, but a family of entailment regimes, parameterised by D. In its simplest instance, RDFS entailment must only recognise xsd:string and rdf:langString, which means that there can still be inconsistencies, because not all UNICODE strings are valid XSD strings. Also, RDF 1.1 changed the interpretation of ill-typed literals. In RDF 1.1 Semantics, ill-typed literals do not denote anything. This means that you cannot even talk about them. As soon as there is an ill-typed literal in an RDF graph, the graph is inconsistent. Therefore:

<s>  <p>  "\u0000"^^xsd:string .

is inconsistent in RDFS 1.1 entailment regimes. This should answer your third question.

Regarding your last question, I do not know. However, I do believe, with a fairly high confidence, that no existing tool correctly and completely implement RDFS entailment, whether in its 2004 version or 2014's.