- From: Jos de Bruijn <debruijn@inf.unibz.it>
- Date: Mon, 13 Apr 2009 10:52:42 +0200
- To: Dave Reynolds <der@hplb.hpl.hp.com>
- CC: RIF WG Public list <public-rif-wg@w3.org>
Dave Reynolds wrote: > Jos de Bruijn wrote: >> <snip/> >> >>>> Therefore, the least of all evils seems to be to revert back to >>>> individual guard predicates for the datatypes, i.e., instead of >>>> isLiteralOfType we would have isLiteralInteger, isLiteralString, etc. >>>> I believe we do have sufficient grounds to override the previous >>>> resolution that established isLiteralOfType, because we did not realize >>>> at the time that it would cause so many problems. >>> I think here philosophy should be put aside and we should just use >>> anyURI ro >>> specify the data types in isLiteralOfType >> >> >> Like I said earlier, I can live with this solution. >> I wonder, though, what the real advantage is compared with the >> individual guard predicates. Sure, you don't have to specify the "short >> names" the datatypes and have a little bit more flexibility, but not all >> that much. >> The thing is that this predicate cannot be as flexible as one might >> expect. Particularly, we need to restrict the domain of the second >> argument to the anyURIs of known datatypes (at least, there cannot be >> anyURIs in the domain beyond the ones that are known to identify >> datatypes), in order to prevent invisible extensions [1]. > > The dialects are already parameterized by the set of datatypes, just as > they are by the set of externals, I don't see this as an "invisible > extension". I'm not sure what you're saying. I'm just outlining a restriction we need to impose to prevent invisible extensions. If we don't restrict the domain of the predicate we end up with the following situation: If the datatype xs:int is not known (e.g., you're using strict BLD), isLiteralOfType("1"^^xs:integer, "....int"^^anyURI) is false. If you use an extension that recognizes xs:int, isLiteralOfType("1"^^xs:integer, "....int"^^anyURI) becomes true. So, we need to restrict the domain of the predicate so that in this example isLiteralOfType("1"^^xs:integer, "....int"^^anyURI) is not false if xs:int in unknown, but rather the truth value is unknown so that implementations will raise errors, so that dialects that recognize xs:int are not hidden extensions. > >> This means >> you cannot use isLiteralOfType to "extract" the datatypes of literals. > > Are you saying this just because of binding patterns? I assume that > once this question is settled, and especially if we end up using > xsd:anyIRI for isLiteralOfType, then we'll give it the binding pattern > (b,u). I'm saying this because if you put an unbound variable in the second position, you end up with undefined truth values and so the implementation should raise an error, as in the example below. I would thus say that the binding pattern (b,u) is a no-go. Jos > >> Consider the rule >> >> myType(?x) :- External(isLiteralOfType("1"^^xs:int, ?x)) >> >> Now, if the variable ?x is assigned to ".....decimal"^^anyURI, >> isLiteralOfType("1"^^xs:int, ?x) is true. However, if ?x is assigned to >> "http://bla"^^anyURI, the predicate is assigned an arbitrary truth >> value. So, if the RIF implementation is adopting good practice, it will >> return an error when executing this rule. > > Fine. > >> So, in practice, you are limited to using constants as the second >> argument, or a very limited form of quantification. > > Or an unbound variable. > > Dave > -- +43 1 58801 18470 debruijn@inf.unibz.it Jos de Bruijn, http://www.debruijn.net/ ---------------------------------------------- Many would be cowards if they had courage enough. - Thomas Fuller
Received on Monday, 13 April 2009 08:53:25 UTC